summaryrefslogtreecommitdiffstats
path: root/test/Verifier
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
commit6b951b25c35f739ee0a1b5a4615718220830817d (patch)
treef694880df3f60acec17d71960f8c6652927e8733 /test/Verifier
parentd9b45125935b05578255501a7e05fba9de603609 (diff)
downloadexternal_llvm-6b951b25c35f739ee0a1b5a4615718220830817d.zip
external_llvm-6b951b25c35f739ee0a1b5a4615718220830817d.tar.gz
external_llvm-6b951b25c35f739ee0a1b5a4615718220830817d.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Verifier')
-rw-r--r--test/Verifier/invoke.ll19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/Verifier/invoke.ll b/test/Verifier/invoke.ll
index 06f40f0..a48f9b6 100644
--- a/test/Verifier/invoke.ll
+++ b/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
+}