2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / opt / anonunion1.C
blob445ebaa7cb12d53d7e1f6bc14009c210bf52b7f5
1 // PR c++/5748
2 // This testcase ICEd because used flag from the anon union variables
3 // was not propagated back to the anon union itself, causing addressof
4 // not to be replaced with stack slot.
5 // { dg-do compile }
6 // { dg-options "-O2" }
8 struct A {
9   A ();
10   ~A ();
11   int foo ();
12   int bar (void *x, int y);
15 int A::foo()
17   union {
18     int a;
19     int b;
20   };
22   if (bar (&a, sizeof (int)) != 32)
23     return 16;
24   return 0;