summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/eh.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-07-28 01:07:35 +0000
committerJohn McCall <rjmccall@apple.com>2010-07-28 01:07:35 +0000
commit413e67778d593215d2f2161a4e712c8568f1ddd0 (patch)
treeb60f39de30d8e7421a919d01fd87d1f7173947c4 /test/CodeGenCXX/eh.cpp
parent7bce3a122296eba0e74f401c188e55c71935132f (diff)
When creating a jump destination, its scope should be the scope of the
enclosing normal cleanup, not the top of the EH stack. I'm *really* surprised this hasn't been causing more problems. Fixes rdar://problem/8231514. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109569 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/eh.cpp')
-rw-r--r--test/CodeGenCXX/eh.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/CodeGenCXX/eh.cpp b/test/CodeGenCXX/eh.cpp
index 3a2a38632f..0960ec381b 100644
--- a/test/CodeGenCXX/eh.cpp
+++ b/test/CodeGenCXX/eh.cpp
@@ -379,3 +379,38 @@ namespace test14 {
}
}
}
+
+// rdar://problem/8231514
+// JumpDests shouldn't get confused by scopes that aren't normal cleanups.
+namespace test15 {
+ struct A { ~A(); };
+
+ bool opaque(int);
+
+ // CHECK: define void @_ZN6test153fooEv()
+ void foo() {
+ A a;
+
+ try {
+ // CHECK: [[X:%.*]] = alloca i32
+ // CHECK: store i32 10, i32* [[X]]
+ // CHECK-NEXT: br label
+ // -> while.cond
+ int x = 10;
+
+ while (true) {
+ // CHECK: load i32* [[X]]
+ // CHECK-NEXT: [[COND:%.*]] = invoke zeroext i1 @_ZN6test156opaqueEi
+ // CHECK: br i1 [[COND]]
+ if (opaque(x))
+ // CHECK: br label
+ break;
+
+ // CHECK: br label
+ }
+ // CHECK: br label
+ } catch (int x) { }
+
+ // CHECK: call void @_ZN6test151AD1Ev
+ }
+}