gcc/testsuite/gcc.target/i386/pr46091-4a.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2" } */ |
| 3 | /* { dg-additional-options "-mregparm=2" { target ia32 } } */ |
| 4 | |
| 5 | int test_1 (int x, int n) |
| 6 | { |
| 7 | n &= 0x1f; |
| 8 | |
| 9 | x &= ~(0x01 << n); |
| 10 | |
| 11 | return x; |
| 12 | } |
| 13 | |
| 14 | int test_2 (int x, int n) |
| 15 | { |
| 16 | n &= 0x1f; |
| 17 | |
| 18 | x |= (0x01 << n); |
| 19 | |
| 20 | return x; |
| 21 | } |
| 22 | |
| 23 | int test_3 (int x, int n) |
| 24 | { |
| 25 | n &= 0x1f; |
| 26 | |
| 27 | x ^= (0x01 << n); |
| 28 | |
| 29 | return x; |
| 30 | } |
| 31 | |
| 32 | /* { dg-final { scan-assembler-not "and\[lq\]\[ \t\]" } } */ |