1 /* Copyright (C) 2003 Free Software Foundation. 2 3 Test that switch statements suitable using case bit tests are 4 implemented correctly. 5 6 Written by Roger Sayle, 01/25/2001. */ 7 8 extern void abort (void); 9 10 int foo(int x)11foo (int x) 12 { 13 switch (x) 14 { 15 case 4: 16 case 6: 17 case 9: 18 case 11: 19 return 30; 20 } 21 return 31; 22 } 23 24 int main()25main () 26 { 27 int i, r; 28 29 for (i=-1; i<66; i++) 30 { 31 r = foo (i); 32 if (i == 4) 33 { 34 if (r != 30) 35 abort (); 36 } 37 else if (i == 6) 38 { 39 if (r != 30) 40 abort (); 41 } 42 else if (i == 9) 43 { 44 if (r != 30) 45 abort (); 46 } 47 else if (i == 11) 48 { 49 if (r != 30) 50 abort (); 51 } 52 else if (r != 31) 53 abort (); 54 } 55 return 0; 56 } 57 58