summaryrefslogtreecommitdiffstats
path: root/llvm/test/Verifier
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Verifier')
-rw-r--r--llvm/test/Verifier/invalid-eh.ll38
1 files changed, 38 insertions, 0 deletions
diff --git a/llvm/test/Verifier/invalid-eh.ll b/llvm/test/Verifier/invalid-eh.ll
new file mode 100644
index 00000000000..906b24a15c3
--- /dev/null
+++ b/llvm/test/Verifier/invalid-eh.ll
@@ -0,0 +1,38 @@
+; RUN: sed -e s/.T1:// %s | not llvm-as -disable-output 2>&1 | FileCheck --check-prefix=CHECK1 %s
+; RUN: sed -e s/.T2:// %s | not llvm-as -disable-output 2>&1 | FileCheck --check-prefix=CHECK2 %s
+; RUN: sed -e s/.T3:// %s | not llvm-as -disable-output 2>&1 | FileCheck --check-prefix=CHECK3 %s
+; RUN: sed -e s/.T4:// %s | not llvm-as -disable-output 2>&1 | FileCheck --check-prefix=CHECK4 %s
+
+;T1: define void @f() {
+;T1: entry:
+;T1: catchret from undef to label %next
+;T1: ; CHECK1: CatchReturnInst needs to be provided a CatchPad
+;T1: next:
+;T1: unreachable
+;T1: }
+
+;T2: define void @f() {
+;T2: entry:
+;T2: %x = cleanuppad within none []
+;T2: ; catchret's first operand's operator must be catchpad
+;T2: catchret from %x to label %entry
+;T2: ; CHECK2: CatchReturnInst needs to be provided a CatchPad
+;T2: }
+
+;T3: define void @f() {
+;T3: entry:
+;T3: cleanupret from undef unwind label %next
+;T3: ; CHECK3: CleanupReturnInst needs to be provided a CleanupPad
+;T3: next:
+;T3: unreachable
+;T3: }
+
+;T4: define void @f() {
+;T4: entry:
+;T4: %cs = catchswitch within none [label %next] unwind to caller
+;T4: next:
+;T4: %x = catchpad within %cs []
+;T4: ; cleanupret first operand's operator must be cleanuppad
+;T4: cleanupret from %x unwind to caller
+;T4: ; CHECK4: CleanupReturnInst needs to be provided a CleanupPad
+;T4: }
OpenPOWER on IntegriCloud