Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/switch-warn-2.c @ 144:8f4e72ab4e11
fix segmentation fault caused by nothing next cur_op to end
author | Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 23 Dec 2018 21:23:56 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* This should not warn about the case label being out of range. */ |
2 /* { dg-do run } */ | |
3 /* { dg-options "-O0" } */ | |
4 | |
5 extern void abort (void); | |
6 extern void exit (int); | |
7 | |
8 int | |
9 foo (unsigned int i) | |
10 { | |
11 switch (i) | |
12 { | |
13 case 123456123456ULL: /* { dg-warning "conversion from .long long unsigned int. to .unsigned int. changes value" } */ | |
14 return 0; | |
15 default: | |
16 return 3; | |
17 } | |
18 } | |
19 | |
20 int | |
21 main (void) | |
22 { | |
23 if (foo (10) != 3) | |
24 abort (); | |
25 exit (0); | |
26 } |