Debian Codegraph @

gcc/testsuite/g++.dg/abi/empty8.C

raw
1 // { dg-do run }
2 // { dg-options "-fabi-version=0" }
3
4 struct E1 {};
5 struct E2 : public E1 {};
6 struct S1 { int i; };
7 struct S2 : public S1, E2 {};
8 #if __cpp_attributes
9 struct S22 : public S1
10 {
11 [[no_unique_address]] E2 e2;
12 } s22;
13 #endif
14
15 S2 s2;
16
17 int main () {
18 if ((char *)(E2*) &s2 != (char *)&s2)
19 return 1;
20 #if __cpp_attributes
21 if ((char *)&s22.e2 != (char *)&s22)
22 return 2;
23 #endif
24 }