PR c/56980
[official-gcc.git] / gcc / testsuite / gcc.dg / pr42662.c
blob6f416e826765f59cf42923e0319d0300855af165
1 /* PR debug/42662 */
2 /* { dg-do compile } */
3 /* { dg-options "-g -O2" } */
5 struct S { unsigned long s[17]; };
7 static inline void
8 foo (struct S *r, struct S *a, unsigned n)
10 unsigned b = n / 8;
11 r->s[0] = (b >= 1 ? : a->s[1 - b]);
14 static inline void
15 bar (struct S *r, struct S *a)
17 r->s[0] = a->s[0] << 1;
20 static inline void
21 baz (struct S *r, struct S *a, struct S *b)
23 unsigned c = 0;
24 int i;
25 for (i = 0; i < 3; ++i)
27 unsigned long d = a->s[i];
28 long e = d + b->s[i];
29 if (c)
30 ++e == 0;
31 c = e < d;
32 r->s[i] = e;
36 void
37 test (struct S *r, int s, int d)
39 struct S u;
40 if (s)
42 bar (&u, r);
43 foo (r, r, 3);
44 baz (r, r, &u);
46 u.s[0] = d;
47 baz (r, r, &u);