Negative test for FunctionControl.

This commit is contained in:
Dejan Mircevski 2015-10-13 16:00:01 -04:00 committed by David Neto
parent 2fc334c701
commit cc936dc613

View 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