blob: d09ad9c5d5526ec43cf74e4db59362326a777f29 [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}}
21 int a __attribute((cleanup(test3clean)));
22 L:
23 return a;
24}
Steve Naroffd91d1f82009-04-15 16:58:41 +000025
26int test4(int x) {
27 goto L; // expected-error{{illegal jump}}
28 int a[x];
29 test4(x);
30 L:
31 return sizeof a;
32}