From cc936dc61321abe51e285bc1bf21d8b017ebd8ff Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Tue, 13 Oct 2015 16:00:01 -0400 Subject: [PATCH] Negative test for FunctionControl. --- test/TextToBinary.Function.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/TextToBinary.Function.cpp b/test/TextToBinary.Function.cpp index 534ae5cfe..33f5e032a 100644 --- a/test/TextToBinary.Function.cpp +++ b/test/TextToBinary.Function.cpp @@ -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