1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3 /* { dg-options "-O2 --param case-values-threshold=20" } */
4 /* { dg-final { scan-assembler-not "mtctr" } } */
5 /* { dg-final { scan-assembler-not "bctr" } } */
7 /* Force using if tests, instead of a dispatch table. */
9 extern long call (long);
12 test_switch (long a
, long b
)
18 case 0: c
= -b
; break;
19 case 1: c
= ~b
; break;
20 case 2: c
= b
+1; break;
21 case 3: c
= b
-2; break;
22 case 4: c
= b
*3; break;
23 case 5: c
= b
/4; break;
24 case 6: c
= b
<<5; break;
25 case 7: c
= b
>>6; break;
26 case 8: c
= b
|7; break;
27 case 9: c
= b
^8; break;
28 default: c
= b
&9; break;