]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/runnable/manboy.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / runnable / manboy.d
1 // PERMUTE_ARGS:
2
3 import std.stdio;
4
5 int a(int k, lazy int x1, lazy int x2, lazy int x3, lazy int x4, lazy int x5)
6 {
7 int delegate() b;
8 b = { k -= 1; return a(k, b(), x1, x2, x3, x4); };
9 if (k <= 0)
10 return x4 + x5;
11 else
12 return b();
13 }
14
15 int main()
16 {
17 assert(a(10, 1, -1, -1, 1, 0) == -67);
18 return 0;
19 }
20