mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 16:41:06 +03:00

Compatible with DMD, but restricted to Windows and functions only. `export` functions with bodies get the dllexport attribute and will be exported if the containing object is pulled in when linking. Body-less `export` functions get the dllimport attribute and will be accessed via an import table indirection, set up at runtime by the OS. This is a temporary solution, the proper fix is a pending DMD PR, after which LDC will need to be adapted.
19 lines
462 B
D
19 lines
462 B
D
// Make sure exported functions can be cross-module inlined without exporting the local function copy.
|
|
|
|
// REQUIRES: atleast_llvm307
|
|
|
|
// RUN: %ldc -O -release -enable-cross-module-inlining -output-ll -of=%t.ll -I%S/inputs %s
|
|
// RUN: FileCheck %s < %t.ll
|
|
|
|
import export2;
|
|
|
|
// CHECK-NOT: _D7export23fooFZi
|
|
|
|
// CHECK: define {{.*}}_D26export_crossModuleInlining3barFZi
|
|
int bar()
|
|
{
|
|
// CHECK-NEXT: ret i32 666
|
|
return foo();
|
|
}
|
|
|
|
// CHECK-NOT: _D7export23fooFZi
|