Enable flate-combine.
[official-gcc.git] / gcc / testsuite / g++.dg / abi / no_unique_address1.C
blob853726dd4b0cf609d3a8f0ea612a731dc50317f5
1 // { dg-do run { target c++2a } }
3 struct B { };
5 struct A
7   [[no_unique_address]] B b;
8   int i;
9 };
11 struct C
13   B b;
14   int i;
17 struct D: B { };
19 struct E
21   B b [[no_unique_address]];
22   D d [[no_unique_address]];
25 constexpr bool same (void *x, void *y) { return x == y; }
27 int main()
29   A a;
30   if (!same(&a.b, &a.i))
31     __builtin_abort();
32   C c;
33   if (same(&c.b, &c.i))
34     __builtin_abort();
35   E e;
36   if (same (&e.b, &e.d))
37     __builtin_abort();