mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 00:55:49 +03:00

LTO needs linker support: I am only aware of support on OS X and Linux (through the LLVMgold plugin). Resolves #693
26 lines
338 B
D
26 lines
338 B
D
// ThinLTO: Test that module ctors/dtors are called
|
|
|
|
// REQUIRES: atleast_llvm309
|
|
// REQUIRES: LTO
|
|
|
|
// RUN: %ldc -flto=thin -O3 -run %s | FileCheck %s
|
|
|
|
// CHECK: ctor
|
|
// CHECK: main
|
|
// CHECK: dtor
|
|
|
|
import core.stdc.stdio;
|
|
|
|
static this()
|
|
{
|
|
puts("ctor\n");
|
|
}
|
|
|
|
static ~this()
|
|
{
|
|
puts("dtor\n");
|
|
}
|
|
|
|
void main() {
|
|
puts("main\n");
|
|
}
|