PR c++/81917 - ICE with void_t and partial specialization.
[official-gcc.git] / gcc / testsuite / g++.dg / opt / pr36449.C
blobf665980402b82815c123c01e7049f2a1cfd84201
1 // PR middle-end/36449
2 // { dg-do run }
3 // { dg-options "-O3" }
5 extern "C" void exit (int);
6 extern "C" void abort ();
8 struct R
10   short a;
11   short b;
14 struct S
16   R e;
17   long f;
18   long g;
21 struct T
23   short c;
24   short d;
27 struct U
29   long h[0x1ffffff + 1];
30   T i;
33 U *j;
35 void __attribute__((noinline))
36 bar ()
38   exit (0);
41 void __attribute__((noinline))
42 foo ()
44   S s;
46   s.e.a = 36;
47   s.e.b = 38;
48   if (s.e.a == j->i.c && s.e.b == j->i.d)
49     bar ();
52 int
53 main ()
55   try
56     {
57       j = new U;
58     }
59   catch (...)
60     {
61       return 0;
62     }
63   j->i.c = 36;
64   j->i.d = 38;
65   j->h[0] = 1;
66   j->h[1] = 2;
67   j->h[2] = 3;
68   foo ();
69   abort ();