gcc/testsuite/gcc.c-torture/execute/pr110165-1.c
raw| 1 | struct s |
| 2 | { |
| 3 | int t : 1; |
| 4 | }; |
| 5 | |
| 6 | int f(struct s t, int a, int b) __attribute__((noinline)); |
| 7 | int f(struct s t, int a, int b) |
| 8 | { |
| 9 | int bd = t.t; |
| 10 | if (bd) a|=b; |
| 11 | return a; |
| 12 | } |
| 13 | |
| 14 | int main(void) |
| 15 | { |
| 16 | struct s t; |
| 17 | for(int i = -1;i <= 1; i++) |
| 18 | { |
| 19 | int a = 0x10; |
| 20 | int b = 0x0f; |
| 21 | int c = a | b; |
| 22 | struct s t = {i}; |
| 23 | int r = f(t, a, b); |
| 24 | int exp = (i != 0) ? a | b : a; |
| 25 | if (exp != r) |
| 26 | __builtin_abort(); |
| 27 | } |
| 28 | } |