Negative test for LoopControl.
authorDejan Mircevski <deki@google.com>
Tue, 13 Oct 2015 19:53:46 +0000 (15:53 -0400)
committerDavid Neto <dneto@google.com>
Mon, 26 Oct 2015 16:55:33 +0000 (12:55 -0400)
test/TextToBinary.ControlFlow.cpp

index bfcd781..2c2ccda 100644 (file)
@@ -107,6 +107,12 @@ TEST_F(OpLoopMergeTest, CombinedLoopControlMask) {
   EXPECT_THAT(CompiledInstructions(input),
               Eq(MakeInstruction(spv::OpLoopMerge, {1, 2, expected_mask})));
 }
+
+TEST_F(OpLoopMergeTest, WrongLoopControl) {
+  EXPECT_THAT(CompileFailure("OpLoopMerge %m %c none"),
+              Eq("Invalid loop control 'none'."));
+}
+
 // Test OpSwitch
 
 TEST_F(TextToBinaryTest, SwitchGoodZeroTargets) {