summaryrefslogtreecommitdiffstats
path: root/llvm/test/Verifier/invoke.ll
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-08-10 20:55:20 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-08-10 20:55:20 +0000
commit4c923b3b3fd0ac1edebf0603265ca3ba51724937 (patch)
tree2970931a65008a8180e6a9f82de6b4b9f0d645bc /llvm/test/Verifier/invoke.ll
parent4210713491e1986dc6878a1bf86ad42b41b11bb2 (diff)
downloadbcm5719-llvm-4c923b3b3fd0ac1edebf0603265ca3ba51724937.tar.gz
bcm5719-llvm-4c923b3b3fd0ac1edebf0603265ca3ba51724937.zip
The normal edge of an invoke is not allowed to branch to a block with a
landingpad. Enforce it in the verifier, and fix the regression tests to match. llvm-svn: 161697
Diffstat (limited to 'llvm/test/Verifier/invoke.ll')
-rw-r--r--llvm/test/Verifier/invoke.ll19
1 files changed, 17 insertions, 2 deletions
diff --git a/llvm/test/Verifier/invoke.ll b/llvm/test/Verifier/invoke.ll
index 06f40f00527..a48f9b60feb 100644
--- a/llvm/test/Verifier/invoke.ll
+++ b/llvm/test/Verifier/invoke.ll
@@ -34,9 +34,12 @@ define void @f1() {
entry:
; OK
invoke void @llvm.donothing()
- to label %cont unwind label %cont
+ to label %conta unwind label %contb
-cont:
+conta:
+ ret void
+
+contb:
%0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
filter [0 x i8*] zeroinitializer
ret void
@@ -63,3 +66,15 @@ entry:
%call = call i32 @fn(i8 (i8, i8)* @llvm.expect.i8)
ret i32 %call
}
+
+define void @f4() {
+entry:
+ invoke void @llvm.donothing()
+ to label %cont unwind label %cont
+
+cont:
+; CHECK: Block containing LandingPadInst must be jumped to only by the unwind edge of an invoke.
+ %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ filter [0 x i8*] zeroinitializer
+ ret void
+}
OpenPOWER on IntegriCloud