blob: 1d068a2de43c53fb59c0dc65aa2a6be881647a3f [file] [log] [blame]
Daniel Dunbarffd408a2009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Eli Friedman9c0e6f92009-02-28 05:41:13 +00002
3int test1(int x) {
4 goto L; // expected-error{{illegal jump}}
5 int a[x];
6 L:
7 return sizeof a;
8}
Eli Friedmanea917292009-02-28 06:22:14 +00009
10int test2(int x) {
11 goto L; // expected-error{{illegal jump}}
12 typedef int a[x];
13 L:
14 return sizeof(a);
15}
16
17void test3clean(int*);
18
19int test3() {
20 goto L; // expected-error{{illegal jump}}
Chris Lattner01c5fc02009-04-18 07:54:11 +000021int a __attribute((cleanup(test3clean)));
22L:
Eli Friedmanea917292009-02-28 06:22:14 +000023 return a;
24}
Steve Naroffd91d1f82009-04-15 16:58:41 +000025
26int test4(int x) {
Chris Lattner01c5fc02009-04-18 07:54:11 +000027 goto L; // expected-error{{illegal jump}}
28int a[x];
29 test4(x);
30L:
31 return sizeof a;
Steve Naroffd91d1f82009-04-15 16:58:41 +000032}
Chris Lattner01c5fc02009-04-18 07:54:11 +000033
34int test5(int x) {
35 int a[x];
36 test5(x);
37 goto L; // Ok.
38L:
39 goto L; // Ok.
40 return sizeof a;
41}
42
43
44// FIXME: Switch cases etc.