From 08281fa337a2e080aa5766f921de8d480b090eb5 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 8 Jan 2013 00:58:25 +0000 Subject: [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 --- clang/test/ARCMT/checking.m | 5 +++-- clang/test/ARCMT/protected-scope.m | 1 + clang/test/ARCMT/protected-scope.m.result | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'clang/test') 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; -- cgit v1.2.3