Negative test for BuiltIn.
authorDejan Mircevski <deki@google.com>
Tue, 13 Oct 2015 19:39:38 +0000 (15:39 -0400)
committerDavid Neto <dneto@google.com>
Mon, 26 Oct 2015 16:55:33 +0000 (12:55 -0400)
source/operand.cpp
test/TextToBinary.Annotation.cpp

index 147019b..526afb5 100644 (file)
@@ -1353,7 +1353,7 @@ const char* spvOperandTypeStr(spv_operand_type_t type) {
     case SPV_OPERAND_TYPE_DECORATION:
       return "decoration";
     case SPV_OPERAND_TYPE_BUILT_IN:
-      return "built in";
+      return "built-in";
     case SPV_OPERAND_TYPE_SELECTION_CONTROL:
       return "selection control";
     case SPV_OPERAND_TYPE_LOOP_CONTROL:
index 684749b..9103ad2 100644 (file)
@@ -186,6 +186,11 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateBuiltIn, OpDecorateEnumTest,
 #undef CASE
 // clang-format on
 
+TEST_F(OpDecorateEnumTest, WrongBuiltIn) {
+  EXPECT_THAT(CompileFailure("OpDecorate %1 BuiltIn xxyyzz"),
+              Eq("Invalid built-in 'xxyyzz'."));
+}
+
 // Test OpDecorate FuncParamAttr
 // clang-format off
 #define CASE(NAME) \