diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-01-06 20:01:02 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-01-06 20:01:02 +0000 |
| commit | 8a6c1c25bce0267ee4072bd7b786b921e8a66a35 (patch) | |
| tree | ea70b740d40cffe568a990c7aecd1acb5f83f786 /test/Verifier | |
| parent | 84fe440ded1bfc237d720c49408b36798d67ceff (diff) | |
Notes
Diffstat (limited to 'test/Verifier')
| -rw-r--r-- | test/Verifier/invalid-eh.ll | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/test/Verifier/invalid-eh.ll b/test/Verifier/invalid-eh.ll index 906b24a15c30a..21e88d4dcb3da 100644 --- a/test/Verifier/invalid-eh.ll +++ b/test/Verifier/invalid-eh.ll @@ -2,6 +2,12 @@ ; 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 +; RUN: sed -e s/.T5:// %s | not opt -verify -disable-output 2>&1 | FileCheck --check-prefix=CHECK5 %s +; RUN: sed -e s/.T6:// %s | not opt -verify -disable-output 2>&1 | FileCheck --check-prefix=CHECK6 %s +; RUN: sed -e s/.T7:// %s | not opt -verify -disable-output 2>&1 | FileCheck --check-prefix=CHECK7 %s +; RUN: sed -e s/.T8:// %s | not opt -verify -disable-output 2>&1 | FileCheck --check-prefix=CHECK8 %s + +declare void @g() ;T1: define void @f() { ;T1: entry: @@ -36,3 +42,57 @@ ;T4: cleanupret from %x unwind to caller ;T4: ; CHECK4: CleanupReturnInst needs to be provided a CleanupPad ;T4: } + +;T5: define void @f() personality void ()* @g { +;T5: entry: +;T5: ret void +;T5: switch: +;T5: %cs = catchswitch within none [label %catch] unwind to caller +;T5: catch: +;T5: catchpad within %cs [] +;T5: unreachable +;T5: bogus: +;T5: cleanuppad within %cs [] +;T5: ; CHECK5: CleanupPadInst has an invalid parent +;T5: unreachable +;T5: } + +;T6: define void @f() personality void ()* @g { +;T6: entry: +;T6: ret void +;T6: switch1: +;T6: %cs1 = catchswitch within none [label %catch1] unwind label %catch2 +;T6: ; CHECK6: Block containg CatchPadInst must be jumped to only by its catchswitch +;T6: catch1: +;T6: catchpad within %cs1 [] +;T6: unreachable +;T6: switch2: +;T6: %cs2 = catchswitch within none [label %catch2] unwind to caller +;T6: catch2: +;T6: catchpad within %cs2 [] +;T6: unreachable +;T6: } + +;T7: define void @f() personality void ()* @g { +;T7: entry: +;T7: ret void +;T7: switch1: +;T7: %cs1 = catchswitch within none [label %catch1] unwind to caller +;T7: catch1: +;T7: catchpad within %cs1 [] +;T7: unreachable +;T7: switch2: +;T7: %cs2 = catchswitch within %cs1 [label %catch2] unwind to caller +;T7: ; CHECK7: CatchSwitchInst has an invalid parent +;T7: catch2: +;T7: catchpad within %cs2 [] +;T7: unreachable +;T7: } + +;T8: define void @f() personality void ()* @g { +;T8: entry: +;T8: ret void +;T8: switch1: +;T8: %cs1 = catchswitch within none [ label %switch1 ] unwind to caller +;T8: ; CHECK8: CatchSwitchInst handlers must be catchpads +;T8: } |
