re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20030907-1.c
1 /* PR optimization/12198
2
3 This was a miscompilation of a switch expressions because
4 the "Case Ranges" extension wasn't handled in tree-cfg.c. */
5
6 /* { dg-do compile } */
7 /* { dg-options "-O -fdump-tree-optimized" } */
8
9 extern void abort (void);
10 extern void exit (int);
11
12 int main()
13 {
14 int i;
15 i = 2;
16 switch (i)
17 {
18 case 1 ... 5:
19 goto L1;
20 default:
21 abort ();
22 goto L1;
23 }
24 L1:
25 exit(0);
26 }
27
28 /* The abort() call clearly is unreachable. */
29 /* { dg-final { scan-tree-dump-times "abort" 0 "optimized"} } */
30 /* { dg-final { cleanup-tree-dump "optimized" } } */