xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/rdar6248119.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only %s -verify -fobjc-exceptions
2*f4a2713aSLionel Sambuc// expected-no-diagnostics
3*f4a2713aSLionel Sambuc// Test case for:
4*f4a2713aSLionel Sambuc//   <rdar://problem/6248119> @finally doesn't introduce a new scope
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambucvoid f0() {
7*f4a2713aSLionel Sambuc  int i;
8*f4a2713aSLionel Sambuc  @try {
9*f4a2713aSLionel Sambuc  } @finally {
10*f4a2713aSLionel Sambuc    int i = 0;
11*f4a2713aSLionel Sambuc  }
12*f4a2713aSLionel Sambuc}
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambucvoid f1() {
15*f4a2713aSLionel Sambuc  int i;
16*f4a2713aSLionel Sambuc  @try {
17*f4a2713aSLionel Sambuc    int i =0;
18*f4a2713aSLionel Sambuc  } @finally {
19*f4a2713aSLionel Sambuc  }
20*f4a2713aSLionel Sambuc}
21*f4a2713aSLionel Sambuc
22*f4a2713aSLionel Sambucvoid f2() {
23*f4a2713aSLionel Sambuc  int i;
24*f4a2713aSLionel Sambuc  @try {
25*f4a2713aSLionel Sambuc  } @catch(id e) {
26*f4a2713aSLionel Sambuc    int i = 0;
27*f4a2713aSLionel Sambuc  }
28*f4a2713aSLionel Sambuc}
29