mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 09:00:33 +03:00
20 lines
273 B
D
20 lines
273 B
D
|
|
// RUN: %ldc -enable-dynamic-compile -run %s
|
|
|
|
import ldc.attributes;
|
|
import ldc.dynamic_compile;
|
|
|
|
@dynamicCompile int foo(int i)
|
|
{
|
|
if (i > 0)
|
|
{
|
|
return foo(i - 1) + 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
void main(string[] args)
|
|
{
|
|
compileDynamicCode();
|
|
assert(15 == foo(15));
|
|
}
|