diff options
-rw-r--r-- | lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp | 5 | ||||
-rw-r--r-- | test/NaCl/PNaClABI/instructions.ll | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp b/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp index d1d5f38405..ad01ae58a2 100644 --- a/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp +++ b/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp @@ -102,6 +102,9 @@ bool PNaClABIVerifyFunctions::runOnFunction(Function &F) { case Instruction::ExtractElement: case Instruction::InsertElement: case Instruction::ShuffleVector: + // ExtractValue and InsertValue operate on struct values. + case Instruction::ExtractValue: + case Instruction::InsertValue: Reporter->addError() << "Function " << F.getName() << " has disallowed instruction: " << BBI->getOpcodeName() << "\n"; @@ -132,8 +135,6 @@ bool PNaClABIVerifyFunctions::runOnFunction(Function &F) { case Instruction::And: case Instruction::Or: case Instruction::Xor: - case Instruction::ExtractValue: - case Instruction::InsertValue: // Memory instructions case Instruction::Alloca: case Instruction::Load: diff --git a/test/NaCl/PNaClABI/instructions.ll b/test/NaCl/PNaClABI/instructions.ll index 72134e76c5..f96b4567d1 100644 --- a/test/NaCl/PNaClABI/instructions.ll +++ b/test/NaCl/PNaClABI/instructions.ll @@ -58,7 +58,10 @@ define void @vectors() { define void @aggregates() { ; Aggregate operations %a1 = extractvalue { i32, i32 } { i32 0, i32 0 }, 0 +; CHECK-NOT: disallowed +; CHECK: Function aggregates has disallowed instruction: extractvalue %a2 = insertvalue {i32, float} undef, i32 1, 0 +; CHECK-NEXT: Function aggregates has disallowed instruction: insertvalue ret void } |