Debian Codegraph @

gcc/testsuite/gdc.test/runnable/issue24168.d

raw
1 /*
2 REQUIRED_ARGS: -fPIE
3 DISABLED: win32 win64
4 */
5
6 //https://issues.dlang.org/show_bug.cgi?id=24168
7
8 int i = 42;
9
10 bool foo(ref int a)
11 {
12 return a == 42;
13 }
14
15 ref int bar()
16 {
17 return i;
18 }
19
20 bool baz()
21 {
22 static int i = 42;
23 return foo(i);
24 }
25
26 void main()
27 {
28 assert(foo(i));
29 assert(bar() == 42);
30 assert(baz());
31 }