Debian Codegraph @

gcc/testsuite/gdc.dg/torture/pr96156.d

raw
1 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96156
2 // { dg-do run }
3 // { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
4
5 struct S96156
6 {
7 __gshared void* ptr;
8 int x;
9
10 this(int x) { ptr = &this; this.x = x; }
11 @disable this(this);
12 }
13
14 auto f96156()
15 {
16 return g96156();
17 }
18
19 auto g96156()
20 {
21 return h96156();
22 }
23
24 auto h96156()
25 {
26 return S96156(100);
27 }
28
29 void main()
30 {
31 auto s = f96156();
32 assert(&s == S96156.ptr);
33 }