Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/pr16458-4.c

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