1 /* Test cse'ing of unsigned compares. */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fno-jump-tables" } */
4
5 /* { dg-final { scan-assembler-not "cmpwi" } } */
6 /* { dg-final { scan-assembler-times "cmplwi" 5 } } */
7
8 extern int case0 (void);
9 extern int case1 (void);
10 extern int case2 (void);
11 extern int case3 (void);
12 extern int case4 (void);
13
14 enum CASE_VALUES
15 {
16 CASE0 = 1,
17 CASE1,
18 CASE2,
19 CASE3,
20 CASE4
21 };
22
23 int
24 foo (enum CASE_VALUES index)
25 {
26 switch (index)
27 {
28 case CASE0:
29 return case0 ();
30 case CASE1:
31 return case1 ();
32 case CASE2:
33 return case2 ();
34 case CASE3:
35 return case3 ();
36 case CASE4:
37 return case4 ();
38 }
39
40 return 0;
41 }