diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-08 00:58:25 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-08 00:58:25 +0000 |
| commit | 08281fa337a2e080aa5766f921de8d480b090eb5 (patch) | |
| tree | da44e3d311dcd5d3f431c7f830b37e0c6add10e9 /clang/test | |
| parent | 1ecd56448746210a2e10f03729791ee2a036a3f6 (diff) | |
| download | bcm5719-llvm-08281fa337a2e080aa5766f921de8d480b090eb5.tar.gz bcm5719-llvm-08281fa337a2e080aa5766f921de8d480b090eb5.zip | |
[arcmt] Follow-up for r171484; make sure when adding brackets enclosing case statements,
that the case does not "contain" a declaration that is referenced "outside" of it,
otherwise we will emit un-compilable code.
llvm-svn: 171828
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/ARCMT/checking.m | 5 | ||||
| -rw-r--r-- | clang/test/ARCMT/protected-scope.m | 1 | ||||
| -rw-r--r-- | clang/test/ARCMT/protected-scope.m.result | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/clang/test/ARCMT/checking.m b/clang/test/ARCMT/checking.m index b0d3243254c..9fd50029d03 100644 --- a/clang/test/ARCMT/checking.m +++ b/clang/test/ARCMT/checking.m @@ -181,9 +181,10 @@ void test6(unsigned cond) { switch (cond) { case 0: ; - id x; + id x; // expected-note {{jump bypasses initialization of retaining variable}} - case 1: + case 1: // expected-error {{switch case is in protected scope}} + x = 0; break; } } diff --git a/clang/test/ARCMT/protected-scope.m b/clang/test/ARCMT/protected-scope.m index b33382ed50f..8aece44d4ff 100644 --- a/clang/test/ARCMT/protected-scope.m +++ b/clang/test/ARCMT/protected-scope.m @@ -18,6 +18,7 @@ void test(id p, int x) { id w3 = p; break; case 2: + case 3: break; default: break; diff --git a/clang/test/ARCMT/protected-scope.m.result b/clang/test/ARCMT/protected-scope.m.result index 42d58b82216..f385d8825de 100644 --- a/clang/test/ARCMT/protected-scope.m.result +++ b/clang/test/ARCMT/protected-scope.m.result @@ -20,6 +20,7 @@ void test(id p, int x) { break; } case 2: + case 3: break; default: break; |

