Daniel Dunbar | ffd408a | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Eli Friedman | 9c0e6f9 | 2009-02-28 05:41:13 +0000 | [diff] [blame] | 2 | |
| 3 | int test1(int x) { |
| 4 | goto L; // expected-error{{illegal jump}} |
| 5 | int a[x]; |
| 6 | L: |
| 7 | return sizeof a; |
| 8 | } |
Eli Friedman | ea91729 | 2009-02-28 06:22:14 +0000 | [diff] [blame] | 9 | |
| 10 | int test2(int x) { |
| 11 | goto L; // expected-error{{illegal jump}} |
| 12 | typedef int a[x]; |
| 13 | L: |
| 14 | return sizeof(a); |
| 15 | } |
| 16 | |
| 17 | void test3clean(int*); |
| 18 | |
| 19 | int test3() { |
| 20 | goto L; // expected-error{{illegal jump}} |
| 21 | int a __attribute((cleanup(test3clean))); |
| 22 | L: |
| 23 | return a; |
| 24 | } |
Steve Naroff | d91d1f8 | 2009-04-15 16:58:41 +0000 | [diff] [blame^] | 25 | |
| 26 | int test4(int x) { |
| 27 | goto L; // expected-error{{illegal jump}} |
| 28 | int a[x]; |
| 29 | test4(x); |
| 30 | L: |
| 31 | return sizeof a; |
| 32 | } |