]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/g++.dg/cpp2a/desig8.C
rs6000, change altivec*-runnable.c test file names
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / cpp2a / desig8.C
1 // PR c++/84874
2 // { dg-do run { target c++17 } }
3 // { dg-options "" }
4
5 struct A { int a; struct { int b; }; };
6 struct B { A d; };
7
8 void
9 foo (B *x)
10 {
11 *x = { .d = { .b = 5 } };
12 }
13
14 void
15 bar (A *x)
16 {
17 *x = { .b = 6 };
18 }
19
20 int
21 main ()
22 {
23 B b = { { 2, 3 } };
24 foo (&b);
25 if (b.d.a != 0 || b.d.b != 5)
26 __builtin_abort ();
27 b.d.a = 8;
28 bar (&b.d);
29 if (b.d.a != 0 || b.d.b != 6)
30 __builtin_abort ();
31 }