case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER:
case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER:
+ parsed_operand.type = SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER;
if (inst->opcode == SpvOpSwitch) {
// The literal operands have the same type as the value
// referenced by the selector Id.
" %5 %6 %7 %8 %9 %10 %11 %12 %13\n"));
}
+using OperandTypeTest = spvtest::TextToBinaryTest;
+
+TEST_F(OperandTypeTest, OptionalTypedLiteralNumber) {
+ const std::string input =
+ "%1 = OpTypeInt 32 0\n"
+ "%2 = OpConstant %1 42\n"
+ "OpSwitch %2 %3 100 %4\n";
+ EXPECT_EQ(input, EncodeAndDecodeSuccessfully(input));
+}
+
} // anonymous namespace