Lines Matching +full:no +full:- +full:invalid +full:- +full:this
1 // Copyright (c) 2015-2016 The Khronos Group Inc.
4 // you may not use this file except in compliance with the License.
7 // http://www.apache.org/licenses/LICENSE-2.0
29 // To use this operator, this definition must appear in the same namespace
51 // An easily-constructible and comparable object for the contents of an
116 return static_cast<MockParseClient*>(user_data)->Header( in invoke_header()
123 return static_cast<MockParseClient*>(user_data)->Instruction( in invoke_instruction()
127 // The SPIR-V module header words for the Khronos Assembler generator,
134 // Returns the expected SPIR-V module header words for the Khronos
141 // Returns a parsed operand for a non-number value at the given word offset
181 // the given result Id for a 32-bit signed integer scalar type.
226 // Adds an EXPECT_CALL to client_->Header() with appropriate parameters,
241 EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. in TEST_F()
250 EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. in TEST_F()
259 words.push_back(0xffffffff); // Certainly invalid instruction header. in TEST_F()
261 EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. in TEST_F()
276 words.push_back(0xffffffff); // Certainly invalid instruction header. in TEST_F()
278 EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. in TEST_F()
294 EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. in TEST_F()
315 EXPECT_STREQ("Invalid opcode: 65535", message); in TEST_F()
318 words.push_back(0xffffffff); // Certainly invalid instruction header. in TEST_F()
320 EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. in TEST_F()
337 EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. in TEST_F()
354 words.push_back(0xffffffff); // Certainly invalid instruction header. in TEST_F()
356 EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. in TEST_F()
361 EXPECT_STREQ("Invalid opcode: 65535", diagnostic_->error); in TEST_F()
380 .Times(0); // No header callback. in TEST_F()
392 EXPECT_CALL(client_, Instruction(_)).Times(0); // No instruction callback. in TEST_F()
401 // This test exercises non-default values for the following members of the
427 // Early exit means no calls to Instruction(). in TEST_F()
443 // Early exit means no calls to Instruction(). in TEST_F()
503 0 /* No result id for OpName*/, operands.data(), in TEST_F()
507 // endian-swapped version. in TEST_F()
512 // Checks for non-zero values for the result_id and ext_inst_type members
540 // endian-swapped version. in TEST_F()
562 EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic)); in TEST_P()
582 // provided. We'll use this to express cases that can't be created
584 // or an invalid case the assembler would reject.
599 EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic)); in TEST_P()
606 "Invalid instruction word count: 0"},
611 "Invalid opcode: 65535"},
614 "Invalid instruction OpNop starting at word 5: expected "
615 "no more operands after 1 words, but stated word count is 2."},
619 "Invalid instruction OpNop starting at word 5: expected "
620 "no more operands after 1 words, but stated word count is 7."},
623 "Invalid instruction OpTypeVoid starting at word 5: expected "
624 "no more operands after 2 words, but stated word count is 3."},
627 "Invalid instruction OpTypeVoid starting at word 5: expected "
628 "no more operands after 2 words, but stated word count is 6."},
631 "Invalid instruction OpTypeInt starting at word 5: expected "
632 "no more operands after 4 words, but stated word count is 5."},
645 // Detect this a missing a multi-word operand to OpConstant.
647 // it only has 3. Corresponds to something like this:
654 " 9: missing possibly multi-word literal number operand at word "
656 // Detect when we provide only one word from the 64-bit literal,
662 " 9: truncated possibly multi-word literal number operand at word "
690 // In this case the instruction word count is too small, where
691 // it would truncate a multi-word operand to OpConstant.
695 "Invalid word count: OpConstant starting at word 9 says it has 4"
700 "Invalid word count: OpString starting at word 5 says it has 3"
707 {0 /* this word does not belong*/}}),
708 "Invalid instruction OpString starting at word 5: expected no more"
711 // literal. A linkage attribute decoration is the only case in SPIR-V
719 "Invalid instruction OpDecorate starting at word 5: expected no more"
728 "Invalid instruction OpDecorate starting at word 5: expected no more"
738 "Invalid instruction OpMemberDecorate starting at word 5: expected no"
747 "Invalid instruction OpMemberDecorate starting at word 5: expected no"
749 // Word count is too large. There should be no more words
755 "Invalid instruction OpDecorate starting at word 5: expected no"
763 "Invalid instruction OpDecorate starting at word 5: expected no"
783 "Invalid instruction OpExtInst starting at word 10: expected no "
785 // In this case, the OpSwitch selector refers to an invalid ID.
788 "Invalid OpSwitch: selector id 1 has no type"},
789 // In this case, the OpSwitch selector refers to an ID that has
790 // no type.
794 "Invalid OpSwitch: selector id 1 has no type"},
798 "Invalid OpSwitch: selector id 1 is a type, not a value"},
803 "Invalid OpSwitch: selector id 2 is not a scalar integer"},
806 MakeVector("invalid-import"))}),
807 "Invalid extended instruction import 'invalid-import'"},
837 EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic)); in TEST_P()
846 // An optional id is 0, in this case the optional
854 "Invalid extended instruction number: 999999"},
856 "Invalid OpSpecConstantOp opcode: 1000"},
857 {"OpCapability !9999", "Invalid capability operand: 9999"},
858 {"OpSource !9999 100", "Invalid source language operand: 9999"},
859 {"OpEntryPoint !9999", "Invalid execution model operand: 9999"},
860 {"OpMemoryModel !9999", "Invalid addressing model operand: 9999"},
861 {"OpMemoryModel Logical !9999", "Invalid memory model operand: 9999"},
862 {"OpExecutionMode %1 !9999", "Invalid execution mode operand: 9999"},
864 "Invalid storage class operand: 9999"},
865 {"%2 = OpTypeImage %1 !9999", "Invalid dimensionality operand: 9999"},
867 "Invalid image format operand: 9999"},
869 "Invalid floating-point rounding mode operand: 9999"},
871 "Invalid linkage type operand: 9999"},
872 {"%1 = OpTypePipe !9999", "Invalid access qualifier operand: 9999"},
874 "Invalid function parameter attribute operand: 9999"},
875 {"OpDecorate %1 !9999", "Invalid decoration operand: 9999"},
876 {"OpDecorate %1 BuiltIn !9999", "Invalid built-in operand: 9999"},
878 "Invalid group operation operand: 9999"},
880 "Invalid floating-point fast math mode operand: 63 has invalid mask "
883 "Invalid function control operand: 31 has invalid mask component 16"},
885 "Invalid loop control operand: 1027 has invalid mask component 1024"},
887 "Invalid image operand: 32770 has invalid mask component 32768"},
889 "Invalid selection control operand: 7 has invalid mask component 4"},