diff --git a/src/ast/case_statement_test.cc b/src/ast/case_statement_test.cc index 57bfa7227a..c2afe30d4d 100644 --- a/src/ast/case_statement_test.cc +++ b/src/ast/case_statement_test.cc @@ -156,7 +156,7 @@ TEST_F(CaseStatementTest, ToStr_WithSelectors_u32) { }); auto* c = create(CaseSelectorList{b}, body); - EXPECT_EQ(str(c), R"(Case 2{ + EXPECT_EQ(str(c), R"(Case 2u{ Discard{} } )"); diff --git a/src/ast/uint_literal.cc b/src/ast/uint_literal.cc index eef8e38ef3..f893a0af1d 100644 --- a/src/ast/uint_literal.cc +++ b/src/ast/uint_literal.cc @@ -30,7 +30,7 @@ UintLiteral::UintLiteral(ProgramID program_id, UintLiteral::~UintLiteral() = default; std::string UintLiteral::to_str(const semantic::Info&) const { - return std::to_string(value()); + return std::to_string(value()) + "u"; } std::string UintLiteral::name() const { diff --git a/src/ast/uint_literal_test.cc b/src/ast/uint_literal_test.cc index da12f27c88..b6ed4be2c8 100644 --- a/src/ast/uint_literal_test.cc +++ b/src/ast/uint_literal_test.cc @@ -35,8 +35,8 @@ TEST_F(UintLiteralTest, Is) { } TEST_F(UintLiteralTest, ToStr) { - auto* u = create(ty.u32(), 42); - EXPECT_EQ(str(u), "42"); + auto* u = create(ty.u32(), 42u); + EXPECT_EQ(str(u), "42u"); } } // namespace diff --git a/src/reader/spirv/function_arithmetic_test.cc b/src/reader/spirv/function_arithmetic_test.cc index 9ff8fba260..9a05b46c90 100644 --- a/src/reader/spirv/function_arithmetic_test.cc +++ b/src/reader/spirv/function_arithmetic_test.cc @@ -70,15 +70,15 @@ std::string AstFor(std::string assembly) { if (assembly == "v2uint_10_20") { return R"(TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} })"; } if (assembly == "v2uint_20_10") { return R"(TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{20} - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{20u} + ScalarConstructor[not set]{10u} })"; } if (assembly == "v2int_30_40") { @@ -99,8 +99,8 @@ std::string AstFor(std::string assembly) { return R"(Bitcast[not set]<__vec_2__i32>{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } })"; } @@ -179,7 +179,7 @@ TEST_F(SpvUnaryArithTest, SNegate_Int_Uint) { UnaryOp[not set]{ negation Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } } @@ -236,7 +236,7 @@ TEST_F(SpvUnaryArithTest, SNegate_Uint_Uint) { UnaryOp[not set]{ negation Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } } @@ -297,8 +297,8 @@ TEST_F(SpvUnaryArithTest, SNegate_SignedVec_UnsignedVec) { Bitcast[not set]<__vec_2__i32>{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } } } @@ -362,8 +362,8 @@ TEST_F(SpvUnaryArithTest, SNegate_UnsignedVec_UnsignedVec) { Bitcast[not set]<__vec_2__i32>{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } } } @@ -526,8 +526,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both uint BinaryData{"uint", "uint_10", "OpIAdd", "uint_20", "__u32", - "ScalarConstructor[not set]{10}", "add", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "add", + "ScalarConstructor[not set]{20u}"}, // Both int BinaryData{"int", "int_30", "OpIAdd", "int_40", "__i32", "ScalarConstructor[not set]{30}", "add", @@ -554,7 +554,7 @@ INSTANTIATE_TEST_SUITE_P( ScalarConstructor[not set]{30} add Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } } @@ -567,7 +567,7 @@ INSTANTIATE_TEST_SUITE_P( ScalarConstructor[not set]{30} add Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } })"}, @@ -576,7 +576,7 @@ INSTANTIATE_TEST_SUITE_P( R"(__u32 { Binary[not set]{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} add Bitcast[not set]<__u32>{ ScalarConstructor[not set]{30} @@ -589,9 +589,9 @@ INSTANTIATE_TEST_SUITE_P( { Bitcast[not set]<__i32>{ Binary[not set]{ - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} add - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } })"}, @@ -610,8 +610,8 @@ INSTANTIATE_TEST_SUITE_P( Bitcast[not set]<__vec_2__i32>{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } } } @@ -625,8 +625,8 @@ INSTANTIATE_TEST_SUITE_P( Binary[not set]{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } add Bitcast[not set]<__vec_2__u32>{ @@ -659,8 +659,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both uint BinaryData{"uint", "uint_10", "OpISub", "uint_20", "__u32", - "ScalarConstructor[not set]{10}", "subtract", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "subtract", + "ScalarConstructor[not set]{20u}"}, // Both int BinaryData{"int", "int_30", "OpISub", "int_40", "__i32", "ScalarConstructor[not set]{30}", "subtract", @@ -687,7 +687,7 @@ INSTANTIATE_TEST_SUITE_P( ScalarConstructor[not set]{30} subtract Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } } @@ -700,7 +700,7 @@ INSTANTIATE_TEST_SUITE_P( ScalarConstructor[not set]{30} subtract Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } })"}, @@ -709,7 +709,7 @@ INSTANTIATE_TEST_SUITE_P( R"(__u32 { Binary[not set]{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} subtract Bitcast[not set]<__u32>{ ScalarConstructor[not set]{30} @@ -722,9 +722,9 @@ INSTANTIATE_TEST_SUITE_P( { Bitcast[not set]<__i32>{ Binary[not set]{ - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} subtract - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } })"}, @@ -743,8 +743,8 @@ INSTANTIATE_TEST_SUITE_P( Bitcast[not set]<__vec_2__i32>{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } } } @@ -758,8 +758,8 @@ INSTANTIATE_TEST_SUITE_P( Binary[not set]{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } subtract Bitcast[not set]<__vec_2__u32>{ @@ -792,8 +792,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both uint BinaryData{"uint", "uint_10", "OpIMul", "uint_20", "__u32", - "ScalarConstructor[not set]{10}", "multiply", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "multiply", + "ScalarConstructor[not set]{20u}"}, // Both int BinaryData{"int", "int_30", "OpIMul", "int_40", "__i32", "ScalarConstructor[not set]{30}", "multiply", @@ -820,7 +820,7 @@ INSTANTIATE_TEST_SUITE_P( ScalarConstructor[not set]{30} multiply Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } } @@ -833,7 +833,7 @@ INSTANTIATE_TEST_SUITE_P( ScalarConstructor[not set]{30} multiply Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } })"}, @@ -842,7 +842,7 @@ INSTANTIATE_TEST_SUITE_P( R"(__u32 { Binary[not set]{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} multiply Bitcast[not set]<__u32>{ ScalarConstructor[not set]{30} @@ -855,9 +855,9 @@ INSTANTIATE_TEST_SUITE_P( { Bitcast[not set]<__i32>{ Binary[not set]{ - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} multiply - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } })"}, @@ -876,8 +876,8 @@ INSTANTIATE_TEST_SUITE_P( Bitcast[not set]<__vec_2__i32>{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } } } @@ -891,8 +891,8 @@ INSTANTIATE_TEST_SUITE_P( Binary[not set]{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } multiply Bitcast[not set]<__vec_2__u32>{ @@ -925,8 +925,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both uint BinaryData{"uint", "uint_10", "OpUDiv", "uint_20", "__u32", - "ScalarConstructor[not set]{10}", "divide", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "divide", + "ScalarConstructor[not set]{20u}"}, // Both v2uint BinaryData{"v2uint", "v2uint_10_20", "OpUDiv", "v2uint_20_10", "__vec_2__u32", AstFor("v2uint_10_20"), "divide", @@ -953,12 +953,12 @@ INSTANTIATE_TEST_SUITE_P( BinaryData{"int", "int_30", "OpSDiv", "uint_10", "__i32", "ScalarConstructor[not set]{30}", "divide", R"(Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} })"}, // Mixed, returning int, first arg uint BinaryData{"int", "uint_10", "OpSDiv", "int_30", "__i32", R"(Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} })", "divide", "ScalarConstructor[not set]{30}"}, // Mixed, returning v2int, first arg v2uint @@ -1067,8 +1067,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both uint BinaryData{"uint", "uint_10", "OpUMod", "uint_20", "__u32", - "ScalarConstructor[not set]{10}", "modulo", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "modulo", + "ScalarConstructor[not set]{20u}"}, // Both v2uint BinaryData{"v2uint", "v2uint_10_20", "OpUMod", "v2uint_20_10", "__vec_2__u32", AstFor("v2uint_10_20"), "modulo", @@ -1098,12 +1098,12 @@ INSTANTIATE_TEST_SUITE_P( BinaryData{"int", "int_30", "OpSMod", "uint_10", "__i32", "ScalarConstructor[not set]{30}", "modulo", R"(Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} })"}, // Mixed, returning int, first arg uint BinaryData{"int", "uint_10", "OpSMod", "int_30", "__i32", R"(Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} })", "modulo", "ScalarConstructor[not set]{30}"}, // Mixed, returning v2int, first arg v2uint diff --git a/src/reader/spirv/function_bit_test.cc b/src/reader/spirv/function_bit_test.cc index 2c6e2667f2..3873ec0be8 100644 --- a/src/reader/spirv/function_bit_test.cc +++ b/src/reader/spirv/function_bit_test.cc @@ -61,15 +61,15 @@ std::string AstFor(std::string assembly) { if (assembly == "v2uint_10_20") { return R"(TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} })"; } if (assembly == "v2uint_20_10") { return R"(TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{20} - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{20u} + ScalarConstructor[not set]{10u} })"; } if (assembly == "v2int_30_40") { @@ -90,8 +90,8 @@ std::string AstFor(std::string assembly) { return R"(Bitcast[not set]<__vec_2__i32>{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } })"; } @@ -212,8 +212,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both uint BinaryData{"uint", "uint_10", "OpShiftLeftLogical", "uint_20", "__u32", - "ScalarConstructor[not set]{10}", "shift_left", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "shift_left", + "ScalarConstructor[not set]{20u}"}, // Both int BinaryData{"int", "int_30", "OpShiftLeftLogical", "int_40", "__i32", "ScalarConstructor[not set]{30}", "shift_left", @@ -221,11 +221,11 @@ INSTANTIATE_TEST_SUITE_P( // Mixed, returning uint BinaryData{"uint", "int_30", "OpShiftLeftLogical", "uint_10", "__u32", "ScalarConstructor[not set]{30}", "shift_left", - "ScalarConstructor[not set]{10}"}, + "ScalarConstructor[not set]{10u}"}, // Mixed, returning int BinaryData{"int", "int_30", "OpShiftLeftLogical", "uint_10", "__i32", "ScalarConstructor[not set]{30}", "shift_left", - "ScalarConstructor[not set]{10}"}, + "ScalarConstructor[not set]{10u}"}, // Both v2uint BinaryData{"v2uint", "v2uint_10_20", "OpShiftLeftLogical", "v2uint_20_10", "__vec_2__u32", AstFor("v2uint_10_20"), @@ -249,8 +249,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both uint BinaryData{"uint", "uint_10", "OpShiftRightLogical", "uint_20", "__u32", - "ScalarConstructor[not set]{10}", "shift_right", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "shift_right", + "ScalarConstructor[not set]{20u}"}, // Both int BinaryData{"int", "int_30", "OpShiftRightLogical", "int_40", "__i32", "ScalarConstructor[not set]{30}", "shift_right", @@ -258,11 +258,11 @@ INSTANTIATE_TEST_SUITE_P( // Mixed, returning uint BinaryData{"uint", "int_30", "OpShiftRightLogical", "uint_10", "__u32", "ScalarConstructor[not set]{30}", "shift_right", - "ScalarConstructor[not set]{10}"}, + "ScalarConstructor[not set]{10u}"}, // Mixed, returning int BinaryData{"int", "int_30", "OpShiftRightLogical", "uint_10", "__i32", "ScalarConstructor[not set]{30}", "shift_right", - "ScalarConstructor[not set]{10}"}, + "ScalarConstructor[not set]{10u}"}, // Both v2uint BinaryData{"v2uint", "v2uint_10_20", "OpShiftRightLogical", "v2uint_20_10", "__vec_2__u32", AstFor("v2uint_10_20"), @@ -286,8 +286,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both uint BinaryData{"uint", "uint_10", "OpShiftRightArithmetic", "uint_20", - "__u32", "ScalarConstructor[not set]{10}", "shift_right", - "ScalarConstructor[not set]{20}"}, + "__u32", "ScalarConstructor[not set]{10u}", "shift_right", + "ScalarConstructor[not set]{20u}"}, // Both int BinaryData{"int", "int_30", "OpShiftRightArithmetic", "int_40", "__i32", "ScalarConstructor[not set]{30}", "shift_right", @@ -295,11 +295,11 @@ INSTANTIATE_TEST_SUITE_P( // Mixed, returning uint BinaryData{"uint", "int_30", "OpShiftRightArithmetic", "uint_10", "__u32", "ScalarConstructor[not set]{30}", "shift_right", - "ScalarConstructor[not set]{10}"}, + "ScalarConstructor[not set]{10u}"}, // Mixed, returning int BinaryData{"int", "int_30", "OpShiftRightArithmetic", "uint_10", "__i32", "ScalarConstructor[not set]{30}", "shift_right", - "ScalarConstructor[not set]{10}"}, + "ScalarConstructor[not set]{10u}"}, // Both v2uint BinaryData{"v2uint", "v2uint_10_20", "OpShiftRightArithmetic", "v2uint_20_10", "__vec_2__u32", AstFor("v2uint_10_20"), @@ -323,8 +323,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both uint BinaryData{"uint", "uint_10", "OpBitwiseAnd", "uint_20", "__u32", - "ScalarConstructor[not set]{10}", "and", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "and", + "ScalarConstructor[not set]{20u}"}, // Both int BinaryData{"int", "int_30", "OpBitwiseAnd", "int_40", "__i32", "ScalarConstructor[not set]{30}", "and", @@ -351,7 +351,7 @@ INSTANTIATE_TEST_SUITE_P( ScalarConstructor[not set]{30} and Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } } @@ -364,7 +364,7 @@ INSTANTIATE_TEST_SUITE_P( ScalarConstructor[not set]{30} and Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } })"}, @@ -373,7 +373,7 @@ INSTANTIATE_TEST_SUITE_P( R"(__u32 { Binary[not set]{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} and Bitcast[not set]<__u32>{ ScalarConstructor[not set]{30} @@ -386,9 +386,9 @@ INSTANTIATE_TEST_SUITE_P( { Bitcast[not set]<__i32>{ Binary[not set]{ - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} and - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } })"}, @@ -408,8 +408,8 @@ INSTANTIATE_TEST_SUITE_P( Bitcast[not set]<__vec_2__i32>{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } } } @@ -424,8 +424,8 @@ INSTANTIATE_TEST_SUITE_P( Binary[not set]{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } and Bitcast[not set]<__vec_2__u32>{ @@ -445,8 +445,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both uint BinaryData{"uint", "uint_10", "OpBitwiseOr", "uint_20", "__u32", - "ScalarConstructor[not set]{10}", "or", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "or", + "ScalarConstructor[not set]{20u}"}, // Both int BinaryData{"int", "int_30", "OpBitwiseOr", "int_40", "__i32", "ScalarConstructor[not set]{30}", "or", @@ -473,7 +473,7 @@ INSTANTIATE_TEST_SUITE_P( ScalarConstructor[not set]{30} or Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } } @@ -486,7 +486,7 @@ INSTANTIATE_TEST_SUITE_P( ScalarConstructor[not set]{30} or Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } })"}, @@ -495,7 +495,7 @@ INSTANTIATE_TEST_SUITE_P( R"(__u32 { Binary[not set]{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} or Bitcast[not set]<__u32>{ ScalarConstructor[not set]{30} @@ -508,9 +508,9 @@ INSTANTIATE_TEST_SUITE_P( { Bitcast[not set]<__i32>{ Binary[not set]{ - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} or - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } })"}, @@ -530,8 +530,8 @@ INSTANTIATE_TEST_SUITE_P( Bitcast[not set]<__vec_2__i32>{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } } } @@ -545,8 +545,8 @@ INSTANTIATE_TEST_SUITE_P( Binary[not set]{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } or Bitcast[not set]<__vec_2__u32>{ @@ -566,8 +566,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both uint BinaryData{"uint", "uint_10", "OpBitwiseXor", "uint_20", "__u32", - "ScalarConstructor[not set]{10}", "xor", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "xor", + "ScalarConstructor[not set]{20u}"}, // Both int BinaryData{"int", "int_30", "OpBitwiseXor", "int_40", "__i32", "ScalarConstructor[not set]{30}", "xor", @@ -594,7 +594,7 @@ INSTANTIATE_TEST_SUITE_P( ScalarConstructor[not set]{30} xor Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } } @@ -607,7 +607,7 @@ INSTANTIATE_TEST_SUITE_P( ScalarConstructor[not set]{30} xor Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } })"}, @@ -616,7 +616,7 @@ INSTANTIATE_TEST_SUITE_P( R"(__u32 { Binary[not set]{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} xor Bitcast[not set]<__u32>{ ScalarConstructor[not set]{30} @@ -629,9 +629,9 @@ INSTANTIATE_TEST_SUITE_P( { Bitcast[not set]<__i32>{ Binary[not set]{ - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} xor - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } })"}, @@ -651,8 +651,8 @@ INSTANTIATE_TEST_SUITE_P( Bitcast[not set]<__vec_2__i32>{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } } } @@ -667,8 +667,8 @@ INSTANTIATE_TEST_SUITE_P( Binary[not set]{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } xor Bitcast[not set]<__vec_2__u32>{ @@ -729,7 +729,7 @@ TEST_F(SpvUnaryBitTest, Not_Int_Uint) { Bitcast[not set]<__i32>{ UnaryOp[not set]{ not - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } } @@ -784,7 +784,7 @@ TEST_F(SpvUnaryBitTest, Not_Uint_Uint) { { UnaryOp[not set]{ not - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } } })")); @@ -843,8 +843,8 @@ TEST_F(SpvUnaryBitTest, Not_SignedVec_UnsignedVec) { not TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } } } @@ -905,8 +905,8 @@ TEST_F(SpvUnaryBitTest, Not_UnsignedVec_UnsignedVec) { not TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } } } diff --git a/src/reader/spirv/function_call_test.cc b/src/reader/spirv/function_call_test.cc index c35e55f90d..e7aa477866 100644 --- a/src/reader/spirv/function_call_test.cc +++ b/src/reader/spirv/function_call_test.cc @@ -110,7 +110,7 @@ Return{})")); EXPECT_TRUE(fe.EmitBody()); EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(Return{ { - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} } })")); } @@ -180,7 +180,7 @@ Return{})")); EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(Return{ { - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} } })")); } @@ -249,8 +249,8 @@ TEST_F(SpvParserTest, EmitStatement_CallWithParams) { Call[not set]{ Identifier[not set]{x_50} ( - ScalarConstructor[not set]{42} - ScalarConstructor[not set]{84} + ScalarConstructor[not set]{42u} + ScalarConstructor[not set]{84u} ) } } diff --git a/src/reader/spirv/function_cfg_test.cc b/src/reader/spirv/function_cfg_test.cc index f736578705..77b525463c 100644 --- a/src/reader/spirv/function_cfg_test.cc +++ b/src/reader/spirv/function_cfg_test.cc @@ -7563,7 +7563,7 @@ TEST_F(SpvParserTest, EmitBody_IfBreak_FromThen_ForwardWithinThen) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } VariableDeclStatement{ Variable{ @@ -7582,7 +7582,7 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } If{ ( @@ -7602,7 +7602,7 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } Assignment{ Identifier[not set]{guard10} @@ -7621,7 +7621,7 @@ Else{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } Assignment{ Identifier[not set]{guard10} @@ -7633,7 +7633,7 @@ Else{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -7675,7 +7675,7 @@ TEST_F(SpvParserTest, EmitBody_IfBreak_FromElse_ForwardWithinElse) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } VariableDeclStatement{ Variable{ @@ -7694,7 +7694,7 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Assignment{ Identifier[not set]{guard10} @@ -7711,7 +7711,7 @@ Else{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } If{ ( @@ -7731,7 +7731,7 @@ Else{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } Assignment{ Identifier[not set]{guard10} @@ -7745,7 +7745,7 @@ Else{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -7802,7 +7802,7 @@ TEST_F(SpvParserTest, auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } VariableDeclStatement{ Variable{ @@ -7821,7 +7821,7 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } If{ ( @@ -7845,7 +7845,7 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } } } @@ -7860,7 +7860,7 @@ Else{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } If{ ( @@ -7880,7 +7880,7 @@ Else{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } } } @@ -7895,7 +7895,7 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{6} + ScalarConstructor[not set]{6u} } If{ ( @@ -7919,7 +7919,7 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Assignment{ Identifier[not set]{guard10} @@ -7931,7 +7931,7 @@ If{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{8} + ScalarConstructor[not set]{8u} } Return{} )"; @@ -8029,7 +8029,7 @@ TEST_F(SpvParserTest, EmitBody_If_Then_NoElse) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } If{ ( @@ -8038,13 +8038,13 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{999} + ScalarConstructor[not set]{999u} } Return{} )"; @@ -8077,7 +8077,7 @@ TEST_F(SpvParserTest, EmitBody_If_NoThen_Else) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } If{ ( @@ -8090,13 +8090,13 @@ Else{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{999} + ScalarConstructor[not set]{999u} } Return{} )"; @@ -8133,7 +8133,7 @@ TEST_F(SpvParserTest, EmitBody_If_Then_Else) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } If{ ( @@ -8142,7 +8142,7 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -8150,13 +8150,13 @@ Else{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{999} + ScalarConstructor[not set]{999u} } Return{} )"; @@ -8200,7 +8200,7 @@ TEST_F(SpvParserTest, EmitBody_If_Then_Else_Premerge) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } If{ ( @@ -8209,7 +8209,7 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -8217,7 +8217,7 @@ Else{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } } @@ -8228,13 +8228,13 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{999} + ScalarConstructor[not set]{999u} } Return{} )"; @@ -8272,7 +8272,7 @@ TEST_F(SpvParserTest, EmitBody_If_Then_Premerge) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } If{ ( @@ -8281,7 +8281,7 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -8292,13 +8292,13 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{999} + ScalarConstructor[not set]{999u} } Return{} )"; @@ -8336,7 +8336,7 @@ TEST_F(SpvParserTest, EmitBody_If_Else_Premerge) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } If{ ( @@ -8349,7 +8349,7 @@ Else{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -8360,13 +8360,13 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{999} + ScalarConstructor[not set]{999u} } Return{} )"; @@ -8421,7 +8421,7 @@ TEST_F(SpvParserTest, EmitBody_If_Nest_If) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } If{ ( @@ -8430,7 +8430,7 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -8439,13 +8439,13 @@ If{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } } } @@ -8453,7 +8453,7 @@ Else{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } If{ ( @@ -8466,19 +8466,19 @@ Else{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{6} + ScalarConstructor[not set]{6u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{999} + ScalarConstructor[not set]{999u} } Return{} )"; @@ -8511,12 +8511,12 @@ TEST_F(SpvParserTest, EmitBody_Loop_SingleBlock_TrueBackedge) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -8533,7 +8533,7 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{999} + ScalarConstructor[not set]{999u} } Return{} )"; @@ -8566,12 +8566,12 @@ TEST_F(SpvParserTest, EmitBody_Loop_SingleBlock_FalseBackedge) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -8584,7 +8584,7 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{999} + ScalarConstructor[not set]{999u} } Return{} )"; @@ -8617,17 +8617,17 @@ TEST_F(SpvParserTest, EmitBody_Loop_SingleBlock_BothBackedge) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{999} + ScalarConstructor[not set]{999u} } Return{} )"; @@ -8660,17 +8660,17 @@ TEST_F(SpvParserTest, EmitBody_Loop_SingleBlock_UnconditionalBackege) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{999} + ScalarConstructor[not set]{999u} } Return{} )"; @@ -8711,27 +8711,27 @@ TEST_F(SpvParserTest, EmitBody_Loop_Unconditional_Body_SingleBlockContinue) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{999} + ScalarConstructor[not set]{999u} } Return{} )"; @@ -8776,31 +8776,31 @@ TEST_F(SpvParserTest, EmitBody_Loop_Unconditional_Body_MultiBlockContinue) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{999} + ScalarConstructor[not set]{999u} } Return{} )"; @@ -8850,21 +8850,21 @@ TEST_F(SpvParserTest, EmitBody_Loop_Unconditional_Body_ContinueNestIf) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } If{ ( @@ -8873,19 +8873,19 @@ Loop{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{999} + ScalarConstructor[not set]{999u} } Return{} )"; @@ -8922,16 +8922,16 @@ TEST_F(SpvParserTest, EmitBody_Loop_MultiBlockContinueIsEntireLoop) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } If{ ( @@ -8944,7 +8944,7 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } Return{} )"; @@ -8981,19 +8981,19 @@ TEST_F(SpvParserTest, EmitBody_Loop_Never) { auto* expect = R"(Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Break{} continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } Return{} )"; @@ -9041,7 +9041,7 @@ TEST_F(SpvParserTest, EmitBody_Loop_TrueToBody_FalseBreaks) { auto* expect = R"(Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -9057,18 +9057,18 @@ TEST_F(SpvParserTest, EmitBody_Loop_TrueToBody_FalseBreaks) { } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } Return{} )"; @@ -9108,7 +9108,7 @@ TEST_F(SpvParserTest, EmitBody_Loop_FalseToBody_TrueBreaks) { auto* expect = R"(Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -9124,18 +9124,18 @@ TEST_F(SpvParserTest, EmitBody_Loop_FalseToBody_TrueBreaks) { } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } Return{} )"; @@ -9187,19 +9187,19 @@ TEST_F(SpvParserTest, EmitBody_Loop_NestedIfContinue) { { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Continue{} } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } } } @@ -9240,13 +9240,13 @@ TEST_F(SpvParserTest, EmitBody_Loop_BodyAlwaysBreaks) { auto* expect = R"(Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Break{} continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } } @@ -9289,7 +9289,7 @@ TEST_F(SpvParserTest, EmitBody_Loop_BodyConditionallyBreaks_FromTrue) { auto* expect = R"(Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -9302,7 +9302,7 @@ TEST_F(SpvParserTest, EmitBody_Loop_BodyConditionallyBreaks_FromTrue) { continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } } @@ -9345,7 +9345,7 @@ TEST_F(SpvParserTest, EmitBody_Loop_BodyConditionallyBreaks_FromFalse) { auto* expect = R"(Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -9362,7 +9362,7 @@ TEST_F(SpvParserTest, EmitBody_Loop_BodyConditionallyBreaks_FromFalse) { continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } } @@ -9407,7 +9407,7 @@ TEST_F(SpvParserTest, EmitBody_Loop_BodyConditionallyBreaks_FromTrue_Early) { auto* expect = R"(Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -9419,12 +9419,12 @@ TEST_F(SpvParserTest, EmitBody_Loop_BodyConditionallyBreaks_FromTrue_Early) { } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } } @@ -9469,7 +9469,7 @@ TEST_F(SpvParserTest, EmitBody_Loop_BodyConditionallyBreaks_FromFalse_Early) { auto* expect = R"(Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -9485,12 +9485,12 @@ TEST_F(SpvParserTest, EmitBody_Loop_BodyConditionallyBreaks_FromFalse_Early) { } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } } @@ -9521,10 +9521,10 @@ TEST_F(SpvParserTest, EmitBody_Switch_DefaultIsMerge_NoCases) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { Default{ } @@ -9532,7 +9532,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -9566,15 +9566,15 @@ TEST_F(SpvParserTest, EmitBody_Switch_DefaultIsMerge_OneCase) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } } Default{ @@ -9583,7 +9583,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -9620,21 +9620,21 @@ TEST_F(SpvParserTest, EmitBody_Switch_DefaultIsMerge_TwoCases) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 30{ + Case 30u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{30} + ScalarConstructor[not set]{30u} } } - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } } Default{ @@ -9643,7 +9643,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -9680,21 +9680,21 @@ TEST_F(SpvParserTest, EmitBody_Switch_DefaultIsMerge_CasesWithDup) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 30{ + Case 30u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{30} + ScalarConstructor[not set]{30u} } } - Case 20, 40{ + Case 20u, 40u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } } Default{ @@ -9703,7 +9703,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -9746,34 +9746,34 @@ TEST_F(SpvParserTest, EmitBody_Switch_DefaultIsCase_NoDupCases) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 40{ + Case 40u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{40} + ScalarConstructor[not set]{40u} } } - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } } Default{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{30} + ScalarConstructor[not set]{30u} } } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -9817,37 +9817,37 @@ TEST_F(SpvParserTest, EmitBody_Switch_DefaultIsCase_WithDupCase) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 40{ + Case 40u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{40} + ScalarConstructor[not set]{40u} } } - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } } Default{ Fallthrough{} } - Case 30{ + Case 30u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{30} + ScalarConstructor[not set]{30u} } } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -9889,7 +9889,7 @@ TEST_F(SpvParserTest, EmitBody_Switch_Case_SintValue) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ ScalarConstructor[not set]{42} @@ -9897,19 +9897,19 @@ Switch{ Case -294967296{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{40} + ScalarConstructor[not set]{40u} } } Case 2000000000{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{30} + ScalarConstructor[not set]{30u} } } Case 20{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } } Default{ @@ -9918,7 +9918,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -9959,27 +9959,27 @@ TEST_F(SpvParserTest, EmitBody_Switch_Case_UintValue) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 50{ + Case 50u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{40} + ScalarConstructor[not set]{40u} } } - Case 2000000000{ + Case 2000000000u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{30} + ScalarConstructor[not set]{30u} } } - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } } Default{ @@ -9988,7 +9988,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -10107,7 +10107,7 @@ TEST_F(SpvParserTest, EmitBody_ReturnValue_TopLevel) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Return{ { - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } )"; @@ -10151,14 +10151,14 @@ TEST_F(SpvParserTest, EmitBody_ReturnValue_InsideIf) { { Return{ { - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } } } Return{ { - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } } )"; @@ -10204,13 +10204,13 @@ TEST_F(SpvParserTest, EmitBody_ReturnValue_Loop) { auto* expect = R"(Loop{ Return{ { - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } } Return{ { - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } } )"; @@ -10417,7 +10417,7 @@ TEST_F(SpvParserTest, EmitBody_Unreachable_InNonVoidFunction) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Return{ { - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } } )"; @@ -10453,7 +10453,7 @@ TEST_F(SpvParserTest, EmitBody_Branch_BackEdge_MultiBlockLoop) { continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -10487,7 +10487,7 @@ TEST_F(SpvParserTest, EmitBody_Branch_BackEdge_SingleBlockLoop) { auto* expect = R"(Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } Return{} @@ -10523,15 +10523,15 @@ TEST_F(SpvParserTest, EmitBody_Branch_SwitchBreak_LastInCase) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } } Default{ @@ -10540,7 +10540,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -10583,15 +10583,15 @@ TEST_F(SpvParserTest, EmitBody_Branch_SwitchBreak_NotLastInCase) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } If{ ( @@ -10600,14 +10600,14 @@ Switch{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{40} + ScalarConstructor[not set]{40u} } Break{} } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{50} + ScalarConstructor[not set]{50u} } } Default{ @@ -10616,7 +10616,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -10655,13 +10655,13 @@ TEST_F(SpvParserTest, EmitBody_Branch_LoopBreak_MultiBlockLoop_FromBody) { auto* expect = R"(Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Break{} continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } } @@ -10738,7 +10738,7 @@ TEST_F(SpvParserTest, continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Break{} } @@ -10779,12 +10779,12 @@ TEST_F(SpvParserTest, EmitBody_Branch_LoopContinue_LastInLoopConstruct) { auto* expect = R"(Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } } @@ -10838,19 +10838,19 @@ TEST_F(SpvParserTest, EmitBody_Branch_LoopContinue_BeforeLast) { { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Continue{} } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } } } @@ -10901,24 +10901,24 @@ TEST_F(SpvParserTest, EmitBody_Branch_LoopContinue_FromSwitch) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 40{ + Case 40u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } Continue{} } @@ -10928,18 +10928,18 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{6} + ScalarConstructor[not set]{6u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -10976,13 +10976,13 @@ TEST_F(SpvParserTest, EmitBody_Branch_IfBreak_FromThen) { { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Return{} )"; @@ -11023,13 +11023,13 @@ Else{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Return{} )"; @@ -11066,22 +11066,22 @@ TEST_F(SpvParserTest, EmitBody_Branch_Fallthrough) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } Fallthrough{} } - Case 30{ + Case 30u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{30} + ScalarConstructor[not set]{30u} } } Default{ @@ -11090,7 +11090,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -11117,11 +11117,11 @@ TEST_F(SpvParserTest, EmitBody_Branch_Forward) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Return{} )"; @@ -11221,17 +11221,17 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_Back_SingleBlock_Back) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -11264,12 +11264,12 @@ TEST_F(SpvParserTest, auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -11282,7 +11282,7 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -11315,12 +11315,12 @@ TEST_F(SpvParserTest, auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -11337,7 +11337,7 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -11373,12 +11373,12 @@ TEST_F(SpvParserTest, auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } continuing { If{ @@ -11393,7 +11393,7 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -11429,12 +11429,12 @@ TEST_F(SpvParserTest, auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } continuing { If{ @@ -11453,7 +11453,7 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -11489,15 +11489,15 @@ TEST_F(SpvParserTest, auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } } Default{ @@ -11506,7 +11506,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -11550,15 +11550,15 @@ TEST_F(SpvParserTest, auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } If{ ( @@ -11567,14 +11567,14 @@ Switch{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{40} + ScalarConstructor[not set]{40u} } Break{} } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{50} + ScalarConstructor[not set]{50u} } } Default{ @@ -11583,7 +11583,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -11633,24 +11633,24 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_SwitchBreak_Continue_OnTrue) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 40{ + Case 40u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{40} + ScalarConstructor[not set]{40u} } If{ ( @@ -11667,18 +11667,18 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{6} + ScalarConstructor[not set]{6u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{8} + ScalarConstructor[not set]{8u} } Return{} )"; @@ -11728,24 +11728,24 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_SwitchBreak_Continue_OnFalse) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 40{ + Case 40u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{40} + ScalarConstructor[not set]{40u} } If{ ( @@ -11766,18 +11766,18 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{6} + ScalarConstructor[not set]{6u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{8} + ScalarConstructor[not set]{8u} } Return{} )"; @@ -11813,15 +11813,15 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_SwitchBreak_Forward_OnTrue) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } If{ ( @@ -11837,7 +11837,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{30} + ScalarConstructor[not set]{30u} } } Default{ @@ -11846,7 +11846,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{8} + ScalarConstructor[not set]{8u} } Return{} )"; @@ -11882,15 +11882,15 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_SwitchBreak_Forward_OnFalse) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } If{ ( @@ -11902,7 +11902,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{30} + ScalarConstructor[not set]{30u} } } Default{ @@ -11911,7 +11911,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{8} + ScalarConstructor[not set]{8u} } Return{} )"; @@ -11949,15 +11949,15 @@ TEST_F(SpvParserTest, auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } If{ ( @@ -11973,10 +11973,10 @@ Switch{ } Fallthrough{} } - Case 30{ + Case 30u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{30} + ScalarConstructor[not set]{30u} } } Default{ @@ -11985,7 +11985,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -12023,15 +12023,15 @@ TEST_F(SpvParserTest, auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } If{ ( @@ -12043,10 +12043,10 @@ Switch{ } Fallthrough{} } - Case 30{ + Case 30u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{30} + ScalarConstructor[not set]{30u} } } Default{ @@ -12055,7 +12055,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -12092,24 +12092,24 @@ TEST_F(SpvParserTest, auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Break{} continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -12150,28 +12150,28 @@ TEST_F(SpvParserTest, auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Break{} continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -12223,12 +12223,12 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_LoopBreak_Continue_OnTrue) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -12237,7 +12237,7 @@ Loop{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } If{ ( @@ -12256,18 +12256,18 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -12319,12 +12319,12 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_LoopBreak_Continue_OnFalse) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -12333,7 +12333,7 @@ Loop{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } If{ ( @@ -12352,18 +12352,18 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -12458,16 +12458,16 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_LoopBreak_Forward_OnTrue) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } If{ ( @@ -12483,18 +12483,18 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -12539,16 +12539,16 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_LoopBreak_Forward_OnFalse) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } If{ ( @@ -12560,18 +12560,18 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -12607,23 +12607,23 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_Continue_Continue_FromHeader) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -12664,27 +12664,27 @@ TEST_F(SpvParserTest, auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -12736,16 +12736,16 @@ TEST_F(SpvParserTest, auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } If{ ( @@ -12754,25 +12754,25 @@ Loop{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } Continue{} } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{6} + ScalarConstructor[not set]{6u} } Return{} )"; @@ -12824,16 +12824,16 @@ TEST_F( auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } If{ ( @@ -12842,19 +12842,19 @@ Loop{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } Continue{} } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{6} + ScalarConstructor[not set]{6u} } Return{} )"; @@ -12903,24 +12903,24 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_LoopContinue_FromSwitch) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 40{ + Case 40u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } Continue{} } @@ -12930,18 +12930,18 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{6} + ScalarConstructor[not set]{6u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -12991,16 +12991,16 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_Continue_IfBreak_OnTrue) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } If{ ( @@ -13009,7 +13009,7 @@ Loop{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } If{ ( @@ -13027,18 +13027,18 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{6} + ScalarConstructor[not set]{6u} } Return{} )"; @@ -13088,16 +13088,16 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_Continue_IfBreak_OnFalse) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } If{ ( @@ -13106,7 +13106,7 @@ Loop{ { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } If{ ( @@ -13120,18 +13120,18 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{6} + ScalarConstructor[not set]{6u} } Return{} )"; @@ -13184,24 +13184,24 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_Continue_Fallthrough_OnTrue) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 40{ + Case 40u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{40} + ScalarConstructor[not set]{40u} } If{ ( @@ -13217,10 +13217,10 @@ Loop{ } Fallthrough{} } - Case 50{ + Case 50u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{50} + ScalarConstructor[not set]{50u} } } Default{ @@ -13229,18 +13229,18 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -13293,24 +13293,24 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_Continue_Fallthrough_OnFalse) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 40{ + Case 40u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{40} + ScalarConstructor[not set]{40u} } If{ ( @@ -13322,10 +13322,10 @@ Loop{ } Fallthrough{} } - Case 50{ + Case 50u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{50} + ScalarConstructor[not set]{50u} } } Default{ @@ -13334,18 +13334,18 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -13390,16 +13390,16 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_Continue_Forward_OnTrue) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } If{ ( @@ -13415,18 +13415,18 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -13471,16 +13471,16 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_Continue_Forward_OnFalse) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } If{ ( @@ -13492,18 +13492,18 @@ Loop{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } continuing { Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } } } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -13535,7 +13535,7 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_IfBreak_IfBreak_Same) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } If{ ( @@ -13546,7 +13546,7 @@ If{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -13620,22 +13620,22 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_Fallthrough_Fallthrough_Same) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Switch{ - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} { - Case 20{ + Case 20u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } Fallthrough{} } - Case 30{ + Case 30u{ Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{30} + ScalarConstructor[not set]{30u} } } Default{ @@ -13644,7 +13644,7 @@ Switch{ } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{7} + ScalarConstructor[not set]{7u} } Return{} )"; @@ -13711,11 +13711,11 @@ TEST_F(SpvParserTest, EmitBody_BranchConditional_Forward_Forward_Same) { auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{var_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Return{} )"; @@ -14081,9 +14081,9 @@ TEST_F(SpvParserTest, EmitBody_TrueBranch_SwitchBreak) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Switch{ - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} { - Case 20{ + Case 20u{ If{ ( ScalarConstructor[not set]{false} @@ -14234,9 +14234,9 @@ TEST_F(SpvParserTest, EmitBody_FalseBranch_SwitchBreak) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Switch{ - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} { - Case 20{ + Case 20u{ If{ ( ScalarConstructor[not set]{false} diff --git a/src/reader/spirv/function_composite_test.cc b/src/reader/spirv/function_composite_test.cc index fd06d3be9a..022abfa9b5 100644 --- a/src/reader/spirv/function_composite_test.cc +++ b/src/reader/spirv/function_composite_test.cc @@ -96,8 +96,8 @@ TEST_F(SpvParserTest_Composite_Construct, Vector) { { TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } } } @@ -192,11 +192,11 @@ TEST_F(SpvParserTest_Composite_Construct, Array) { { TypeConstructor[not set]{ __array__u32_5 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} - ScalarConstructor[not set]{3} - ScalarConstructor[not set]{4} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} + ScalarConstructor[not set]{3u} + ScalarConstructor[not set]{4u} + ScalarConstructor[not set]{5u} } } })")); @@ -227,7 +227,7 @@ TEST_F(SpvParserTest_Composite_Construct, Struct) { ScalarConstructor[not set]{50.000000} ScalarConstructor[not set]{60.000000} } - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} ScalarConstructor[not set]{30} } } @@ -306,7 +306,7 @@ TEST_F(SpvParserTest_CompositeExtract, Matrix) { { ArrayAccessor[not set]{ Identifier[not set]{x_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } } })")); @@ -357,7 +357,7 @@ TEST_F(SpvParserTest_CompositeExtract, Matrix_Vector) { MemberAccessor[not set]{ ArrayAccessor[not set]{ Identifier[not set]{x_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Identifier[not set]{y} } @@ -389,7 +389,7 @@ TEST_F(SpvParserTest_CompositeExtract, Array) { { ArrayAccessor[not set]{ Identifier[not set]{x_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } } })")); @@ -553,9 +553,9 @@ TEST_F(SpvParserTest_CompositeExtract, Struct_Array_Matrix_Vector) { Identifier[not set]{x_1} Identifier[not set]{field1} } - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Identifier[not set]{y} } @@ -657,7 +657,7 @@ TEST_F(SpvParserTest_CompositeInsert, Matrix) { Assignment{ ArrayAccessor[not set]{ Identifier[not set]{x_2_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } TypeConstructor[not set]{ __vec_2__f32 @@ -727,7 +727,7 @@ TEST_F(SpvParserTest_CompositeInsert, Matrix_Vector) { Assignment{ ArrayAccessor[not set]{ Identifier[not set]{x_2_1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } TypeConstructor[not set]{ __vec_2__f32 @@ -777,9 +777,9 @@ TEST_F(SpvParserTest_CompositeInsert, Array) { Assignment{ ArrayAccessor[not set]{ Identifier[not set]{x_2_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} } VariableDeclStatement{ VariableConst{ @@ -903,7 +903,7 @@ Assignment{ Identifier[not set]{x_2_1} Identifier[not set]{algo} } - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } VariableDeclStatement{ VariableConst{ @@ -931,7 +931,7 @@ Assignment{ Identifier[not set]{x_4_1} Identifier[not set]{rithm} } - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} } VariableDeclStatement{ VariableConst{ @@ -1002,9 +1002,9 @@ Assignment{ Identifier[not set]{x_2_1} Identifier[not set]{field1} } - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Identifier[not set]{y} } @@ -1044,7 +1044,7 @@ TEST_F(SpvParserTest_CopyObject, Scalar) { none __u32 { - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } } } @@ -1169,32 +1169,32 @@ TEST_F(SpvParserTest_VectorShuffle, ConstantOperands_UseBoth) { MemberAccessor[not set]{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{4} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{4u} + ScalarConstructor[not set]{3u} } Identifier[not set]{y} } MemberAccessor[not set]{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{4} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{4u} + ScalarConstructor[not set]{3u} } Identifier[not set]{x} } MemberAccessor[not set]{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{3} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{3u} + ScalarConstructor[not set]{4u} } Identifier[not set]{y} } MemberAccessor[not set]{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{3} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{3u} + ScalarConstructor[not set]{4u} } Identifier[not set]{x} } @@ -1224,7 +1224,7 @@ TEST_F(SpvParserTest_VectorShuffle, ConstantOperands_AllOnesMapToNull) { { TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} MemberAccessor[not set]{ Identifier[not set]{x_1} Identifier[not set]{y} diff --git a/src/reader/spirv/function_conversion_test.cc b/src/reader/spirv/function_conversion_test.cc index fa3f328c15..dd0728dc6b 100644 --- a/src/reader/spirv/function_conversion_test.cc +++ b/src/reader/spirv/function_conversion_test.cc @@ -112,8 +112,8 @@ TEST_F(SpvUnaryConversionTest, Bitcast_Vector) { Bitcast[not set]<__vec_2__f32>{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } } } diff --git a/src/reader/spirv/function_logical_test.cc b/src/reader/spirv/function_logical_test.cc index 061d83af2c..1cc991709d 100644 --- a/src/reader/spirv/function_logical_test.cc +++ b/src/reader/spirv/function_logical_test.cc @@ -83,42 +83,42 @@ std::string AstFor(std::string assembly) { if (assembly == "v2uint_10_20") { return R"(TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} })"; } if (assembly == "cast_uint_10") { return R"(Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} })"; } if (assembly == "cast_uint_20") { return R"(Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{20u} })"; } if (assembly == "cast_v2uint_10_20") { return R"(Bitcast[not set]<__vec_2__i32>{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } })"; } if (assembly == "v2uint_20_10") { return R"(TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{20} - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{20u} + ScalarConstructor[not set]{10u} })"; } if (assembly == "cast_v2uint_20_10") { return R"(Bitcast[not set]<__vec_2__i32>{ TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{20} - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{20u} + ScalarConstructor[not set]{10u} } })"; } @@ -300,15 +300,15 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // uint uint BinaryData{"bool", "uint_10", "OpIEqual", "uint_20", "__bool", - "ScalarConstructor[not set]{10}", "equal", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "equal", + "ScalarConstructor[not set]{20u}"}, // int int BinaryData{"bool", "int_30", "OpIEqual", "int_40", "__bool", "ScalarConstructor[not set]{30}", "equal", "ScalarConstructor[not set]{40}"}, // uint int BinaryData{"bool", "uint_10", "OpIEqual", "int_40", "__bool", - "ScalarConstructor[not set]{10}", "equal", + "ScalarConstructor[not set]{10u}", "equal", R"(Bitcast[not set]<__u32>{ ScalarConstructor[not set]{40} })"}, @@ -316,7 +316,7 @@ INSTANTIATE_TEST_SUITE_P( BinaryData{"bool", "int_40", "OpIEqual", "uint_10", "__bool", "ScalarConstructor[not set]{40}", "equal", R"(Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} })"}, // v2uint v2uint BinaryData{"v2bool", "v2uint_10_20", "OpIEqual", "v2uint_20_10", @@ -344,15 +344,15 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both uint BinaryData{"bool", "uint_10", "OpINotEqual", "uint_20", "__bool", - "ScalarConstructor[not set]{10}", "not_equal", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "not_equal", + "ScalarConstructor[not set]{20u}"}, // Both int BinaryData{"bool", "int_30", "OpINotEqual", "int_40", "__bool", "ScalarConstructor[not set]{30}", "not_equal", "ScalarConstructor[not set]{40}"}, // uint int BinaryData{"bool", "uint_10", "OpINotEqual", "int_40", "__bool", - "ScalarConstructor[not set]{10}", "not_equal", + "ScalarConstructor[not set]{10u}", "not_equal", R"(Bitcast[not set]<__u32>{ ScalarConstructor[not set]{40} })"}, @@ -360,7 +360,7 @@ INSTANTIATE_TEST_SUITE_P( BinaryData{"bool", "int_40", "OpINotEqual", "uint_10", "__bool", "ScalarConstructor[not set]{40}", "not_equal", R"(Bitcast[not set]<__i32>{ - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{10u} })"}, // Both v2uint BinaryData{"v2bool", "v2uint_10_20", "OpINotEqual", "v2uint_20_10", @@ -480,15 +480,15 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both unsigned BinaryData{"bool", "uint_10", "OpUGreaterThan", "uint_20", "__bool", - "ScalarConstructor[not set]{10}", "greater_than", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "greater_than", + "ScalarConstructor[not set]{20u}"}, // First arg signed BinaryData{"bool", "int_30", "OpUGreaterThan", "uint_20", "__bool", AstFor("cast_int_30"), "greater_than", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{20u}"}, // Second arg signed BinaryData{"bool", "uint_10", "OpUGreaterThan", "int_40", "__bool", - "ScalarConstructor[not set]{10}", "greater_than", + "ScalarConstructor[not set]{10u}", "greater_than", AstFor("cast_int_40")}, // Vector, both unsigned BinaryData{"v2bool", "v2uint_10_20", "OpUGreaterThan", "v2uint_20_10", @@ -509,15 +509,15 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both unsigned BinaryData{"bool", "uint_10", "OpUGreaterThanEqual", "uint_20", - "__bool", "ScalarConstructor[not set]{10}", - "greater_than_equal", "ScalarConstructor[not set]{20}"}, + "__bool", "ScalarConstructor[not set]{10u}", + "greater_than_equal", "ScalarConstructor[not set]{20u}"}, // First arg signed BinaryData{"bool", "int_30", "OpUGreaterThanEqual", "uint_20", "__bool", AstFor("cast_int_30"), "greater_than_equal", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{20u}"}, // Second arg signed BinaryData{"bool", "uint_10", "OpUGreaterThanEqual", "int_40", "__bool", - "ScalarConstructor[not set]{10}", "greater_than_equal", + "ScalarConstructor[not set]{10u}", "greater_than_equal", AstFor("cast_int_40")}, // Vector, both unsigned BinaryData{"v2bool", "v2uint_10_20", "OpUGreaterThanEqual", @@ -538,15 +538,15 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both unsigned BinaryData{"bool", "uint_10", "OpULessThan", "uint_20", "__bool", - "ScalarConstructor[not set]{10}", "less_than", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "less_than", + "ScalarConstructor[not set]{20u}"}, // First arg signed BinaryData{"bool", "int_30", "OpULessThan", "uint_20", "__bool", AstFor("cast_int_30"), "less_than", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{20u}"}, // Second arg signed BinaryData{"bool", "uint_10", "OpULessThan", "int_40", "__bool", - "ScalarConstructor[not set]{10}", "less_than", + "ScalarConstructor[not set]{10u}", "less_than", AstFor("cast_int_40")}, // Vector, both unsigned BinaryData{"v2bool", "v2uint_10_20", "OpULessThan", "v2uint_20_10", @@ -567,15 +567,15 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( // Both unsigned BinaryData{"bool", "uint_10", "OpULessThanEqual", "uint_20", "__bool", - "ScalarConstructor[not set]{10}", "less_than_equal", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{10u}", "less_than_equal", + "ScalarConstructor[not set]{20u}"}, // First arg signed BinaryData{"bool", "int_30", "OpULessThanEqual", "uint_20", "__bool", AstFor("cast_int_30"), "less_than_equal", - "ScalarConstructor[not set]{20}"}, + "ScalarConstructor[not set]{20u}"}, // Second arg signed BinaryData{"bool", "uint_10", "OpULessThanEqual", "int_40", "__bool", - "ScalarConstructor[not set]{10}", "less_than_equal", + "ScalarConstructor[not set]{10u}", "less_than_equal", AstFor("cast_int_40")}, // Vector, both unsigned BinaryData{"v2bool", "v2uint_10_20", "OpULessThanEqual", "v2uint_20_10", @@ -1170,8 +1170,8 @@ TEST_F(SpvFUnordTest, Select_BoolCond_IntScalarParams) { Call[not set]{ Identifier[not set]{select} ( - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} ScalarConstructor[not set]{true} ) } @@ -1236,13 +1236,13 @@ TEST_F(SpvFUnordTest, Select_BoolCond_VectorParams) { ( TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{20} - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{20u} + ScalarConstructor[not set]{10u} } ScalarConstructor[not set]{true} ) @@ -1276,13 +1276,13 @@ TEST_F(SpvFUnordTest, Select_VecBoolCond_VectorParams) { ( TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{10} - ScalarConstructor[not set]{20} + ScalarConstructor[not set]{10u} + ScalarConstructor[not set]{20u} } TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{20} - ScalarConstructor[not set]{10} + ScalarConstructor[not set]{20u} + ScalarConstructor[not set]{10u} } TypeConstructor[not set]{ __vec_2__bool diff --git a/src/reader/spirv/function_memory_test.cc b/src/reader/spirv/function_memory_test.cc index d0cb02b41d..6e0c6996b1 100644 --- a/src/reader/spirv/function_memory_test.cc +++ b/src/reader/spirv/function_memory_test.cc @@ -80,11 +80,11 @@ TEST_F(SpvParserTest, EmitStatement_StoreUintConst) { EXPECT_TRUE(fe.EmitBody()); EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(Assignment{ Identifier[not set]{x_1} - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} } Assignment{ Identifier[not set]{x_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} })")); } @@ -274,7 +274,7 @@ TEST_F(SpvParserTest, EmitStatement_StoreToModuleScopeVar) { EXPECT_TRUE(fe.EmitBody()); EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(Assignment{ Identifier[not set]{x_1} - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} })")); } @@ -344,7 +344,7 @@ TEST_F(SpvParserTest, EmitStatement_AccessChain_VectorSwizzle) { Identifier[not set]{myvar} Identifier[not set]{z} } - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} })")); } @@ -407,7 +407,7 @@ TEST_F(SpvParserTest, EmitStatement_AccessChain_VectorNonConstIndex) { Identifier[not set]{myvar} Identifier[not set]{x_11} } - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} })")); } @@ -442,7 +442,7 @@ TEST_F(SpvParserTest, EmitStatement_AccessChain_Matrix) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(Assignment{ ArrayAccessor[not set]{ Identifier[not set]{myvar} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } TypeConstructor[not set]{ __vec_4__f32 @@ -485,7 +485,7 @@ TEST_F(SpvParserTest, EmitStatement_AccessChain_Array) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(Assignment{ ArrayAccessor[not set]{ Identifier[not set]{myvar} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } TypeConstructor[not set]{ __vec_4__f32 @@ -688,7 +688,7 @@ TEST_F(SpvParserTest, EmitStatement_AccessChain_Struct_RuntimeArray) { Identifier[not set]{myvar} Identifier[not set]{age} } - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } ScalarConstructor[not set]{42.000000} })")); @@ -726,7 +726,7 @@ TEST_F(SpvParserTest, EmitStatement_AccessChain_Compound_Matrix_Vector) { MemberAccessor[not set]{ ArrayAccessor[not set]{ Identifier[not set]{myvar} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Identifier[not set]{w} } @@ -836,7 +836,7 @@ TEST_F(SpvParserTest, RemapStorageBuffer_ThroughAccessChain_NonCascaded) { Identifier[not set]{myvar} Identifier[not set]{field0} } - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Assignment{ ArrayAccessor[not set]{ @@ -844,9 +844,9 @@ Assignment{ Identifier[not set]{myvar} Identifier[not set]{field1} } - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} })")); } @@ -878,7 +878,7 @@ TEST_F(SpvParserTest, Identifier[not set]{myvar} Identifier[not set]{field0} } - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Assignment{ ArrayAccessor[not set]{ @@ -886,9 +886,9 @@ Assignment{ Identifier[not set]{myvar} Identifier[not set]{field1} } - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} })")) << got << p->error(); } @@ -918,9 +918,9 @@ TEST_F(SpvParserTest, RemapStorageBuffer_ThroughAccessChain_Cascaded) { Identifier[not set]{myvar} Identifier[not set]{field1} } - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} })")) << p->error(); } @@ -956,14 +956,14 @@ TEST_F(SpvParserTest, RemapStorageBuffer_ThroughCopyObject_WithoutHoisting) { Identifier[not set]{myvar} Identifier[not set]{field1} } - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } } Assignment{ Identifier[not set]{x_2} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} })")) << p->error(); } @@ -999,8 +999,8 @@ TEST_F(SpvParserTest, RemapStorageBuffer_ThroughCopyObject_WithHoisting) { ASSERT_TRUE(p->BuildAndParseInternalModule()) << assembly << p->error(); FunctionEmitter fe(p.get(), *spirv_function(p.get(), 100)); EXPECT_TRUE(fe.EmitBody()) << p->error(); - EXPECT_THAT(ToString(p->builder(), fe.ast_body()), - Eq(R"(VariableDeclStatement{ + EXPECT_EQ(ToString(p->builder(), fe.ast_body()), + R"(VariableDeclStatement{ Variable{ x_2 function @@ -1019,7 +1019,7 @@ If{ Identifier[not set]{myvar} Identifier[not set]{field1} } - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -1031,10 +1031,10 @@ Else{ } Assignment{ Identifier[not set]{x_2} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Return{} -)")) << p->error(); +)") << p->error(); } TEST_F(SpvParserTest, DISABLED_RemapStorageBuffer_ThroughFunctionCall) { diff --git a/src/reader/spirv/function_misc_test.cc b/src/reader/spirv/function_misc_test.cc index c2a5e624db..5f747b5985 100644 --- a/src/reader/spirv/function_misc_test.cc +++ b/src/reader/spirv/function_misc_test.cc @@ -81,7 +81,7 @@ VariableDeclStatement{ none __u32 { - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } } } @@ -151,8 +151,8 @@ VariableDeclStatement{ { TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{0} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} + ScalarConstructor[not set]{0u} } } } @@ -224,7 +224,7 @@ VariableDeclStatement{ none __u32 { - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } } } @@ -277,8 +277,8 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Vector) { { TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{0} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} + ScalarConstructor[not set]{0u} } } } @@ -380,8 +380,8 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Array) { { TypeConstructor[not set]{ __array__u32_2 - ScalarConstructor[not set]{0} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} + ScalarConstructor[not set]{0u} } } } @@ -414,7 +414,7 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Struct) { TypeConstructor[not set]{ __struct_S ScalarConstructor[not set]{false} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} ScalarConstructor[not set]{0} ScalarConstructor[not set]{0.000000} } diff --git a/src/reader/spirv/function_var_test.cc b/src/reader/spirv/function_var_test.cc index 53a028b3e8..67628224d7 100644 --- a/src/reader/spirv/function_var_test.cc +++ b/src/reader/spirv/function_var_test.cc @@ -244,7 +244,7 @@ VariableDeclStatement{ function __u32 { - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -308,7 +308,7 @@ VariableDeclStatement{ function __u32 { - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } } } @@ -436,8 +436,8 @@ TEST_F(SpvParserTest, EmitFunctionVariables_ArrayInitializer) { { TypeConstructor[not set]{ __array__u32_2 - ScalarConstructor[not set]{1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{1u} + ScalarConstructor[not set]{2u} } } } @@ -471,8 +471,8 @@ TEST_F(SpvParserTest, EmitFunctionVariables_ArrayInitializer_Alias) { { TypeConstructor[not set]{ __alias_Arr__array__u32_2_stride_16 - ScalarConstructor[not set]{1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{1u} + ScalarConstructor[not set]{2u} } } } @@ -506,8 +506,8 @@ TEST_F(SpvParserTest, EmitFunctionVariables_ArrayInitializer_Null) { { TypeConstructor[not set]{ __array__u32_2 - ScalarConstructor[not set]{0} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} + ScalarConstructor[not set]{0u} } } } @@ -541,8 +541,8 @@ TEST_F(SpvParserTest, EmitFunctionVariables_ArrayInitializer_Alias_Null) { { TypeConstructor[not set]{ __alias_Arr__array__u32_2_stride_16 - ScalarConstructor[not set]{0} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} + ScalarConstructor[not set]{0u} } } } @@ -576,12 +576,12 @@ TEST_F(SpvParserTest, EmitFunctionVariables_StructInitializer) { { TypeConstructor[not set]{ __struct_S - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} ScalarConstructor[not set]{1.500000} TypeConstructor[not set]{ __array__u32_2 - ScalarConstructor[not set]{1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{1u} + ScalarConstructor[not set]{2u} } } } @@ -616,12 +616,12 @@ TEST_F(SpvParserTest, EmitFunctionVariables_StructInitializer_Null) { { TypeConstructor[not set]{ __struct_S - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} ScalarConstructor[not set]{0.000000} TypeConstructor[not set]{ __array__u32_2 - ScalarConstructor[not set]{0} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} + ScalarConstructor[not set]{0u} } } } @@ -663,14 +663,14 @@ TEST_F(SpvParserTest, } Assignment{ Identifier[not set]{x_25} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{x_25} Binary[not set]{ - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} add - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } Return{} @@ -715,16 +715,16 @@ VariableDeclStatement{ __u32 { Binary[not set]{ - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} add - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } } Assignment{ Identifier[not set]{x_25} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Assignment{ Identifier[not set]{x_25} @@ -787,16 +787,16 @@ VariableDeclStatement{ __u32 { Binary[not set]{ - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} add - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } } Assignment{ Identifier[not set]{x_25} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Loop{ continuing { @@ -808,7 +808,7 @@ Loop{ } Assignment{ Identifier[not set]{x_25} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{2u} } Return{} )"; @@ -874,7 +874,7 @@ TEST_F( auto got = ToString(p->builder(), fe.ast_body()); auto* expect = R"(Assignment{ Identifier[not set]{x_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Loop{ VariableDeclStatement{ @@ -886,7 +886,7 @@ Loop{ } Assignment{ Identifier[not set]{x_1} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -898,7 +898,7 @@ Loop{ } Assignment{ Identifier[not set]{x_1} - ScalarConstructor[not set]{3} + ScalarConstructor[not set]{3u} } If{ ( @@ -908,9 +908,9 @@ Loop{ Assignment{ Identifier[not set]{x_2} Binary[not set]{ - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} add - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -927,7 +927,7 @@ Loop{ continuing { Assignment{ Identifier[not set]{x_1} - ScalarConstructor[not set]{4} + ScalarConstructor[not set]{4u} } If{ ( @@ -941,7 +941,7 @@ Loop{ } Assignment{ Identifier[not set]{x_1} - ScalarConstructor[not set]{5} + ScalarConstructor[not set]{5u} } Return{} )"; @@ -996,7 +996,7 @@ TEST_F( none __u32 { - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -1086,7 +1086,7 @@ TEST_F(SpvParserTest, none __u32 { - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -1173,14 +1173,14 @@ TEST_F( none __u32 { - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } Switch{ - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} { - Case 0{ + Case 0u{ } Default{ } @@ -1251,7 +1251,7 @@ TEST_F(SpvParserTest, none __u32 { - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -1356,11 +1356,11 @@ TEST_F(SpvParserTest, EmitStatement_Phi_SingleBlockLoopIndex) { } Assignment{ Identifier[not set]{x_2_phi} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Assignment{ Identifier[not set]{x_3_phi} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -1396,7 +1396,7 @@ TEST_F(SpvParserTest, EmitStatement_Phi_SingleBlockLoopIndex) { Binary[not set]{ Identifier[not set]{x_2} add - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } Assignment{ @@ -1500,11 +1500,11 @@ TEST_F(SpvParserTest, EmitStatement_Phi_MultiBlockLoopIndex) { } Assignment{ Identifier[not set]{x_2_phi} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Assignment{ Identifier[not set]{x_3_phi} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } If{ ( @@ -1556,7 +1556,7 @@ TEST_F(SpvParserTest, EmitStatement_Phi_MultiBlockLoopIndex) { Binary[not set]{ Identifier[not set]{x_2} add - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } Assignment{ @@ -1648,11 +1648,11 @@ Loop{ } Assignment{ Identifier[not set]{x_2_phi} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Assignment{ Identifier[not set]{x_5_phi} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } Loop{ VariableDeclStatement{ @@ -1691,7 +1691,7 @@ Loop{ Binary[not set]{ Identifier[not set]{x_2} add - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -1705,7 +1705,7 @@ Loop{ Binary[not set]{ Identifier[not set]{x_4} add - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -1833,7 +1833,7 @@ Loop{ { Assignment{ Identifier[not set]{x_2_phi} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Continue{} } @@ -1842,7 +1842,7 @@ Loop{ { Assignment{ Identifier[not set]{x_2_phi} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -1950,7 +1950,7 @@ Loop{ } Assignment{ Identifier[not set]{x_2_phi} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } If{ ( @@ -1959,7 +1959,7 @@ Loop{ { Assignment{ Identifier[not set]{x_2_phi} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } @@ -2044,15 +2044,15 @@ TEST_F(SpvParserTest, } } Switch{ - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} { Default{ Fallthrough{} } - Case 0{ + Case 0u{ Fallthrough{} } - Case 1{ + Case 1u{ If{ ( ScalarConstructor[not set]{true} @@ -2064,14 +2064,14 @@ Switch{ { Assignment{ Identifier[not set]{x_35_phi} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } Break{} } } Assignment{ Identifier[not set]{x_35_phi} - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } } diff --git a/src/reader/spirv/parser_impl_function_decl_test.cc b/src/reader/spirv/parser_impl_function_decl_test.cc index ab9da9d92a..5b2e753bd5 100644 --- a/src/reader/spirv/parser_impl_function_decl_test.cc +++ b/src/reader/spirv/parser_impl_function_decl_test.cc @@ -209,7 +209,7 @@ TEST_F(SpvParserTest, EmitFunctions_CalleePrecedesCaller) { { Return{ { - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } } } diff --git a/src/reader/spirv/parser_impl_module_var_test.cc b/src/reader/spirv/parser_impl_module_var_test.cc index b70bdef136..220261eb03 100644 --- a/src/reader/spirv/parser_impl_module_var_test.cc +++ b/src/reader/spirv/parser_impl_module_var_test.cc @@ -890,7 +890,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarInitializers) { private __u32 { - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} } } Variable{ @@ -939,7 +939,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarNullInitializers) { private __u32 { - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } } Variable{ @@ -988,7 +988,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarUndefInitializers) { private __u32 { - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} } } Variable{ @@ -1087,8 +1087,8 @@ TEST_F(SpvModuleScopeVarParserTest, VectorUintNullInitializer) { { TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{0} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} + ScalarConstructor[not set]{0u} } } })")); @@ -1110,8 +1110,8 @@ TEST_F(SpvModuleScopeVarParserTest, VectorUintUndefInitializer) { { TypeConstructor[not set]{ __vec_2__u32 - ScalarConstructor[not set]{0} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} + ScalarConstructor[not set]{0u} } } })")); @@ -1340,8 +1340,8 @@ TEST_F(SpvModuleScopeVarParserTest, ArrayInitializer) { { TypeConstructor[not set]{ __array__u32_2 - ScalarConstructor[not set]{1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{1u} + ScalarConstructor[not set]{2u} } } })")); @@ -1363,8 +1363,8 @@ TEST_F(SpvModuleScopeVarParserTest, ArrayNullInitializer) { { TypeConstructor[not set]{ __array__u32_2 - ScalarConstructor[not set]{0} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} + ScalarConstructor[not set]{0u} } } })")); @@ -1386,8 +1386,8 @@ TEST_F(SpvModuleScopeVarParserTest, ArrayUndefInitializer) { { TypeConstructor[not set]{ __array__u32_2 - ScalarConstructor[not set]{0} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} + ScalarConstructor[not set]{0u} } } })")); @@ -1411,12 +1411,12 @@ TEST_F(SpvModuleScopeVarParserTest, StructInitializer) { { TypeConstructor[not set]{ __struct_S - ScalarConstructor[not set]{1} + ScalarConstructor[not set]{1u} ScalarConstructor[not set]{1.500000} TypeConstructor[not set]{ __array__u32_2 - ScalarConstructor[not set]{1} - ScalarConstructor[not set]{2} + ScalarConstructor[not set]{1u} + ScalarConstructor[not set]{2u} } } } @@ -1440,12 +1440,12 @@ TEST_F(SpvModuleScopeVarParserTest, StructNullInitializer) { { TypeConstructor[not set]{ __struct_S - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} ScalarConstructor[not set]{0.000000} TypeConstructor[not set]{ __array__u32_2 - ScalarConstructor[not set]{0} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} + ScalarConstructor[not set]{0u} } } } @@ -1469,12 +1469,12 @@ TEST_F(SpvModuleScopeVarParserTest, StructUndefInitializer) { { TypeConstructor[not set]{ __struct_S - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} ScalarConstructor[not set]{0.000000} TypeConstructor[not set]{ __array__u32_2 - ScalarConstructor[not set]{0} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} + ScalarConstructor[not set]{0u} } } } @@ -1906,7 +1906,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarSpecConstant_DeclareConst_U32) { none __u32 { - ScalarConstructor[not set]{42} + ScalarConstructor[not set]{42u} } } })")) << module_str; @@ -2762,7 +2762,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_U32_Direct) { EXPECT_THAT(module_str, HasSubstr(R"( Assignment{ Identifier[not set]{x_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} })")) << module_str; } @@ -2798,7 +2798,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_U32_CopyObject) { EXPECT_THAT(module_str, HasSubstr(R"( Assignment{ Identifier[not set]{x_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} })")) << module_str; } @@ -2834,7 +2834,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_U32_AccessChain) { EXPECT_THAT(module_str, HasSubstr(R"( Assignment{ Identifier[not set]{x_1} - ScalarConstructor[not set]{0} + ScalarConstructor[not set]{0u} })")) << module_str; } diff --git a/src/resolver/control_block_validation_test.cc b/src/resolver/control_block_validation_test.cc index 4e17660e5d..a7a1897942 100644 --- a/src/resolver/control_block_validation_test.cc +++ b/src/resolver/control_block_validation_test.cc @@ -213,10 +213,9 @@ TEST_F(ResolverControlBlockValidationTest, WrapInFunction(block); EXPECT_FALSE(r()->Resolve()); - EXPECT_EQ( - r()->error(), - "12:34 error v-0027: a literal value must not appear more than once " - "in the case selectors for a switch statement: '2'"); + EXPECT_EQ(r()->error(), + "12:34 error v-0027: a literal value must not appear more than " + "once in the case selectors for a switch statement: '2u'"); } TEST_F(ResolverControlBlockValidationTest,