ldc/tests/linking/thinlto_modulecdtors.d
Johan Engelen bb24fb2816 Add LTO support (full and thin), with -flto=thin|full.
LTO needs linker support: I am only aware of support on OS X and Linux (through the LLVMgold plugin).

Resolves #693
2016-11-09 14:30:13 +01:00

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");
}