diff options
author | Eric Botcazou <ebotcazou@libertysurf.fr> | 2003-03-04 12:06:32 +0100 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2003-03-04 11:06:32 +0000 |
commit | 2ad1815d458820ca80fc82fdd9cb1695388e7f20 (patch) | |
tree | 92460f53d9e91b8dcf0b9b59cd6749d9166388c1 /gcc/testsuite/gcc.dg/switch-3.c | |
parent | e2483ef7c73635b42aa871ef48b7d8c7763c0e53 (diff) | |
download | gcc-2ad1815d458820ca80fc82fdd9cb1695388e7f20.zip gcc-2ad1815d458820ca80fc82fdd9cb1695388e7f20.tar.gz gcc-2ad1815d458820ca80fc82fdd9cb1695388e7f20.tar.bz2 |
re PR c/9262 (ICE on false case label)
PR c/9262
* c-typeck.c (do_case): Attach the first case label to the SWITCH_BODY.
(c_finish_case): Rechain the next statements to the SWITCH_STMT.
From-SVN: r63783
Diffstat (limited to 'gcc/testsuite/gcc.dg/switch-3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/switch-3.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/switch-3.c b/gcc/testsuite/gcc.dg/switch-3.c new file mode 100644 index 0000000..593c42d --- /dev/null +++ b/gcc/testsuite/gcc.dg/switch-3.c @@ -0,0 +1,12 @@ +/* PR c/9262 */ +/* Originator: Rasmus Hahn <rassahah@neofonie.de> */ +/* { dg-do compile } */ + +int foo(int i) +{ + switch (i) + case 3: + return 1; + case 4: /* { dg-error "not within a switch statement" } */ + return 1; +} |