aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pr16458-3.c
blob: 740d61dcc74f46afc522269314abff88477c50b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* Test cse'ing of unsigned compares.  */
/* { dg-do compile } */
/* { dg-options "-O2 -fno-jump-tables" } */

/* { dg-final { scan-assembler-not "cmpwi" } } */
/* { dg-final { scan-assembler-times "cmplwi" 5 } } */

extern int case0 (void);
extern int case1 (void);
extern int case2 (void);
extern int case3 (void);
extern int case4 (void);

enum CASE_VALUES
{
  CASE0 = 1,
  CASE1,
  CASE2,
  CASE3,
  CASE4
};

int
foo (enum CASE_VALUES index)
{
  switch (index)
    {
    case CASE0:
      return case0 ();
    case CASE1:
      return case1 ();
    case CASE2:
      return case2 ();
    case CASE3:
      return case3 ();
    case CASE4:
      return case4 ();
    }

  return 0;
}