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

index d65fffb..bfcd781 100644 (file)
@@ -71,6 +71,12 @@ TEST_F(OpSelectionMergeTest, CombinedSelectionControlMask) {
               Eq(MakeInstruction(spv::OpSelectionMerge, {1, expected_mask})));
 }
 
+TEST_F(OpSelectionMergeTest, WrongSelectionControl) {
+  // Case sensitive: "flatten" != "Flatten" and thus wrong.
+  EXPECT_THAT(CompileFailure("OpSelectionMerge %1 flatten|DontFlatten"),
+              Eq("Invalid selection control 'flatten|DontFlatten'."));
+}
+
 // Test OpLoopMerge
 
 using OpLoopMergeTest = spvtest::TextToBinaryTestBase<