PR tree-optimization/84982
[official-gcc.git] / gcc / testsuite / c-c++-common / pr84982.c
blob3370a8313cbd22463da29c59d353096810266cb0
1 /* PR tree-optimization/84982 */
2 /* { dg-do run } */
3 /* { dg-options "-O2" } */
5 #ifndef __cplusplus
6 #define bool _Bool
7 #define true 1
8 #define false 0
9 #endif
11 struct S { bool a, b, c, d; };
13 __attribute__((noipa)) void
14 bar (bool *x)
16 if (x[0] || !x[1] || !x[2] || x[3])
17 __builtin_abort ();
20 __attribute__((noipa)) void
21 foo (struct S *x)
23 bool a[4];
24 a[0] = !x->a;
25 a[1] = !x->b;
26 a[2] = x->c;
27 a[3] = !x->d;
28 bar (a);
31 int
32 main ()
34 struct S s;
35 s.a = true; s.b = false; s.c = true; s.d = true;
36 foo (&s);
37 return 0;