1// { dg-do run } 2 3struct A 4{ 5 short int a1; 6 unsigned char a2; 7 unsigned int a3; 8}; 9 10struct B 11{ 12 unsigned short b1; 13 const A *b2; 14}; 15 16B b; 17 18__attribute__((noinline, noclone)) 19int foo (unsigned x) 20{ 21 __asm volatile ("" : "+r" (x) : : "memory"); 22 return x; 23} 24 25inline void 26bar (const int &) 27{ 28} 29 30__attribute__((noinline)) void 31baz () 32{ 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 } 44} 45 46int 47main () 48{ 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; 54} 55 56