mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 09:00:33 +03:00
28 lines
661 B
D
28 lines
661 B
D
|
|
// RUN: %ldc -enable-dynamic-compile -I%S %s %S/inputs/module1.d %S/inputs/module2.d %S/inputs/module3.d -run
|
|
// RUN: %ldc -enable-dynamic-compile -singleobj -I%S %s %S/inputs/module1.d %S/inputs/module2.d %S/inputs/module3.d -run
|
|
|
|
import ldc.attributes;
|
|
import ldc.dynamic_compile;
|
|
|
|
import inputs.module1;
|
|
import inputs.module2;
|
|
|
|
@dynamicCompile int foo()
|
|
{
|
|
return inputs.module1.get() + inputs.module2.get();
|
|
}
|
|
|
|
int bar()
|
|
{
|
|
return inputs.module1.get() + inputs.module2.get();
|
|
}
|
|
|
|
void main(string[] args)
|
|
{
|
|
compileDynamicCode();
|
|
assert(10 == inputs.module1.get());
|
|
assert(11 == inputs.module2.get());
|
|
assert(21 == foo());
|
|
assert(21 == bar());
|
|
}
|