Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / foldconst-1.c
blobcd785990f392f563ab3902fb4794882ee31435a3
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
3 void bar (unsigned int);
5 void
6 foo (void)
8 char buf[1] = { 3 };
9 const char *p = buf;
10 const char **q = &p;
11 unsigned int ch;
12 switch (**q)
14 case 1: ch = 5; break;
15 case 2: ch = 4; break;
16 case 3: ch = 3; break;
17 case 4: ch = 2; break;
18 case 5: ch = 1; break;
19 default: ch = 0; break;
21 bar (ch);
23 /* The switch should be switch converted and later constant propagated. */
24 /* { dg-final { scan-tree-dump-not "CSWTCH" "optimized"} } */
25 /* { dg-final { scan-tree-dump-not "switch" "optimized"} } */