gcc/testsuite/gdc.test/runnable/test20855.d
raw| 1 | // PERMUTE_ARGS: -O |
| 2 | // https://issues.dlang.org/show_bug.cgi?id=20855 |
| 3 | |
| 4 | string exp() |
| 5 | { |
| 6 | string s = "a = b + c * d + a;"; |
| 7 | foreach (i; 0 .. 8) |
| 8 | s = s ~ s; |
| 9 | return s; |
| 10 | } |
| 11 | |
| 12 | int test() |
| 13 | { |
| 14 | auto a=1, b=2, c=3, d=4; |
| 15 | mixin(exp()); |
| 16 | return a; |
| 17 | } |
| 18 | |
| 19 | import core.stdc.stdio; |
| 20 | |
| 21 | int main() |
| 22 | { |
| 23 | int a = test(); |
| 24 | printf("a = %d\n", a); |
| 25 | assert(test() == 3585); |
| 26 | return 0; |
| 27 | } |