* doc/invoke.texi: Document -std=c++17 and -std=gnu++17 and document
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr55875.C
blobfaadf88f49545b8e26ea6ba5159b63d61c5aae13
1 // { dg-do run }
3 struct A
5   short int a1;
6   unsigned char a2;
7   unsigned int a3;
8 };
10 struct B
12   unsigned short b1;
13   const A *b2;
16 B b;
18 __attribute__((noinline, noclone))
19 int foo (unsigned x)
21   __asm volatile ("" : "+r" (x) : : "memory");
22   return x;
25 inline void
26 bar (const int &)
30 __attribute__((noinline)) void
31 baz ()
33   const A *a = b.b2;
34   unsigned int i;
35   unsigned short n = b.b1;
36   for (i = 0; i < n; ++i)
37     if (a[i].a1 == 11)
38       {
39     if (i > 0 && (a[i - 1].a2 & 1))
40       continue;
41     bar (foo (2));
42     return;
43       }
46 int
47 main ()
49   A a[4] = { { 10, 0, 0 }, { 11, 1, 0 }, { 11, 1, 0 }, { 11, 1, 0 } };
50   b.b1 = 4;
51   b.b2 = a;
52   baz ();
53   return 0;