1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
3
4 /* { dg-final { scan-assembler-times "bset" 1 } } */
5 /* { dg-final { scan-assembler-times "bchg" 1 } } */
6 /* { dg-final { scan-assembler-times "bclr" 1 } } */
7
8 int bar (void);
9
10 int
foo1(int b)11 foo1 (int b)
12 {
13 int a = bar ();
14 return ( a | (1 << (b & 31)));
15 }
16
17 int
foo2(int b)18 foo2 (int b)
19 {
20 int a = bar ();
21 return ( a ^ (1 << (b & 31)));
22 }
23
24
25 int
foo3(int b)26 foo3 (int b)
27 {
28 int a = bar ();
29 return ( a & ~(1 << (b & 31)));
30 }
31
32
33