summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/scope-check.c
blob: d09ad9c5d5526ec43cf74e4db59362326a777f29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// RUN: clang-cc -fsyntax-only -verify %s

int test1(int x) {
  goto L; // expected-error{{illegal jump}}
  int a[x];
  L:
  return sizeof a;
}

int test2(int x) {
  goto L; // expected-error{{illegal jump}}
  typedef int a[x];
  L:
  return sizeof(a);
}

void test3clean(int*);

int test3() {
  goto L; // expected-error{{illegal jump}}
  int a __attribute((cleanup(test3clean)));
  L:
  return a;
}

int test4(int x) {
 goto L; // expected-error{{illegal jump}}
 int a[x];
 test4(x);
 L:
 return sizeof a;
}
OpenPOWER on IntegriCloud