gcc/testsuite/c-c++-common/pr101537.c
raw| 1 | /* PR c/101537 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-Wconversion" } */ |
| 4 | |
| 5 | int |
| 6 | foo () |
| 7 | { |
| 8 | int aaa = 1; |
| 9 | unsigned char bbb = 0; |
| 10 | bbb |= aaa ? 1 : 0; |
| 11 | return bbb; |
| 12 | } |
| 13 | |
| 14 | int |
| 15 | bar (unsigned char x, int f) |
| 16 | { |
| 17 | x |= f ? 1 : 0; |
| 18 | return x; |
| 19 | } |
| 20 | |
| 21 | int |
| 22 | baz (unsigned char x, int f) |
| 23 | { |
| 24 | x = x | f ? 1 : 0; |
| 25 | return x; |
| 26 | } |