diff options
-rw-r--r-- | lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp | 5 | ||||
-rw-r--r-- | test/NaCl/PNaClABI/instructions.ll | 18 |
2 files changed, 21 insertions, 2 deletions
diff --git a/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp b/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp index 5e773e9751..4c4c935ec5 100644 --- a/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp +++ b/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp @@ -67,6 +67,9 @@ bool PNaClABIVerifyFunctions::runOnFunction(Function &F) { default: // We expand GetElementPtr out into arithmetic. case Instruction::GetElementPtr: + // Zero-cost C++ exception handling is not supported yet. + case Instruction::Invoke: + case Instruction::LandingPad: // indirectbr may interfere with streaming case Instruction::IndirectBr: // No vector instructions yet @@ -84,7 +87,6 @@ bool PNaClABIVerifyFunctions::runOnFunction(Function &F) { case Instruction::Switch: case Instruction::Resume: case Instruction::Unreachable: - case Instruction::Invoke: // Binary operations case Instruction::Add: case Instruction::FAdd: @@ -134,7 +136,6 @@ bool PNaClABIVerifyFunctions::runOnFunction(Function &F) { case Instruction::Select: case Instruction::Call: case Instruction::VAArg: - case Instruction::LandingPad: break; } // Check the types. First check the type of the instruction. diff --git a/test/NaCl/PNaClABI/instructions.ll b/test/NaCl/PNaClABI/instructions.ll index 49585b1fca..e00e7f89f6 100644 --- a/test/NaCl/PNaClABI/instructions.ll +++ b/test/NaCl/PNaClABI/instructions.ll @@ -109,5 +109,23 @@ foo: bar: ret void } + +declare void @external_func() +declare void @personality_func() + +define void @invoke_func() { + invoke void @external_func() to label %ok unwind label %onerror +; CHECK-NOT: disallowed +; CHECK: Function invoke_func has disallowed instruction: invoke +ok: + ret void +onerror: + %lp = landingpad i32 + personality i8* bitcast (void ()* @personality_func to i8*) + catch i32* null +; CHECK-NEXT: Function invoke_func has disallowed instruction: landingpad + ret void +} + ; CHECK-NOT: disallowed ; If another check is added, there should be a check-not in between each check |