2008-03-21 Janne Blomqvist <jb@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / switch-warn-2.c
blob7778b66e087c4030ecd897dbd41c1301811b9502
1 /* This should not warn about the case label being out of range. */
2 /* { dg-do run } */
3 /* { dg-options "-O0" } */
5 extern void abort (void);
6 extern void exit (int);
8 int
9 foo (unsigned int i)
11 switch (i)
13 case 123456123456ULL: /* { dg-warning "large integer implicitly truncated to unsigned type" } */
14 return 0;
15 default:
16 return 3;
20 int
21 main (void)
23 if (foo (10) != 3)
24 abort ();
25 exit (0);