Negative test for FunctionControl.
authorDejan Mircevski <deki@google.com>
Tue, 13 Oct 2015 20:00:01 +0000 (16:00 -0400)
committerDavid Neto <dneto@google.com>
Mon, 26 Oct 2015 16:55:33 +0000 (12:55 -0400)
test/TextToBinary.Function.cpp

index 534ae5c..33f5e03 100644 (file)
@@ -65,7 +65,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryFunctionTest, OpFunctionControlTest,
 #undef CASE
 // clang-format on
 
-TEST_F(TextToBinaryTest, CombinedFunctionControlMask) {
+TEST_F(OpFunctionControlTest, CombinedFunctionControlMask) {
   // Sample a single combination.  This ensures we've integrated
   // the instruction parsing logic with spvTextParseMask.
   const std::string input =
@@ -77,6 +77,11 @@ TEST_F(TextToBinaryTest, CombinedFunctionControlMask) {
               Eq(MakeInstruction(spv::OpFunction, {1, 2, expected_mask, 3})));
 }
 
+TEST_F(OpFunctionControlTest, WrongFunctionControl) {
+  EXPECT_THAT(CompileFailure("%r = OpFunction %t Inline|Unroll %ft"),
+              Eq("Invalid function control 'Inline|Unroll'."));
+}
+
 // TODO(dneto): OpFunctionParameter
 // TODO(dneto): OpFunctionEnd
 // TODO(dneto): OpFunctionCall