diff --git a/src/tint/reader/spirv/function.cc b/src/tint/reader/spirv/function.cc index bb5d222e62..d0268c6c7e 100644 --- a/src/tint/reader/spirv/function.cc +++ b/src/tint/reader/spirv/function.cc @@ -2844,7 +2844,7 @@ bool FunctionEmitter::EmitIfStart(const BlockInfo& block_info) { const std::string guard_name = block_info.flow_guard_name; if (!guard_name.empty()) { // Declare the guard variable just before the "if", initialized to true. - auto* guard_var = builder_.Var(guard_name, builder_.ty.bool_(), MakeTrue(Source{})); + auto* guard_var = builder_.Var(guard_name, MakeTrue(Source{})); auto* guard_decl = create(Source{}, guard_var); AddStatement(guard_decl); } @@ -3448,7 +3448,7 @@ bool FunctionEmitter::EmitConstDefinition(const spvtools::opt::Instruction& inst expr = AddressOfIfNeeded(expr, &inst); expr.type = RemapPointerProperties(expr.type, inst.result_id()); - auto* let = parser_impl_.MakeLet(inst.result_id(), expr.type, expr.expr); + auto* let = parser_impl_.MakeLet(inst.result_id(), expr.expr); if (!let) { return false; } @@ -6212,7 +6212,7 @@ bool FunctionEmitter::MakeVectorInsertDynamic(const spvtools::opt::Instruction& // variable with the %src_vector contents, then write the component, // and then make a let-declaration that reads the value out: // - // var temp : type = src_vector; + // var temp = src_vector; // temp[index] = component; // let result : type = temp; // @@ -6238,8 +6238,7 @@ bool FunctionEmitter::MakeVectorInsertDynamic(const spvtools::opt::Instruction& // API in parser_impl_. var_name = namer_.MakeDerivedName(original_value_name); - auto* temp_var = builder_.Var(var_name, type->Build(builder_), - builtin::AddressSpace::kUndefined, src_vector.expr); + auto* temp_var = builder_.Var(var_name, builtin::AddressSpace::kUndefined, src_vector.expr); AddStatement(builder_.Decl({}, temp_var)); } @@ -6278,7 +6277,7 @@ bool FunctionEmitter::MakeCompositeInsert(const spvtools::opt::Instruction& inst // variable with the %composite contents, then write the component, // and then make a let-declaration that reads the value out: // - // var temp : type = composite; + // var temp = composite; // temp[index].x = object; // let result : type = temp; // @@ -6308,8 +6307,8 @@ bool FunctionEmitter::MakeCompositeInsert(const spvtools::opt::Instruction& inst // It doesn't correspond to a SPIR-V ID, so we don't use the ordinary // API in parser_impl_. var_name = namer_.MakeDerivedName(original_value_name); - auto* temp_var = builder_.Var(var_name, type->Build(builder_), - builtin::AddressSpace::kUndefined, src_composite.expr); + auto* temp_var = + builder_.Var(var_name, builtin::AddressSpace::kUndefined, src_composite.expr); AddStatement(builder_.Decl({}, temp_var)); } diff --git a/src/tint/reader/spirv/function_arithmetic_test.cc b/src/tint/reader/spirv/function_arithmetic_test.cc index 538e410781..ed26800902 100644 --- a/src/tint/reader/spirv/function_arithmetic_test.cc +++ b/src/tint/reader/spirv/function_arithmetic_test.cc @@ -122,7 +122,7 @@ TEST_F(SpvUnaryArithTest, SNegate_Int_Int) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : i32 = -(30i);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = -(30i);")); } TEST_F(SpvUnaryArithTest, SNegate_Int_Uint) { @@ -139,7 +139,7 @@ TEST_F(SpvUnaryArithTest, SNegate_Int_Uint) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : i32 = -(bitcast(10u));")); + HasSubstr("let x_1 = -(bitcast(10u));")); } TEST_F(SpvUnaryArithTest, SNegate_Uint_Int) { @@ -156,7 +156,7 @@ TEST_F(SpvUnaryArithTest, SNegate_Uint_Int) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : u32 = bitcast(-(30i));")); + HasSubstr("let x_1 = bitcast(-(30i));")); } TEST_F(SpvUnaryArithTest, SNegate_Uint_Uint) { @@ -173,7 +173,7 @@ TEST_F(SpvUnaryArithTest, SNegate_Uint_Uint) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : u32 = bitcast(-(bitcast(10u)));")); + HasSubstr("let x_1 = bitcast(-(bitcast(10u)));")); } TEST_F(SpvUnaryArithTest, SNegate_SignedVec_SignedVec) { @@ -189,8 +189,7 @@ TEST_F(SpvUnaryArithTest, SNegate_SignedVec_SignedVec) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2i = -(vec2i(30i, 40i));")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = -(vec2i(30i, 40i));")); } TEST_F(SpvUnaryArithTest, SNegate_SignedVec_UnsignedVec) { @@ -207,7 +206,7 @@ TEST_F(SpvUnaryArithTest, SNegate_SignedVec_UnsignedVec) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2i = -(bitcast(vec2u(10u, 20u)));")); + HasSubstr("let x_1 = -(bitcast(vec2u(10u, 20u)));")); } TEST_F(SpvUnaryArithTest, SNegate_UnsignedVec_SignedVec) { @@ -224,7 +223,7 @@ TEST_F(SpvUnaryArithTest, SNegate_UnsignedVec_SignedVec) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2u = bitcast(-(vec2i(30i, 40i)));")); + HasSubstr("let x_1 = bitcast(-(vec2i(30i, 40i)));")); } TEST_F(SpvUnaryArithTest, SNegate_UnsignedVec_UnsignedVec) { @@ -240,9 +239,8 @@ TEST_F(SpvUnaryArithTest, SNegate_UnsignedVec_UnsignedVec) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT( - test::ToString(p->program(), ast_body), - HasSubstr(R"(let x_1 : vec2u = bitcast(-(bitcast(vec2u(10u, 20u))));)")); + EXPECT_THAT(test::ToString(p->program(), ast_body), + HasSubstr(R"(let x_1 = bitcast(-(bitcast(vec2u(10u, 20u))));)")); } TEST_F(SpvUnaryArithTest, FNegate_Scalar) { @@ -258,7 +256,7 @@ TEST_F(SpvUnaryArithTest, FNegate_Scalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : f32 = -(50.0f);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = -(50.0f);")); } TEST_F(SpvUnaryArithTest, FNegate_Vector) { @@ -274,8 +272,7 @@ TEST_F(SpvUnaryArithTest, FNegate_Vector) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2f = -(v2float_50_60);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = -(v2float_50_60);")); } struct BinaryData { @@ -313,8 +310,8 @@ TEST_P(SpvBinaryArithTest, EmitExpression) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); utils::StringStream ss; - ss << "let x_1 : " << GetParam().ast_type << " = (" << GetParam().ast_lhs << " " - << GetParam().ast_op << " " << GetParam().ast_rhs << ");"; + ss << "let x_1 = (" << GetParam().ast_lhs << " " << GetParam().ast_op << " " + << GetParam().ast_rhs << ");"; auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); EXPECT_THAT(got, HasSubstr(ss.str())) << "got:\n" << got << assembly; @@ -352,7 +349,7 @@ TEST_P(SpvBinaryArithGeneralTest, EmitExpression) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); utils::StringStream ss; - ss << "let x_1 : " << GetParam().wgsl_type << " = " << GetParam().expected << ";"; + ss << "let x_1 = " << GetParam().expected << ";"; auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); EXPECT_THAT(got, HasSubstr(ss.str())) << "got:\n" << got << assembly; @@ -547,7 +544,7 @@ TEST_F(SpvBinaryArithTestBasic, SDiv_Scalar_UnsignedResult) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : u32 = bitcast((30i / 40i));")); + HasSubstr("let x_1 = bitcast((30i / 40i));")); } TEST_F(SpvBinaryArithTestBasic, SDiv_Vector_UnsignedResult) { @@ -567,9 +564,8 @@ TEST_F(SpvBinaryArithTestBasic, SDiv_Vector_UnsignedResult) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT( - test::ToString(p->program(), ast_body), - HasSubstr(R"(let x_1 : vec2u = bitcast((vec2i(30i, 40i) / vec2i(40i, 30i)));)")); + EXPECT_THAT(test::ToString(p->program(), ast_body), + HasSubstr(R"(let x_1 = bitcast((vec2i(30i, 40i) / vec2i(40i, 30i)));)")); } INSTANTIATE_TEST_SUITE_P(SpvParserTest_FDiv, @@ -636,7 +632,7 @@ TEST_F(SpvBinaryArithTestBasic, SMod_Scalar_UnsignedResult) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : u32 = bitcast((30i % 40i));")); + HasSubstr("let x_1 = bitcast((30i % 40i));")); } TEST_F(SpvBinaryArithTestBasic, SMod_Vector_UnsignedResult) { @@ -656,9 +652,8 @@ TEST_F(SpvBinaryArithTestBasic, SMod_Vector_UnsignedResult) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT( - test::ToString(p->program(), ast_body), - HasSubstr(R"(let x_1 : vec2u = bitcast((vec2i(30i, 40i) % vec2i(40i, 30i)));)")); + EXPECT_THAT(test::ToString(p->program(), ast_body), + HasSubstr(R"(let x_1 = bitcast((vec2i(30i, 40i) % vec2i(40i, 30i)));)")); } INSTANTIATE_TEST_SUITE_P(SpvParserTest_FRem, @@ -685,7 +680,7 @@ TEST_F(SpvBinaryArithTestBasic, FMod_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : f32 = (50.0f - (60.0f * floor((50.0f / 60.0f))));")); + HasSubstr("let x_1 = (50.0f - (60.0f * floor((50.0f / 60.0f))));")); } TEST_F(SpvBinaryArithTestBasic, FMod_Vector) { @@ -702,7 +697,7 @@ TEST_F(SpvBinaryArithTestBasic, FMod_Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2f = (v2float_50_60 - (v2float_60_50 * " + HasSubstr("let x_1 = (v2float_50_60 - (v2float_60_50 * " "floor((v2float_50_60 / v2float_60_50))));")); } @@ -721,8 +716,7 @@ TEST_F(SpvBinaryArithTestBasic, VectorTimesScalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_10 : vec2f = (x_1 * x_2);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_10 = (x_1 * x_2);")); } TEST_F(SpvBinaryArithTestBasic, MatrixTimesScalar) { @@ -740,8 +734,7 @@ TEST_F(SpvBinaryArithTestBasic, MatrixTimesScalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_10 : mat2x2f = (x_1 * x_2);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_10 = (x_1 * x_2);")); } TEST_F(SpvBinaryArithTestBasic, VectorTimesMatrix) { @@ -759,8 +752,7 @@ TEST_F(SpvBinaryArithTestBasic, VectorTimesMatrix) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_10 : vec2f = (x_1 * x_2);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_10 = (x_1 * x_2);")); } TEST_F(SpvBinaryArithTestBasic, MatrixTimesVector) { @@ -778,8 +770,7 @@ TEST_F(SpvBinaryArithTestBasic, MatrixTimesVector) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_10 : vec2f = (x_1 * x_2);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_10 = (x_1 * x_2);")); } TEST_F(SpvBinaryArithTestBasic, MatrixTimesMatrix) { @@ -797,8 +788,7 @@ TEST_F(SpvBinaryArithTestBasic, MatrixTimesMatrix) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_10 : mat2x2f = (x_1 * x_2);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_10 = (x_1 * x_2);")); } TEST_F(SpvBinaryArithTestBasic, Dot) { @@ -816,8 +806,7 @@ TEST_F(SpvBinaryArithTestBasic, Dot) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_3 : f32 = dot(x_1, x_2);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_3 = dot(x_1, x_2);")); } TEST_F(SpvBinaryArithTestBasic, OuterProduct) { @@ -838,7 +827,7 @@ TEST_F(SpvBinaryArithTestBasic, OuterProduct) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); - EXPECT_THAT(got, HasSubstr("let x_3 : mat2x3f = mat2x3f(" + EXPECT_THAT(got, HasSubstr("let x_3 = mat2x3f(" "vec3f((x_2.x * x_1.x), (x_2.x * x_1.y), (x_2.x * x_1.z)), " "vec3f((x_2.y * x_1.x), (x_2.y * x_1.y), (x_2.y * x_1.z)));")) << got; @@ -888,7 +877,7 @@ TEST_P(SpvBinaryDerivativeTest, Derivatives) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_2 : " + arg.ast_type + " = " + builtin.wgsl + "(x_1);")); + HasSubstr("let x_2 = " + builtin.wgsl + "(x_1);")); } INSTANTIATE_TEST_SUITE_P( @@ -920,7 +909,7 @@ TEST_F(SpvUnaryArithTest, Transpose_2x2) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error() << "\n" << assembly; auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); - const auto* expected = "let x_2 : mat2x2f = transpose(x_1);"; + const auto* expected = "let x_2 = transpose(x_1);"; auto ast_body = fe.ast_body(); const auto got = test::ToString(p->program(), ast_body); EXPECT_THAT(got, HasSubstr(expected)) << got; @@ -942,7 +931,7 @@ TEST_F(SpvUnaryArithTest, Transpose_2x3) { // Note, in the AST dump mat_2_3 means 2 rows and 3 columns. // So the column vectors have 2 elements. // That is, %m3v2float is __mat_2_3f32. - const auto* expected = "let x_2 : mat3x2f = transpose(x_1);"; + const auto* expected = "let x_2 = transpose(x_1);"; auto ast_body = fe.ast_body(); const auto got = test::ToString(p->program(), ast_body); EXPECT_THAT(got, HasSubstr(expected)) << got; @@ -961,7 +950,7 @@ TEST_F(SpvUnaryArithTest, Transpose_3x2) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error() << "\n" << assembly; auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); - const auto* expected = "let x_2 : mat2x3f = transpose(x_1);"; + const auto* expected = "let x_2 = transpose(x_1);"; auto ast_body = fe.ast_body(); const auto got = test::ToString(p->program(), ast_body); EXPECT_THAT(got, HasSubstr(expected)) << got; diff --git a/src/tint/reader/spirv/function_bit_test.cc b/src/tint/reader/spirv/function_bit_test.cc index 741126b2ef..71c3d455df 100644 --- a/src/tint/reader/spirv/function_bit_test.cc +++ b/src/tint/reader/spirv/function_bit_test.cc @@ -129,8 +129,8 @@ TEST_P(SpvBinaryBitTest, EmitExpression) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); utils::StringStream ss; - ss << "let x_1 : " << GetParam().ast_type << " = (" << GetParam().ast_lhs << " " - << GetParam().ast_op << " " << GetParam().ast_rhs << ");"; + ss << "let x_1 = (" << GetParam().ast_lhs << " " << GetParam().ast_op << " " + << GetParam().ast_rhs << ");"; auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(ss.str())) << assembly; } @@ -167,7 +167,7 @@ TEST_P(SpvBinaryBitGeneralTest, EmitExpression) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error() << assembly; utils::StringStream ss; - ss << "let x_1 : " << GetParam().wgsl_type << " = " << GetParam().expected << ";\nreturn;\n"; + ss << "let x_1 = " << GetParam().expected << ";\nreturn;\n"; auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); EXPECT_THAT(got, HasSubstr(ss.str())) << "got:\n" << got << assembly; @@ -445,7 +445,7 @@ TEST_F(SpvUnaryBitTest, Not_Int_Int) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : i32 = ~(30i);")); + EXPECT_THAT(body, HasSubstr("let x_1 = ~(30i);")); } TEST_F(SpvUnaryBitTest, Not_Int_Uint) { @@ -462,7 +462,7 @@ TEST_F(SpvUnaryBitTest, Not_Int_Uint) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : i32 = bitcast(~(10u));")); + EXPECT_THAT(body, HasSubstr("let x_1 = bitcast(~(10u));")); } TEST_F(SpvUnaryBitTest, Not_Uint_Int) { @@ -479,7 +479,7 @@ TEST_F(SpvUnaryBitTest, Not_Uint_Int) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : u32 = bitcast(~(30i));")); + EXPECT_THAT(body, HasSubstr("let x_1 = bitcast(~(30i));")); } TEST_F(SpvUnaryBitTest, Not_Uint_Uint) { @@ -496,7 +496,7 @@ TEST_F(SpvUnaryBitTest, Not_Uint_Uint) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : u32 = ~(10u);")); + EXPECT_THAT(body, HasSubstr("let x_1 = ~(10u);")); } TEST_F(SpvUnaryBitTest, Not_SignedVec_SignedVec) { @@ -513,7 +513,7 @@ TEST_F(SpvUnaryBitTest, Not_SignedVec_SignedVec) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2i = ~(vec2i(30i, 40i));")); + EXPECT_THAT(body, HasSubstr("let x_1 = ~(vec2i(30i, 40i));")); } TEST_F(SpvUnaryBitTest, Not_SignedVec_UnsignedVec) { @@ -530,7 +530,7 @@ TEST_F(SpvUnaryBitTest, Not_SignedVec_UnsignedVec) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2i = bitcast(~(vec2u(10u, 20u)));")); + EXPECT_THAT(body, HasSubstr("let x_1 = bitcast(~(vec2u(10u, 20u)));")); } TEST_F(SpvUnaryBitTest, Not_UnsignedVec_SignedVec) { @@ -547,7 +547,7 @@ TEST_F(SpvUnaryBitTest, Not_UnsignedVec_SignedVec) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2u = bitcast(~(vec2i(30i, 40i)));")); + EXPECT_THAT(body, HasSubstr("let x_1 = bitcast(~(vec2i(30i, 40i)));")); } TEST_F(SpvUnaryBitTest, Not_UnsignedVec_UnsignedVec) { const auto assembly = SimplePreamble() + R"( @@ -563,7 +563,7 @@ TEST_F(SpvUnaryBitTest, Not_UnsignedVec_UnsignedVec) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2u = ~(vec2u(10u, 20u));")); + EXPECT_THAT(body, HasSubstr("let x_1 = ~(vec2u(10u, 20u));")); } std::string BitTestPreamble() { @@ -604,7 +604,7 @@ TEST_F(SpvUnaryBitTest, BitCount_Uint_Uint) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : u32 = countOneBits(u1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = countOneBits(u1);")) << body; } TEST_F(SpvUnaryBitTest, BitCount_Uint_Int) { @@ -619,7 +619,7 @@ TEST_F(SpvUnaryBitTest, BitCount_Uint_Int) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : u32 = bitcast(countOneBits(i1));")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = bitcast(countOneBits(i1));")) << body; } TEST_F(SpvUnaryBitTest, BitCount_Int_Uint) { @@ -634,7 +634,7 @@ TEST_F(SpvUnaryBitTest, BitCount_Int_Uint) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : i32 = bitcast(countOneBits(u1));")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = bitcast(countOneBits(u1));")) << body; } TEST_F(SpvUnaryBitTest, BitCount_Int_Int) { @@ -649,7 +649,7 @@ TEST_F(SpvUnaryBitTest, BitCount_Int_Int) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : i32 = countOneBits(i1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = countOneBits(i1);")) << body; } TEST_F(SpvUnaryBitTest, BitCount_UintVector_UintVector) { @@ -664,7 +664,7 @@ TEST_F(SpvUnaryBitTest, BitCount_UintVector_UintVector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2u = countOneBits(v2u1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = countOneBits(v2u1);")) << body; } TEST_F(SpvUnaryBitTest, BitCount_UintVector_IntVector) { @@ -679,7 +679,7 @@ TEST_F(SpvUnaryBitTest, BitCount_UintVector_IntVector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2u = bitcast(countOneBits(v2i1));")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = bitcast(countOneBits(v2i1));")) << body; } TEST_F(SpvUnaryBitTest, BitCount_IntVector_UintVector) { @@ -694,7 +694,7 @@ TEST_F(SpvUnaryBitTest, BitCount_IntVector_UintVector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2i = bitcast(countOneBits(v2u1));")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = bitcast(countOneBits(v2u1));")) << body; } TEST_F(SpvUnaryBitTest, BitCount_IntVector_IntVector) { @@ -709,7 +709,7 @@ TEST_F(SpvUnaryBitTest, BitCount_IntVector_IntVector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2i = countOneBits(v2i1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = countOneBits(v2i1);")) << body; } TEST_F(SpvUnaryBitTest, BitReverse_Uint_Uint) { @@ -724,7 +724,7 @@ TEST_F(SpvUnaryBitTest, BitReverse_Uint_Uint) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : u32 = reverseBits(u1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = reverseBits(u1);")) << body; } TEST_F(SpvUnaryBitTest, BitReverse_Uint_Int) { @@ -763,7 +763,7 @@ TEST_F(SpvUnaryBitTest, BitReverse_Int_Int) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : i32 = reverseBits(i1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = reverseBits(i1);")) << body; } TEST_F(SpvUnaryBitTest, BitReverse_UintVector_UintVector) { @@ -778,7 +778,7 @@ TEST_F(SpvUnaryBitTest, BitReverse_UintVector_UintVector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2u = reverseBits(v2u1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = reverseBits(v2u1);")) << body; } TEST_F(SpvUnaryBitTest, BitReverse_UintVector_IntVector) { @@ -817,7 +817,7 @@ TEST_F(SpvUnaryBitTest, BitReverse_IntVector_IntVector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2i = reverseBits(v2i1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = reverseBits(v2i1);")) << body; } TEST_F(SpvUnaryBitTest, InsertBits_Int) { @@ -832,7 +832,7 @@ TEST_F(SpvUnaryBitTest, InsertBits_Int) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : i32 = insertBits(30i, 40i, 10u, 20u);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = insertBits(30i, 40i, 10u, 20u);")) << body; } TEST_F(SpvUnaryBitTest, InsertBits_Int_SignedOffsetAndCount) { @@ -847,8 +847,7 @@ TEST_F(SpvUnaryBitTest, InsertBits_Int_SignedOffsetAndCount) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : i32 = insertBits(30i, 40i, u32(10i), u32(20i));")) - << body; + EXPECT_THAT(body, HasSubstr("let x_1 = insertBits(30i, 40i, u32(10i), u32(20i));")) << body; } TEST_F(SpvUnaryBitTest, InsertBits_IntVector) { @@ -863,8 +862,7 @@ TEST_F(SpvUnaryBitTest, InsertBits_IntVector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, - HasSubstr(R"(let x_1 : vec2i = insertBits(x_28, vec2i(40i, 30i), 10u, 20u);)")) + EXPECT_THAT(body, HasSubstr(R"(let x_1 = insertBits(x_28, vec2i(40i, 30i), 10u, 20u);)")) << body; } @@ -880,9 +878,8 @@ TEST_F(SpvUnaryBitTest, InsertBits_IntVector_SignedOffsetAndCount) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT( - body, - HasSubstr(R"(let x_1 : vec2i = insertBits(x_28, vec2i(40i, 30i), u32(10i), u32(20i));)")) + EXPECT_THAT(body, + HasSubstr(R"(let x_1 = insertBits(x_28, vec2i(40i, 30i), u32(10i), u32(20i));)")) << body; } @@ -898,7 +895,7 @@ TEST_F(SpvUnaryBitTest, InsertBits_Uint) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : u32 = insertBits(20u, 10u, 10u, 20u);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = insertBits(20u, 10u, 10u, 20u);")) << body; } TEST_F(SpvUnaryBitTest, InsertBits_Uint_SignedOffsetAndCount) { @@ -913,8 +910,7 @@ TEST_F(SpvUnaryBitTest, InsertBits_Uint_SignedOffsetAndCount) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : u32 = insertBits(20u, 10u, u32(10i), u32(20i));")) - << body; + EXPECT_THAT(body, HasSubstr("let x_1 = insertBits(20u, 10u, u32(10i), u32(20i));")) << body; } TEST_F(SpvUnaryBitTest, InsertBits_UintVector) { @@ -929,8 +925,7 @@ TEST_F(SpvUnaryBitTest, InsertBits_UintVector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, - HasSubstr(R"(let x_1 : vec2u = insertBits(x_26, vec2u(20u, 10u), 10u, 20u);)")) + EXPECT_THAT(body, HasSubstr(R"(let x_1 = insertBits(x_26, vec2u(20u, 10u), 10u, 20u);)")) << body; } @@ -946,9 +941,8 @@ TEST_F(SpvUnaryBitTest, InsertBits_UintVector_SignedOffsetAndCount) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT( - body, - HasSubstr(R"(let x_1 : vec2u = insertBits(x_26, vec2u(20u, 10u), u32(10i), u32(20i));)")) + EXPECT_THAT(body, + HasSubstr(R"(let x_1 = insertBits(x_26, vec2u(20u, 10u), u32(10i), u32(20i));)")) << body; } @@ -964,7 +958,7 @@ TEST_F(SpvUnaryBitTest, ExtractBits_Int) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : i32 = extractBits(30i, 10u, 20u);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = extractBits(30i, 10u, 20u);")) << body; } TEST_F(SpvUnaryBitTest, ExtractBits_Int_SignedOffsetAndCount) { @@ -979,7 +973,7 @@ TEST_F(SpvUnaryBitTest, ExtractBits_Int_SignedOffsetAndCount) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : i32 = extractBits(30i, u32(10i), u32(20i));")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = extractBits(30i, u32(10i), u32(20i));")) << body; } TEST_F(SpvUnaryBitTest, ExtractBits_IntVector) { @@ -994,7 +988,7 @@ TEST_F(SpvUnaryBitTest, ExtractBits_IntVector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2i = extractBits(x_28, 10u, 20u);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = extractBits(x_28, 10u, 20u);")) << body; } TEST_F(SpvUnaryBitTest, ExtractBits_IntVector_SignedOffsetAndCount) { @@ -1009,8 +1003,7 @@ TEST_F(SpvUnaryBitTest, ExtractBits_IntVector_SignedOffsetAndCount) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2i = extractBits(x_28, u32(10i), u32(20i));")) - << body; + EXPECT_THAT(body, HasSubstr("let x_1 = extractBits(x_28, u32(10i), u32(20i));")) << body; } TEST_F(SpvUnaryBitTest, ExtractBits_Uint) { @@ -1025,7 +1018,7 @@ TEST_F(SpvUnaryBitTest, ExtractBits_Uint) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : u32 = extractBits(20u, 10u, 20u);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = extractBits(20u, 10u, 20u);")) << body; } TEST_F(SpvUnaryBitTest, ExtractBits_Uint_SignedOffsetAndCount) { @@ -1040,7 +1033,7 @@ TEST_F(SpvUnaryBitTest, ExtractBits_Uint_SignedOffsetAndCount) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : u32 = extractBits(20u, u32(10i), u32(20i));")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = extractBits(20u, u32(10i), u32(20i));")) << body; } TEST_F(SpvUnaryBitTest, ExtractBits_UintVector) { @@ -1055,7 +1048,7 @@ TEST_F(SpvUnaryBitTest, ExtractBits_UintVector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2u = extractBits(x_26, 10u, 20u);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = extractBits(x_26, 10u, 20u);")) << body; } TEST_F(SpvUnaryBitTest, ExtractBits_UintVector_SignedOffsetAndCount) { @@ -1070,8 +1063,7 @@ TEST_F(SpvUnaryBitTest, ExtractBits_UintVector_SignedOffsetAndCount) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2u = extractBits(x_26, u32(10i), u32(20i));")) - << body; + EXPECT_THAT(body, HasSubstr("let x_1 = extractBits(x_26, u32(10i), u32(20i));")) << body; } } // namespace diff --git a/src/tint/reader/spirv/function_call_test.cc b/src/tint/reader/spirv/function_call_test.cc index 145a6fb5d6..c15274f006 100644 --- a/src/tint/reader/spirv/function_call_test.cc +++ b/src/tint/reader/spirv/function_call_test.cc @@ -136,7 +136,7 @@ TEST_F(SpvParserTest, EmitStatement_ScalarCallNoParams) { f50 = fe.ast_body(); } auto program = p->program(); - EXPECT_THAT(test::ToString(program, f100), HasSubstr("let x_1 : u32 = x_50();\nreturn;")); + EXPECT_THAT(test::ToString(program, f100), HasSubstr("let x_1 = x_50();\nreturn;")); EXPECT_THAT(test::ToString(program, f50), HasSubstr("return 42u;")); } @@ -178,7 +178,7 @@ TEST_F(SpvParserTest, EmitStatement_ScalarCallNoParamsUsedTwice) { } auto program = p->program(); EXPECT_EQ(test::ToString(program, f100), R"(var x_10 : u32; -let x_1 : u32 = x_50(); +let x_1 = x_50(); x_10 = x_1; x_10 = x_1; return; @@ -217,7 +217,7 @@ TEST_F(SpvParserTest, EmitStatement_CallWithParams) { } fn x_100_1() { - let x_1 : u32 = x_50(42u, 84u); + let x_1 = x_50(42u, 84u); return; } diff --git a/src/tint/reader/spirv/function_cfg_test.cc b/src/tint/reader/spirv/function_cfg_test.cc index 36d085a893..b57633d5c7 100644 --- a/src/tint/reader/spirv/function_cfg_test.cc +++ b/src/tint/reader/spirv/function_cfg_test.cc @@ -7192,7 +7192,7 @@ TEST_F(SpvParserCFGTest, EmitBody_IfBreak_FromThen_ForwardWithinThen) { auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); auto* expect = R"(var_1 = 1u; -var guard10 : bool = true; +var guard10 = true; if (false) { var_1 = 2u; if (true) { @@ -7249,7 +7249,7 @@ TEST_F(SpvParserCFGTest, EmitBody_IfBreak_FromElse_ForwardWithinElse) { auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); auto* expect = R"(var_1 = 1u; -var guard10 : bool = true; +var guard10 = true; if (false) { var_1 = 2u; guard10 = false; @@ -7320,7 +7320,7 @@ TEST_F(SpvParserCFGTest, EmitBody_IfBreak_FromThenWithForward_FromElseWithForwar auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); auto* expect = R"(var_1 = 1u; -var guard10 : bool = true; +var guard10 = true; if (false) { var_1 = 2u; if (true) { diff --git a/src/tint/reader/spirv/function_composite_test.cc b/src/tint/reader/spirv/function_composite_test.cc index cb8bc4287b..442d6fc171 100644 --- a/src/tint/reader/spirv/function_composite_test.cc +++ b/src/tint/reader/spirv/function_composite_test.cc @@ -95,10 +95,9 @@ TEST_F(SpvParserTest_Composite_Construct, Vector) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr(R"(let x_1 : vec2u = vec2u(10u, 20u); -let x_2 : vec2i = vec2i(30i, 40i); -let x_3 : vec2f = vec2f(50.0f, 60.0f); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_1 = vec2u(10u, 20u); +let x_2 = vec2i(30i, 40i); +let x_3 = vec2f(50.0f, 60.0f); )")); } @@ -115,7 +114,7 @@ TEST_F(SpvParserTest_Composite_Construct, Matrix) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : mat3x2f = mat3x2f(" + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = mat3x2f(" "vec2f(50.0f, 60.0f), " "vec2f(60.0f, 50.0f), " "vec2f(70.0f, 70.0f));")); @@ -135,7 +134,7 @@ TEST_F(SpvParserTest_Composite_Construct, Array) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : array = array(10u, 20u, 3u, 4u, 5u);")); + HasSubstr("let x_1 = array(10u, 20u, 3u, 4u, 5u);")); } TEST_F(SpvParserTest_Composite_Construct, Struct) { @@ -152,7 +151,7 @@ TEST_F(SpvParserTest_Composite_Construct, Struct) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : S = S(vec2f(50.0f, 60.0f), 5u, 30i);")); + HasSubstr("let x_1 = S(vec2f(50.0f, 60.0f), 5u, 30i);")); } TEST_F(SpvParserTest_Composite_Construct, ConstantComposite_Struct_NoDeduplication) { @@ -177,8 +176,8 @@ TEST_F(SpvParserTest_Composite_Construct, ConstantComposite_Struct_NoDeduplicati auto ast_body = fe.ast_body(); const auto got = test::ToString(p->program(), ast_body); const auto expected = std::string( - R"(let x_2 : S_1 = S_1(10u); -let x_3 : S_2 = S_2(10u); + R"(let x_2 = S_1(10u); +let x_3 = S_2(10u); return; )"); EXPECT_EQ(got, expected) << got; @@ -200,7 +199,7 @@ TEST_F(SpvParserTest_CompositeExtract, Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : f32 = vec2f(50.0f, 60.0f).y;")); + HasSubstr("let x_1 = vec2f(50.0f, 60.0f).y;")); } TEST_F(SpvParserTest_CompositeExtract, Vector_IndexTooBigError) { @@ -237,7 +236,7 @@ TEST_F(SpvParserTest_CompositeExtract, Matrix) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_2 : vec2f = x_1[2u];")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_2 = x_1[2u];")); } TEST_F(SpvParserTest_CompositeExtract, Matrix_IndexTooBigError) { @@ -278,7 +277,7 @@ TEST_F(SpvParserTest_CompositeExtract, Matrix_Vector) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_2 : f32 = x_1[2u].y;")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_2 = x_1[2u].y;")); } TEST_F(SpvParserTest_CompositeExtract, Array) { @@ -298,7 +297,7 @@ TEST_F(SpvParserTest_CompositeExtract, Array) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_2 : u32 = x_1[3u];")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_2 = x_1[3u];")); } TEST_F(SpvParserTest_CompositeExtract, RuntimeArray_IsError) { @@ -338,7 +337,7 @@ TEST_F(SpvParserTest_CompositeExtract, Struct) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_2 : i32 = x_1.field2;")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_2 = x_1.field2;")); } TEST_F(SpvParserTest_CompositeExtract, Struct_DifferOnlyInMemberName) { @@ -378,9 +377,9 @@ TEST_F(SpvParserTest_CompositeExtract, Struct_DifferOnlyInMemberName) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto got = fe.ast_body(); auto program = p->program(); - EXPECT_THAT(test::ToString(program, got), HasSubstr("let x_2 : u32 = x_1.algo;")) + EXPECT_THAT(test::ToString(program, got), HasSubstr("let x_2 = x_1.algo;")) << test::ToString(program, got); - EXPECT_THAT(test::ToString(program, got), HasSubstr("let x_4 : u32 = x_3.rithm;")) + EXPECT_THAT(test::ToString(program, got), HasSubstr("let x_4 = x_3.rithm;")) << test::ToString(program, got); p->SkipDumpingPending("crbug.com/tint/863"); } @@ -426,7 +425,7 @@ TEST_F(SpvParserTest_CompositeExtract, Struct_Array_Matrix_Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_2 : f32 = x_1.field1[2u][0u].y;")); + HasSubstr("let x_2 = x_1.field1[2u][0u].y;")); } using SpvParserTest_CompositeInsert = SpvParserTest; @@ -446,9 +445,9 @@ TEST_F(SpvParserTest_CompositeInsert, Vector) { auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); const auto* expected = - R"(var x_1_1 : vec2f = vec2f(50.0f, 60.0f); + R"(var x_1_1 = vec2f(50.0f, 60.0f); x_1_1.y = 70.0f; -let x_1 : vec2f = x_1_1; +let x_1 = x_1_1; return; )"; EXPECT_EQ(got, expected); @@ -489,9 +488,9 @@ TEST_F(SpvParserTest_CompositeInsert, Matrix) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body_str = test::ToString(p->program(), ast_body); - EXPECT_THAT(body_str, HasSubstr(R"(var x_2_1 : mat3x2f = x_1; + EXPECT_THAT(body_str, HasSubstr(R"(var x_2_1 = x_1; x_2_1[2u] = vec2f(50.0f, 60.0f); -let x_2 : mat3x2f = x_2_1; +let x_2 = x_2_1; )")) << body_str; } @@ -534,9 +533,9 @@ TEST_F(SpvParserTest_CompositeInsert, Matrix_Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body_str = test::ToString(p->program(), ast_body); - EXPECT_THAT(body_str, HasSubstr(R"(var x_2_1 : mat3x2f = x_1; + EXPECT_THAT(body_str, HasSubstr(R"(var x_2_1 = x_1; x_2_1[2u] = vec2f(50.0f, 60.0f); -let x_2 : mat3x2f = x_2_1; +let x_2 = x_2_1; return; )")) << body_str; } @@ -559,9 +558,9 @@ TEST_F(SpvParserTest_CompositeInsert, Array) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body_str = test::ToString(p->program(), ast_body); - EXPECT_THAT(body_str, HasSubstr(R"(var x_2_1 : array = x_1; + EXPECT_THAT(body_str, HasSubstr(R"(var x_2_1 = x_1; x_2_1[3u] = 20u; -let x_2 : array = x_2_1; +let x_2 = x_2_1; )")) << body_str; } @@ -604,10 +603,10 @@ TEST_F(SpvParserTest_CompositeInsert, Struct) { auto ast_body = fe.ast_body(); auto body_str = test::ToString(p->program(), ast_body); EXPECT_THAT(body_str, HasSubstr(R"(var x_36 : S; -let x_1 : S = x_36; -var x_2_1 : S = x_1; +let x_1 = x_36; +var x_2_1 = x_1; x_2_1.field2 = 30i; -let x_2 : S = x_2_1; +let x_2 = x_2_1; )")) << body_str; } @@ -654,14 +653,14 @@ TEST_F(SpvParserTest_CompositeInsert, Struct_DifferOnlyInMemberName) { const auto got = test::ToString(p->program(), ast_body); const std::string expected = R"(var var0 : S; var var1 : S_1; -let x_1 : S = var0; -var x_2_1 : S = x_1; +let x_1 = var0; +var x_2_1 = x_1; x_2_1.algo = 10u; -let x_2 : S = x_2_1; -let x_3 : S_1 = var1; -var x_4_1 : S_1 = x_3; +let x_2 = x_2_1; +let x_3 = var1; +var x_4_1 = x_3; x_4_1.rithm = 11u; -let x_4 : S_1 = x_4_1; +let x_4 = x_4_1; return; )"; EXPECT_EQ(got, expected) << got; @@ -709,10 +708,10 @@ TEST_F(SpvParserTest_CompositeInsert, Struct_Array_Matrix_Vector) { auto ast_body = fe.ast_body(); auto body_str = test::ToString(p->program(), ast_body); EXPECT_THAT(body_str, HasSubstr(R"(var x_38 : S_1; -let x_1 : S_1 = x_38; -var x_2_1 : S_1 = x_1; +let x_1 = x_38; +var x_2_1 = x_1; x_2_1.field1[2u][0u].y = 70.0f; -let x_2 : S_1 = x_2_1; +let x_2 = x_2_1; )")) << body_str; } @@ -732,8 +731,8 @@ TEST_F(SpvParserTest_CopyObject, Scalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_1 : u32 = 3u; -let x_2 : u32 = x_1; + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_1 = 3u; +let x_2 = x_1; )")); } @@ -754,9 +753,9 @@ TEST_F(SpvParserTest_CopyObject, Pointer) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr(R"(let x_1 : ptr = &(x_10); -let x_2 : ptr = x_1; + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"( x_10 : u32; +let x_1 = &(x_10); +let x_2 = x_1; )")); } @@ -780,7 +779,7 @@ TEST_F(SpvParserTest_VectorShuffle, FunctionScopeOperands_UseBoth) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_10 : vec4u = vec4u(x_2.y, x_2.x, x_1.y, x_1.x);")); + HasSubstr("let x_10 = vec4u(x_2.y, x_2.x, x_1.y, x_1.x);")); } TEST_F(SpvParserTest_VectorShuffle, ConstantOperands_UseBoth) { @@ -797,7 +796,7 @@ TEST_F(SpvParserTest_VectorShuffle, ConstantOperands_UseBoth) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_10 : vec4u = vec4u(" + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_10 = vec4u(" "vec2u(4u, 3u).y, " "vec2u(4u, 3u).x, " "vec2u(3u, 4u).y, " @@ -819,8 +818,7 @@ TEST_F(SpvParserTest_VectorShuffle, ConstantOperands_AllOnesMapToNull) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_10 : vec2u = vec2u(0u, x_1.y);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_10 = vec2u(0u, x_1.y);")); } TEST_F(SpvParserTest_VectorShuffle, FunctionScopeOperands_MixedInputOperandSizes) { @@ -842,7 +840,7 @@ TEST_F(SpvParserTest_VectorShuffle, FunctionScopeOperands_MixedInputOperandSizes EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_10 : vec2u = vec2u(x_1.y, x_3.z);")); + HasSubstr("let x_10 = vec2u(x_1.y, x_3.z);")); } TEST_F(SpvParserTest_VectorShuffle, IndexTooBig_IsError) { @@ -880,7 +878,7 @@ TEST_F(SpvParserTest_VectorExtractDynamic, SignedIndex) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto got = test::ToString(p->program(), ast_body); - EXPECT_THAT(got, HasSubstr("let x_10 : u32 = x_1[x_2];")) << got; + EXPECT_THAT(got, HasSubstr("let x_10 = x_1[x_2];")) << got; } TEST_F(SpvParserTest_VectorExtractDynamic, UnsignedIndex) { @@ -900,7 +898,7 @@ TEST_F(SpvParserTest_VectorExtractDynamic, UnsignedIndex) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto got = test::ToString(p->program(), ast_body); - EXPECT_THAT(got, HasSubstr("let x_10 : u32 = x_1[x_2];")) << got; + EXPECT_THAT(got, HasSubstr("let x_10 = x_1[x_2];")) << got; } using SpvParserTest_VectorInsertDynamic = SpvParserTest; @@ -923,9 +921,9 @@ TEST_F(SpvParserTest_VectorInsertDynamic, Sample) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto got = test::ToString(p->program(), ast_body); - EXPECT_THAT(got, HasSubstr(R"(var x_10_1 : vec2u = x_1; + EXPECT_THAT(got, HasSubstr(R"(var x_10_1 = x_1; x_10_1[x_3] = x_2; -let x_10 : vec2u = x_10_1; +let x_10 = x_10_1; )")) << got << assembly; } diff --git a/src/tint/reader/spirv/function_conversion_test.cc b/src/tint/reader/spirv/function_conversion_test.cc index 602928a44c..d8d11fd619 100644 --- a/src/tint/reader/spirv/function_conversion_test.cc +++ b/src/tint/reader/spirv/function_conversion_test.cc @@ -83,7 +83,7 @@ TEST_F(SpvUnaryConversionTest, Bitcast_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : u32 = bitcast(50.0f);")); + HasSubstr("let x_1 = bitcast(50.0f);")); } TEST_F(SpvUnaryConversionTest, Bitcast_Vector) { @@ -100,7 +100,7 @@ TEST_F(SpvUnaryConversionTest, Bitcast_Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2f = bitcast(vec2u(10u, 20u));")); + HasSubstr("let x_1 = bitcast(vec2u(10u, 20u));")); } TEST_F(SpvUnaryConversionTest, ConvertSToF_BadArg) { @@ -209,7 +209,7 @@ TEST_F(SpvUnaryConversionTest, ConvertSToF_Scalar_FromSigned) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : f32 = f32(x_30);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = f32(x_30);")); } TEST_F(SpvUnaryConversionTest, ConvertSToF_Scalar_FromUnsigned) { @@ -227,7 +227,7 @@ TEST_F(SpvUnaryConversionTest, ConvertSToF_Scalar_FromUnsigned) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : f32 = f32(bitcast(x_30));")); + HasSubstr("let x_1 = f32(bitcast(x_30));")); } TEST_F(SpvUnaryConversionTest, ConvertSToF_Vector_FromSigned) { @@ -244,8 +244,7 @@ TEST_F(SpvUnaryConversionTest, ConvertSToF_Vector_FromSigned) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2f = vec2f(x_30);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = vec2f(x_30);")); } TEST_F(SpvUnaryConversionTest, ConvertSToF_Vector_FromUnsigned) { @@ -263,7 +262,7 @@ TEST_F(SpvUnaryConversionTest, ConvertSToF_Vector_FromUnsigned) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2f = vec2f(bitcast(x_30));")); + HasSubstr("let x_1 = vec2f(bitcast(x_30));")); } TEST_F(SpvUnaryConversionTest, ConvertUToF_Scalar_BadArgType) { @@ -313,7 +312,7 @@ TEST_F(SpvUnaryConversionTest, ConvertUToF_Scalar_FromSigned) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : f32 = f32(bitcast(x_30));")); + HasSubstr("let x_1 = f32(bitcast(x_30));")); } TEST_F(SpvUnaryConversionTest, ConvertUToF_Scalar_FromUnsigned) { @@ -330,7 +329,7 @@ TEST_F(SpvUnaryConversionTest, ConvertUToF_Scalar_FromUnsigned) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : f32 = f32(x_30);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = f32(x_30);")); } TEST_F(SpvUnaryConversionTest, ConvertUToF_Vector_FromSigned) { @@ -348,7 +347,7 @@ TEST_F(SpvUnaryConversionTest, ConvertUToF_Vector_FromSigned) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2f = vec2f(bitcast(x_30));")); + HasSubstr("let x_1 = vec2f(bitcast(x_30));")); } TEST_F(SpvUnaryConversionTest, ConvertUToF_Vector_FromUnsigned) { @@ -365,8 +364,7 @@ TEST_F(SpvUnaryConversionTest, ConvertUToF_Vector_FromUnsigned) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2f = vec2f(x_30);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = vec2f(x_30);")); } TEST_F(SpvUnaryConversionTest, ConvertFToS_Scalar_BadArgType) { @@ -415,7 +413,7 @@ TEST_F(SpvUnaryConversionTest, ConvertFToS_Scalar_ToSigned) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : i32 = i32(x_30);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = i32(x_30);")); } TEST_F(SpvUnaryConversionTest, ConvertFToS_Scalar_ToUnsigned) { @@ -433,7 +431,7 @@ TEST_F(SpvUnaryConversionTest, ConvertFToS_Scalar_ToUnsigned) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : u32 = bitcast(i32(x_30));")); + HasSubstr("let x_1 = bitcast(i32(x_30));")); } TEST_F(SpvUnaryConversionTest, ConvertFToS_Vector_ToSigned) { @@ -450,8 +448,7 @@ TEST_F(SpvUnaryConversionTest, ConvertFToS_Vector_ToSigned) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2i = vec2i(x_30);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = vec2i(x_30);")); } TEST_F(SpvUnaryConversionTest, ConvertFToS_Vector_ToUnsigned) { @@ -469,7 +466,7 @@ TEST_F(SpvUnaryConversionTest, ConvertFToS_Vector_ToUnsigned) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2u = bitcast(vec2i(x_30));")); + HasSubstr("let x_1 = bitcast(vec2i(x_30));")); } TEST_F(SpvUnaryConversionTest, ConvertFToU_Scalar_BadArgType) { @@ -534,7 +531,7 @@ TEST_F(SpvUnaryConversionTest, ConvertFToU_Scalar_ToUnsigned) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : u32 = u32(x_30);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = u32(x_30);")); } TEST_F(SpvUnaryConversionTest, ConvertFToU_Vector_ToSigned_IsError) { @@ -567,8 +564,7 @@ TEST_F(SpvUnaryConversionTest, ConvertFToU_Vector_ToUnsigned) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2u = vec2u(x_30);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = vec2u(x_30);")); } TEST_F(SpvUnaryConversionTest, ConvertFToU_HoistedValue) { @@ -609,7 +605,7 @@ OpFunctionEnd auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_82 : u32 = u32(x_600);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_82 = u32(x_600);")); } // TODO(dneto): OpSConvert // only if multiple widths diff --git a/src/tint/reader/spirv/function_decl_test.cc b/src/tint/reader/spirv/function_decl_test.cc index 59121a3c12..b14b457fb7 100644 --- a/src/tint/reader/spirv/function_decl_test.cc +++ b/src/tint/reader/spirv/function_decl_test.cc @@ -186,7 +186,7 @@ TEST_F(SpvParserTest, Emit_FunctionDecl_ParamPtrTexture_ParamPtrSampler) { auto got = test::ToString(p->program()); std::string expect = R"(fn x_200(x_14 : texture_2d, x_15 : sampler) { - let x_20 : vec4f = textureSample(x_14, x_15, vec2f()); + let x_20 = textureSample(x_14, x_15, vec2f()); return; } )"; @@ -216,7 +216,7 @@ TEST_F(SpvParserTest, Emit_FunctionDecl_ParamTexture_ParamSampler) { auto got = test::ToString(p->program()); std::string expect = R"(fn x_200(x_14 : texture_2d, x_15 : sampler) { - let x_20 : vec4f = textureSample(x_14, x_15, vec2f()); + let x_20 = textureSample(x_14, x_15, vec2f()); return; } )"; diff --git a/src/tint/reader/spirv/function_glsl_std_450_test.cc b/src/tint/reader/spirv/function_glsl_std_450_test.cc index 506c8d4aa2..f480f69e4e 100644 --- a/src/tint/reader/spirv/function_glsl_std_450_test.cc +++ b/src/tint/reader/spirv/function_glsl_std_450_test.cc @@ -201,7 +201,7 @@ TEST_P(SpvParserTest_GlslStd450_Float_Floating, Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : f32 = " + GetParam().wgsl_func + "(f1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(f1);")) << body; } TEST_P(SpvParserTest_GlslStd450_Float_Floating, Vector) { @@ -217,7 +217,7 @@ TEST_P(SpvParserTest_GlslStd450_Float_Floating, Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : f32 = " + GetParam().wgsl_func + "(v2f1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(v2f1);")) << body; } TEST_P(SpvParserTest_GlslStd450_Float_FloatingFloating, Scalar) { @@ -233,7 +233,7 @@ TEST_P(SpvParserTest_GlslStd450_Float_FloatingFloating, Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : f32 = " + GetParam().wgsl_func + "(f1, f2);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(f1, f2);")) << body; } TEST_P(SpvParserTest_GlslStd450_Float_FloatingFloating, Vector) { @@ -249,8 +249,7 @@ TEST_P(SpvParserTest_GlslStd450_Float_FloatingFloating, Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : f32 = " + GetParam().wgsl_func + "(v2f1, v2f2);")) - << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(v2f1, v2f2);")) << body; } TEST_P(SpvParserTest_GlslStd450_Floating_Floating, Scalar) { @@ -266,7 +265,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_Floating, Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : f32 = " + GetParam().wgsl_func + "(f1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(f1);")) << body; } TEST_P(SpvParserTest_GlslStd450_Floating_Floating, Vector) { @@ -282,7 +281,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_Floating, Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2f = " + GetParam().wgsl_func + "(v2f1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(v2f1);")) << body; } TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloating, Scalar) { @@ -298,7 +297,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloating, Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : f32 = " + GetParam().wgsl_func + "(f1, f2);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(f1, f2);")) << body; } TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloating, Vector) { @@ -314,8 +313,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloating, Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2f = " + GetParam().wgsl_func + "(v2f1, v2f2);")) - << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(v2f1, v2f2);")) << body; } TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloatingFloating, Scalar) { @@ -331,8 +329,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloatingFloating, Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : f32 = " + GetParam().wgsl_func + "(f1, f2, f3);")) - << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(f1, f2, f3);")) << body; } TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloatingFloating, Vector) { @@ -349,8 +346,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloatingFloating, Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, - HasSubstr("let x_1 : vec2f = " + GetParam().wgsl_func + "(v2f1, v2f2, v2f3);")) + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(v2f1, v2f2, v2f3);")) << body; } @@ -367,7 +363,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingInting, Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : f32 = " + GetParam().wgsl_func + "(f1, i1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(f1, i1);")) << body; } TEST_P(SpvParserTest_GlslStd450_Floating_FloatingInting, Vector) { @@ -384,8 +380,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingInting, Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2f = " + GetParam().wgsl_func + "(v2f1, v2i1);")) - << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(v2f1, v2i1);")) << body; } TEST_P(SpvParserTest_GlslStd450_Float3_Float3Float3, Samples) { @@ -402,8 +397,7 @@ TEST_P(SpvParserTest_GlslStd450_Float3_Float3Float3, Samples) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec3f = " + GetParam().wgsl_func + "(v3f1, v3f2);")) - << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(v3f1, v3f2);")) << body; } INSTANTIATE_TEST_SUITE_P(Samples, @@ -488,7 +482,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_Inting, Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : i32 = " + GetParam().wgsl_func + "(i1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(i1);")) << body; } TEST_P(SpvParserTest_GlslStd450_Inting_Inting_SignednessCoercing, Scalar_UnsignedArg) { @@ -505,7 +499,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_Inting_SignednessCoercing, Scalar_Unsigne EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : i32 = " + GetParam().wgsl_func + "(bitcast(u1));")) + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(bitcast(u1));")) << body; } @@ -523,7 +517,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_Inting_SignednessCoercing, Scalar_Unsigne EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : u32 = bitcast(" + GetParam().wgsl_func + "(i1));")) + EXPECT_THAT(body, HasSubstr("let x_1 = bitcast(" + GetParam().wgsl_func + "(i1));")) << body; } @@ -541,7 +535,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_Inting, Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2i = " + GetParam().wgsl_func + "(v2i1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(v2i1);")) << body; } TEST_P(SpvParserTest_GlslStd450_Inting_Inting_SignednessCoercing, Vector_UnsignedArg) { @@ -558,8 +552,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_Inting_SignednessCoercing, Vector_Unsigne EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, - HasSubstr("let x_1 : vec2i = " + GetParam().wgsl_func + "(bitcast(v2u1));")) + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(bitcast(v2u1));")) << body; } @@ -577,8 +570,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_Inting_SignednessCoercing, Vector_Unsigne EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, - HasSubstr("let x_1 : vec2u = bitcast(" + GetParam().wgsl_func + "(v2i1));")) + EXPECT_THAT(body, HasSubstr("let x_1 = bitcast(" + GetParam().wgsl_func + "(v2i1));")) << body; } @@ -596,7 +588,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_IntingInting, Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : i32 = " + GetParam().wgsl_func + "(i1, i2);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(i1, i2);")) << body; } TEST_P(SpvParserTest_GlslStd450_Inting_IntingInting, Vector) { @@ -613,8 +605,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_IntingInting, Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2i = " + GetParam().wgsl_func + "(v2i1, v2i2);")) - << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(v2i1, v2i2);")) << body; } TEST_P(SpvParserTest_GlslStd450_Inting_IntingIntingInting, Scalar) { @@ -631,8 +622,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_IntingIntingInting, Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : i32 = " + GetParam().wgsl_func + "(i1, i2, i3);")) - << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(i1, i2, i3);")) << body; } TEST_P(SpvParserTest_GlslStd450_Inting_IntingIntingInting, Vector) { @@ -649,8 +639,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_IntingIntingInting, Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, - HasSubstr("let x_1 : vec2i = " + GetParam().wgsl_func + "(v2i1, v2i2, v2i3);")) + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(v2i1, v2i2, v2i3);")) << body; } @@ -688,7 +677,7 @@ TEST_P(SpvParserTest_GlslStd450_Uinting_Uinting, Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : u32 = " + GetParam().wgsl_func + "(u1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(u1);")) << body; } TEST_P(SpvParserTest_GlslStd450_Uinting_Uinting, Vector) { @@ -705,7 +694,7 @@ TEST_P(SpvParserTest_GlslStd450_Uinting_Uinting, Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2u = " + GetParam().wgsl_func + "(v2u1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(v2u1);")) << body; } TEST_P(SpvParserTest_GlslStd450_Uinting_UintingUinting, Scalar) { @@ -721,7 +710,7 @@ TEST_P(SpvParserTest_GlslStd450_Uinting_UintingUinting, Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : u32 = " + GetParam().wgsl_func + "(u1, u2);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(u1, u2);")) << body; } TEST_P(SpvParserTest_GlslStd450_Uinting_UintingUinting, Vector) { @@ -738,8 +727,7 @@ TEST_P(SpvParserTest_GlslStd450_Uinting_UintingUinting, Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2u = " + GetParam().wgsl_func + "(v2u1, v2u2);")) - << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(v2u1, v2u2);")) << body; } TEST_P(SpvParserTest_GlslStd450_Uinting_UintingUintingUinting, Scalar) { @@ -755,8 +743,7 @@ TEST_P(SpvParserTest_GlslStd450_Uinting_UintingUintingUinting, Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : u32 = " + GetParam().wgsl_func + "(u1, u2, u3);")) - << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(u1, u2, u3);")) << body; } TEST_P(SpvParserTest_GlslStd450_Uinting_UintingUintingUinting, Vector) { @@ -773,8 +760,7 @@ TEST_P(SpvParserTest_GlslStd450_Uinting_UintingUintingUinting, Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, - HasSubstr("let x_1 : vec2u = " + GetParam().wgsl_func + "(v2u1, v2u2, v2u3);")) + EXPECT_THAT(body, HasSubstr("let x_1 = " + GetParam().wgsl_func + "(v2u1, v2u2, v2u3);")) << body; } @@ -809,7 +795,7 @@ TEST_F(SpvParserTest, Normalize_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : f32 = 1.0f;")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = 1.0f;")) << body; } TEST_F(SpvParserTest, Normalize_Vector2) { @@ -825,7 +811,7 @@ TEST_F(SpvParserTest, Normalize_Vector2) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec2f = normalize(v2f1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = normalize(v2f1);")) << body; } TEST_F(SpvParserTest, Normalize_Vector3) { @@ -841,7 +827,7 @@ TEST_F(SpvParserTest, Normalize_Vector3) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec3f = normalize(v3f1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = normalize(v3f1);")) << body; } TEST_F(SpvParserTest, Normalize_Vector4) { @@ -857,7 +843,7 @@ TEST_F(SpvParserTest, Normalize_Vector4) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : vec4f = normalize(v4f1);")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 = normalize(v4f1);")) << body; } // Check that we convert signedness of operands and result type. @@ -876,9 +862,8 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_SAbs) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr(R"(let x_1 : u32 = bitcast(abs(bitcast(u1)));)")) << body; - EXPECT_THAT(body, HasSubstr(R"(let x_2 : vec2u = bitcast(abs(bitcast(v2u1)));)")) - << body; + EXPECT_THAT(body, HasSubstr(R"(let x_1 = bitcast(abs(bitcast(u1)));)")) << body; + EXPECT_THAT(body, HasSubstr(R"(let x_2 = bitcast(abs(bitcast(v2u1)));)")) << body; } TEST_F(SpvParserTest, RectifyOperandsAndResult_SMax) { @@ -894,14 +879,12 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_SMax) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT( - body, - HasSubstr(R"(let x_1 : u32 = bitcast(max(bitcast(u1), bitcast(u2)));)")) + EXPECT_THAT(body, + HasSubstr(R"(let x_1 = bitcast(max(bitcast(u1), bitcast(u2)));)")) << body; EXPECT_THAT( body, - HasSubstr( - R"(let x_2 : vec2u = bitcast(max(bitcast(v2u1), bitcast(v2u2)));)")) + HasSubstr(R"(let x_2 = bitcast(max(bitcast(v2u1), bitcast(v2u2)));)")) << body; } @@ -918,14 +901,12 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_SMin) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT( - body, - HasSubstr(R"(let x_1 : u32 = bitcast(min(bitcast(u1), bitcast(u2)));)")) + EXPECT_THAT(body, + HasSubstr(R"(let x_1 = bitcast(min(bitcast(u1), bitcast(u2)));)")) << body; EXPECT_THAT( body, - HasSubstr( - R"(let x_2 : vec2u = bitcast(min(bitcast(v2u1), bitcast(v2u2)));)")) + HasSubstr(R"(let x_2 = bitcast(min(bitcast(v2u1), bitcast(v2u2)));)")) << body; } @@ -944,13 +925,12 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_SClamp) { auto body = test::ToString(p->program(), ast_body); EXPECT_THAT( body, - HasSubstr( - R"(let x_1 : u32 = bitcast(clamp(bitcast(u1), i2, bitcast(u3)));)")) + HasSubstr(R"(let x_1 = bitcast(clamp(bitcast(u1), i2, bitcast(u3)));)")) << body; EXPECT_THAT( body, HasSubstr( - R"(let x_2 : vec2u = bitcast(clamp(bitcast(v2u1), v2i2, bitcast(v2u3)));)")) + R"(let x_2 = bitcast(clamp(bitcast(v2u1), v2i2, bitcast(v2u3)));)")) << body; } @@ -967,14 +947,12 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_UMax) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT( - body, - HasSubstr(R"(let x_1 : i32 = bitcast(max(bitcast(i1), bitcast(i2)));)")) + EXPECT_THAT(body, + HasSubstr(R"(let x_1 = bitcast(max(bitcast(i1), bitcast(i2)));)")) << body; EXPECT_THAT( body, - HasSubstr( - R"(let x_2 : vec2i = bitcast(max(bitcast(v2i1), bitcast(v2i2)));)")) + HasSubstr(R"(let x_2 = bitcast(max(bitcast(v2i1), bitcast(v2i2)));)")) << body; } @@ -991,14 +969,12 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_UMin) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT( - body, - HasSubstr(R"(let x_1 : i32 = bitcast(min(bitcast(i1), bitcast(i2)));)")) + EXPECT_THAT(body, + HasSubstr(R"(let x_1 = bitcast(min(bitcast(i1), bitcast(i2)));)")) << body; EXPECT_THAT( body, - HasSubstr( - R"(let x_2 : vec2i = bitcast(min(bitcast(v2i1), bitcast(v2i2)));)")) + HasSubstr(R"(let x_2 = bitcast(min(bitcast(v2i1), bitcast(v2i2)));)")) << body; } @@ -1017,13 +993,12 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_UClamp) { auto body = test::ToString(p->program(), ast_body); EXPECT_THAT( body, - HasSubstr( - R"(let x_1 : i32 = bitcast(clamp(bitcast(i1), u2, bitcast(i3)));)")) + HasSubstr(R"(let x_1 = bitcast(clamp(bitcast(i1), u2, bitcast(i3)));)")) << body; EXPECT_THAT( body, HasSubstr( - R"(let x_2 : vec2i = bitcast(clamp(bitcast(v2i1), v2u2, bitcast(v2i3)));)")) + R"(let x_2 = bitcast(clamp(bitcast(v2i1), v2u2, bitcast(v2i3)));)")) << body; } @@ -1048,10 +1023,10 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_FindILsb) { auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); EXPECT_THAT(body, HasSubstr(R"( -let x_1 : u32 = bitcast(firstTrailingBit(i1)); -let x_2 : vec2u = bitcast(firstTrailingBit(v2i1)); -let x_3 : i32 = bitcast(firstTrailingBit(u1)); -let x_4 : vec2i = bitcast(firstTrailingBit(v2u1));)")) +let x_1 = bitcast(firstTrailingBit(i1)); +let x_2 = bitcast(firstTrailingBit(v2i1)); +let x_3 = bitcast(firstTrailingBit(u1)); +let x_4 = bitcast(firstTrailingBit(v2u1));)")) << body; } @@ -1094,14 +1069,14 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_FindSMsb) { auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); EXPECT_THAT(body, HasSubstr(R"( -let x_1 : i32 = firstLeadingBit(i1); -let x_2 : vec2i = firstLeadingBit(v2i1); -let x_3 : u32 = bitcast(firstLeadingBit(i1)); -let x_4 : vec2u = bitcast(firstLeadingBit(v2i1)); -let x_5 : i32 = firstLeadingBit(bitcast(u1)); -let x_6 : vec2i = firstLeadingBit(bitcast(v2u1)); -let x_7 : u32 = bitcast(firstLeadingBit(bitcast(u1))); -let x_8 : vec2u = bitcast(firstLeadingBit(bitcast(v2u1))); +let x_1 = firstLeadingBit(i1); +let x_2 = firstLeadingBit(v2i1); +let x_3 = bitcast(firstLeadingBit(i1)); +let x_4 = bitcast(firstLeadingBit(v2i1)); +let x_5 = firstLeadingBit(bitcast(u1)); +let x_6 = firstLeadingBit(bitcast(v2u1)); +let x_7 = bitcast(firstLeadingBit(bitcast(u1))); +let x_8 = bitcast(firstLeadingBit(bitcast(v2u1))); )")) << body; } @@ -1144,14 +1119,14 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_FindUMsb) { auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); EXPECT_THAT(body, HasSubstr(R"( -let x_1 : i32 = bitcast(firstLeadingBit(bitcast(i1))); -let x_2 : vec2i = bitcast(firstLeadingBit(bitcast(v2i1))); -let x_3 : u32 = firstLeadingBit(bitcast(i1)); -let x_4 : vec2u = firstLeadingBit(bitcast(v2i1)); -let x_5 : i32 = bitcast(firstLeadingBit(u1)); -let x_6 : vec2i = bitcast(firstLeadingBit(v2u1)); -let x_7 : u32 = firstLeadingBit(u1); -let x_8 : vec2u = firstLeadingBit(v2u1); +let x_1 = bitcast(firstLeadingBit(bitcast(i1))); +let x_2 = bitcast(firstLeadingBit(bitcast(v2i1))); +let x_3 = firstLeadingBit(bitcast(i1)); +let x_4 = firstLeadingBit(bitcast(v2i1)); +let x_5 = bitcast(firstLeadingBit(u1)); +let x_6 = bitcast(firstLeadingBit(v2u1)); +let x_7 = firstLeadingBit(u1); +let x_8 = firstLeadingBit(v2u1); )")) << body; } @@ -1183,7 +1158,7 @@ TEST_P(SpvParserTest_GlslStd450_DataPacking, Valid) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : u32 = " + param.wgsl_func + "(v" + + EXPECT_THAT(body, HasSubstr("let x_1 = " + param.wgsl_func + "(v" + std::to_string(param.vec_size) + "f1);")) << body; } @@ -1214,11 +1189,7 @@ TEST_P(SpvParserTest_GlslStd450_DataUnpacking, Valid) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, - HasSubstr("let x_1 : " + std::string(param.vec_size == 2 ? "vec2f" : "vec4f") + - - +" = " + param.wgsl_func + "(u1);")) - << body; + EXPECT_THAT(body, HasSubstr("let x_1 = " + param.wgsl_func + "(u1);")) << body; } INSTANTIATE_TEST_SUITE_P(Samples, @@ -1242,7 +1213,7 @@ TEST_F(SpvParserTest, GlslStd450_Refract_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - const auto* expected = R"(let x_1 : f32 = refract(vec2f(f1, 0.0f), vec2f(f2, 0.0f), f3).x;)"; + const auto* expected = R"(let x_1 = refract(vec2f(f1, 0.0f), vec2f(f2, 0.0f), f3).x;)"; EXPECT_THAT(body, HasSubstr(expected)) << body; } @@ -1259,7 +1230,7 @@ TEST_F(SpvParserTest, GlslStd450_Refract_Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - const auto* expected = R"(let x_1 : vec2f = refract(v2f1, v2f2, f3);)"; + const auto* expected = R"(let x_1 = refract(v2f1, v2f2, f3);)"; EXPECT_THAT(body, HasSubstr(expected)) << body; } @@ -1280,7 +1251,7 @@ TEST_F(SpvParserTest, GlslStd450_FaceForward_Scalar) { // The %99 sum only has one use. Ensure it is evaluated only once by // making a let-declaration for it, since it is the normal operand to // the builtin function, and code generation uses it twice. - const auto* expected = R"(let x_1 : f32 = select(-(x_99), x_99, ((f2 * f3) < 0.0f));)"; + const auto* expected = R"(let x_1 = select(-(x_99), x_99, ((f2 * f3) < 0.0f));)"; EXPECT_THAT(body, HasSubstr(expected)) << body; } @@ -1298,7 +1269,7 @@ TEST_F(SpvParserTest, GlslStd450_FaceForward_Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - const auto* expected = R"(let x_1 : vec2f = faceForward(v2f1, v2f2, v2f3);)"; + const auto* expected = R"(let x_1 = faceForward(v2f1, v2f2, v2f3);)"; EXPECT_THAT(body, HasSubstr(expected)) << body; } @@ -1320,7 +1291,7 @@ TEST_F(SpvParserTest, GlslStd450_Reflect_Scalar) { // The %99 sum only has one use. Ensure it is evaluated only once by // making a let-declaration for it, since it is the normal operand to // the builtin function, and code generation uses it twice. - const auto* expected = R"(let x_1 : f32 = (x_98 - (2.0f * (x_99 * (x_99 * x_98))));)"; + const auto* expected = R"(let x_1 = (x_98 - (2.0f * (x_99 * (x_99 * x_98))));)"; EXPECT_THAT(body, HasSubstr(expected)) << body; } @@ -1340,9 +1311,9 @@ TEST_F(SpvParserTest, GlslStd450_Reflect_Vector) { auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); const auto* expected = R"( -let x_98 : vec2f = (v2f1 + v2f1); -let x_99 : vec2f = (v2f2 + v2f2); -let x_1 : vec2f = reflect(x_98, x_99); +let x_98 = (v2f1 + v2f1); +let x_99 = (v2f2 + v2f2); +let x_1 = reflect(x_98, x_99); )"; EXPECT_THAT(body, HasSubstr(expected)) << body; @@ -1361,7 +1332,7 @@ TEST_F(SpvParserTest, GlslStd450_Ldexp_Scalar_Float_Uint) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - const auto* expected = "let x_1 : f32 = ldexp(f1, i32(u1));"; + const auto* expected = "let x_1 = ldexp(f1, i32(u1));"; EXPECT_THAT(body, HasSubstr(expected)) << body; } @@ -1378,7 +1349,7 @@ TEST_F(SpvParserTest, GlslStd450_Ldexp_Vector_Floatvec_Uintvec) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - const auto* expected = "let x_1 : vec2f = ldexp(v2f1, vec2i(v2u1));"; + const auto* expected = "let x_1 = ldexp(v2f1, vec2i(v2u1));"; EXPECT_THAT(body, HasSubstr(expected)) << body; } @@ -1397,7 +1368,7 @@ TEST_P(GlslStd450_Determinant, Test) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - std::string expected = "let x_1 : f32 = determinant(" + GetParam() + ");"; + std::string expected = "let x_1 = determinant(" + GetParam() + ");"; EXPECT_THAT(body, HasSubstr(expected)) << body; } @@ -1420,7 +1391,7 @@ TEST_F(SpvParserTest, GlslStd450_MatrixInverse_mat2x2) { std::string expected = "let s = (1.0f / determinant(m2x2f1));\n" - "let x_1 : mat2x2f = mat2x2f(vec2f((s * m2x2f1[1u][1u]), (-(s) * " + "let x_1 = mat2x2f(vec2f((s * m2x2f1[1u][1u]), (-(s) * " "m2x2f1[0u][1u])), vec2f((-(s) * m2x2f1[1u][0u]), (s * m2x2f1[0u][0u])));"; EXPECT_THAT(body, HasSubstr(expected)) << body; @@ -1441,7 +1412,7 @@ TEST_F(SpvParserTest, GlslStd450_MatrixInverse_mat3x3) { std::string expected = "let s = (1.0f / determinant(m3x3f1));\n" - "let x_1 : mat3x3f = (s * mat3x3f(vec3f(((m3x3f1[1u][1u] * m3x3f1[2u][2u]) - " + "let x_1 = (s * mat3x3f(vec3f(((m3x3f1[1u][1u] * m3x3f1[2u][2u]) - " "(m3x3f1[1u][2u] * m3x3f1[2u][1u])), ((m3x3f1[0u][2u] * m3x3f1[2u][1u]) - (m3x3f1[0u][1u] " "* m3x3f1[2u][2u])), ((m3x3f1[0u][1u] * m3x3f1[1u][2u]) - (m3x3f1[0u][2u] * " "m3x3f1[1u][1u]))), vec3f(((m3x3f1[1u][2u] * m3x3f1[2u][0u]) - (m3x3f1[1u][0u] * " @@ -1470,7 +1441,7 @@ TEST_F(SpvParserTest, GlslStd450_MatrixInverse_mat4x4) { std::string expected = "let s = (1.0f / determinant(m4x4f1));\n" - "let x_1 : mat4x4f = (s * mat4x4f(vec4f((((m4x4f1[1u][1u] * ((m4x4f1[2u][2u] * " + "let x_1 = (s * mat4x4f(vec4f((((m4x4f1[1u][1u] * ((m4x4f1[2u][2u] * " "m4x4f1[3u][3u]) - (m4x4f1[2u][3u] * m4x4f1[3u][2u]))) - (m4x4f1[1u][2u] * " "((m4x4f1[2u][1u] * m4x4f1[3u][3u]) - (m4x4f1[2u][3u] * m4x4f1[3u][1u])))) + " "(m4x4f1[1u][3u] * ((m4x4f1[2u][1u] * m4x4f1[3u][2u]) - (m4x4f1[2u][2u] * " @@ -1551,10 +1522,10 @@ TEST_F(SpvParserTest, GlslStd450_MatrixInverse_MultipleInScope) { std::string expected = "let s = (1.0f / determinant(m2x2f1));\n" - "let x_1 : mat2x2f = mat2x2f(vec2f((s * m2x2f1[1u][1u]), (-(s) * " + "let x_1 = mat2x2f(vec2f((s * m2x2f1[1u][1u]), (-(s) * " "m2x2f1[0u][1u])), vec2f((-(s) * m2x2f1[1u][0u]), (s * m2x2f1[0u][0u])));\n" "let s_1 = (1.0f / determinant(m2x2f1));\n" - "let x_2 : mat2x2f = mat2x2f(vec2f((s_1 * m2x2f1[1u][1u]), (-(s_1) * " + "let x_2 = mat2x2f(vec2f((s_1 * m2x2f1[1u][1u]), (-(s_1) * " "m2x2f1[0u][1u])), vec2f((-(s_1) * m2x2f1[1u][0u]), (s_1 * m2x2f1[0u][0u])));"; EXPECT_THAT(body, HasSubstr(expected)) << body; diff --git a/src/tint/reader/spirv/function_logical_test.cc b/src/tint/reader/spirv/function_logical_test.cc index 4e62df9230..a537154c04 100644 --- a/src/tint/reader/spirv/function_logical_test.cc +++ b/src/tint/reader/spirv/function_logical_test.cc @@ -136,7 +136,7 @@ TEST_F(SpvUnaryLogicalTest, LogicalNot_Scalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : bool = !(true);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = !(true);")); } TEST_F(SpvUnaryLogicalTest, LogicalNot_Vector) { @@ -153,7 +153,7 @@ TEST_F(SpvUnaryLogicalTest, LogicalNot_Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2 = !(vec2(true, false));")); + HasSubstr("let x_1 = !(vec2(true, false));")); } struct BinaryData { @@ -190,8 +190,8 @@ TEST_P(SpvBinaryLogicalTest, EmitExpression) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); utils::StringStream ss; - ss << "let x_1 : " << GetParam().ast_type << " = (" << GetParam().ast_lhs << " " - << GetParam().ast_op << " " << GetParam().ast_rhs << ");"; + ss << "let x_1 = (" << GetParam().ast_lhs << " " << GetParam().ast_op << " " + << GetParam().ast_rhs << ");"; auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(ss.str())) << assembly; } @@ -516,7 +516,7 @@ TEST_F(SpvFUnordTest, FUnordEqual_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = !((50.0f != 60.0f));")); + HasSubstr("let x_1 = !((50.0f != 60.0f));")); } TEST_F(SpvFUnordTest, FUnordEqual_Vector) { @@ -532,9 +532,8 @@ TEST_F(SpvFUnordTest, FUnordEqual_Vector) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT( - test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2 = !((vec2f(50.0f, 60.0f) != vec2f(60.0f, 50.0f)));")); + EXPECT_THAT(test::ToString(p->program(), ast_body), + HasSubstr("let x_1 = !((vec2f(50.0f, 60.0f) != vec2f(60.0f, 50.0f)));")); } TEST_F(SpvFUnordTest, FUnordNotEqual_Scalar) { @@ -551,7 +550,7 @@ TEST_F(SpvFUnordTest, FUnordNotEqual_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = !((50.0f == 60.0f));")); + HasSubstr("let x_1 = !((50.0f == 60.0f));")); } TEST_F(SpvFUnordTest, FUnordNotEqual_Vector) { @@ -567,9 +566,8 @@ TEST_F(SpvFUnordTest, FUnordNotEqual_Vector) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT( - test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2 = !((vec2f(50.0f, 60.0f) == vec2f(60.0f, 50.0f)));")); + EXPECT_THAT(test::ToString(p->program(), ast_body), + HasSubstr("let x_1 = !((vec2f(50.0f, 60.0f) == vec2f(60.0f, 50.0f)));")); } TEST_F(SpvFUnordTest, FUnordLessThan_Scalar) { @@ -586,7 +584,7 @@ TEST_F(SpvFUnordTest, FUnordLessThan_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = !((50.0f >= 60.0f));")); + HasSubstr("let x_1 = !((50.0f >= 60.0f));")); } TEST_F(SpvFUnordTest, FUnordLessThan_Vector) { @@ -602,9 +600,8 @@ TEST_F(SpvFUnordTest, FUnordLessThan_Vector) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT( - test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2 = !((vec2f(50.0f, 60.0f) >= vec2f(60.0f, 50.0f)));")); + EXPECT_THAT(test::ToString(p->program(), ast_body), + HasSubstr("let x_1 = !((vec2f(50.0f, 60.0f) >= vec2f(60.0f, 50.0f)));")); } TEST_F(SpvFUnordTest, FUnordLessThanEqual_Scalar) { @@ -620,8 +617,7 @@ TEST_F(SpvFUnordTest, FUnordLessThanEqual_Scalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = !((50.0f > 60.0f));")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = !((50.0f > 60.0f));")); } TEST_F(SpvFUnordTest, FUnordLessThanEqual_Vector) { @@ -637,9 +633,8 @@ TEST_F(SpvFUnordTest, FUnordLessThanEqual_Vector) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT( - test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2 = !((vec2f(50.0f, 60.0f) > vec2f(60.0f, 50.0f)));")); + EXPECT_THAT(test::ToString(p->program(), ast_body), + HasSubstr("let x_1 = !((vec2f(50.0f, 60.0f) > vec2f(60.0f, 50.0f)));")); } TEST_F(SpvFUnordTest, FUnordGreaterThan_Scalar) { @@ -656,7 +651,7 @@ TEST_F(SpvFUnordTest, FUnordGreaterThan_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = !((50.0f <= 60.0f));")); + HasSubstr("let x_1 = !((50.0f <= 60.0f));")); } TEST_F(SpvFUnordTest, FUnordGreaterThan_Vector) { @@ -672,9 +667,8 @@ TEST_F(SpvFUnordTest, FUnordGreaterThan_Vector) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT( - test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2 = !((vec2f(50.0f, 60.0f) <= vec2f(60.0f, 50.0f)));")); + EXPECT_THAT(test::ToString(p->program(), ast_body), + HasSubstr("let x_1 = !((vec2f(50.0f, 60.0f) <= vec2f(60.0f, 50.0f)));")); } TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Scalar) { @@ -690,8 +684,7 @@ TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Scalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = !((50.0f < 60.0f));")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = !((50.0f < 60.0f));")); } TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Vector) { @@ -707,9 +700,8 @@ TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Vector) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT( - test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2 = !((vec2f(50.0f, 60.0f) < vec2f(60.0f, 50.0f)));")); + EXPECT_THAT(test::ToString(p->program(), ast_body), + HasSubstr("let x_1 = !((vec2f(50.0f, 60.0f) < vec2f(60.0f, 50.0f)));")); } using SpvLogicalTest = SpvParserTestBase<::testing::Test>; @@ -728,7 +720,7 @@ TEST_F(SpvLogicalTest, Select_BoolCond_BoolParams) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = select(false, true, true);")); + HasSubstr("let x_1 = select(false, true, true);")); } TEST_F(SpvLogicalTest, Select_BoolCond_IntScalarParams) { @@ -745,7 +737,7 @@ TEST_F(SpvLogicalTest, Select_BoolCond_IntScalarParams) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : u32 = select(20u, 10u, true);")); + HasSubstr("let x_1 = select(20u, 10u, true);")); } TEST_F(SpvLogicalTest, Select_BoolCond_FloatScalarParams) { @@ -762,7 +754,7 @@ TEST_F(SpvLogicalTest, Select_BoolCond_FloatScalarParams) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : f32 = select(60.0f, 50.0f, true);")); + HasSubstr("let x_1 = select(60.0f, 50.0f, true);")); } TEST_F(SpvLogicalTest, Select_BoolCond_VectorParams) { @@ -781,7 +773,7 @@ TEST_F(SpvLogicalTest, Select_BoolCond_VectorParams) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : vec2u = select(" + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = select(" "vec2u(20u, 10u), " "vec2u(10u, 20u), " "true);")); @@ -806,7 +798,7 @@ TEST_F(SpvLogicalTest, Select_VecBoolCond_VectorParams) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : vec2u = select(" + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = select(" "vec2u(20u, 10u), " "vec2u(10u, 20u), " "vec2(true, false));")); @@ -826,7 +818,7 @@ TEST_F(SpvLogicalTest, Any) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = any(vec2(true, false));")); + HasSubstr("let x_1 = any(vec2(true, false));")); } TEST_F(SpvLogicalTest, All) { @@ -843,7 +835,7 @@ TEST_F(SpvLogicalTest, All) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = all(vec2(true, false));")); + HasSubstr("let x_1 = all(vec2(true, false));")); } TEST_F(SpvLogicalTest, IsNan_Scalar) { @@ -859,8 +851,7 @@ TEST_F(SpvLogicalTest, IsNan_Scalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = isNan(50.0f);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = isNan(50.0f);")); } TEST_F(SpvLogicalTest, IsNan_Vector) { @@ -877,7 +868,7 @@ TEST_F(SpvLogicalTest, IsNan_Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2 = isNan(vec2f(50.0f, 60.0f));")); + HasSubstr("let x_1 = isNan(vec2f(50.0f, 60.0f));")); } TEST_F(SpvLogicalTest, IsInf_Scalar) { @@ -893,8 +884,7 @@ TEST_F(SpvLogicalTest, IsInf_Scalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = isInf(50.0f);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 = isInf(50.0f);")); } TEST_F(SpvLogicalTest, IsInf_Vector) { @@ -911,7 +901,7 @@ TEST_F(SpvLogicalTest, IsInf_Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2 = isInf(vec2f(50.0f, 60.0f));")); + HasSubstr("let x_1 = isInf(vec2f(50.0f, 60.0f));")); } // TODO(dneto): Kernel-guarded instructions. diff --git a/src/tint/reader/spirv/function_memory_test.cc b/src/tint/reader/spirv/function_memory_test.cc index f7b1862563..b75a3bc737 100644 --- a/src/tint/reader/spirv/function_memory_test.cc +++ b/src/tint/reader/spirv/function_memory_test.cc @@ -159,7 +159,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_LoadBool) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_2 : bool = x_1;")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_2 = x_1;")); } TEST_F(SpvParserMemoryTest, EmitStatement_LoadScalar) { @@ -181,8 +181,9 @@ TEST_F(SpvParserMemoryTest, EmitStatement_LoadScalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_2 : u32 = x_1; -let x_3 : u32 = x_1; + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"( x_1 = 42u; +let x_2 = x_1; +let x_3 = x_1; )")); } @@ -206,7 +207,8 @@ TEST_F(SpvParserMemoryTest, EmitStatement_UseLoadedScalarTwice) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_2 : u32 = x_1; + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"( x_1 = 42u; +let x_2 = x_1; x_1 = x_2; x_1 = x_2; )")); @@ -802,7 +804,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_DereferenceBase) { ASSERT_TRUE(p->BuildAndParseInternalModule()); const auto got = test::ToString(p->program()); const std::string expected = R"(fn x_200(x_1 : ptr) { - let x_3 : u32 = (*(x_1)).x; + let x_3 = (*(x_1)).x; return; } @@ -846,7 +848,7 @@ OpExecutionMode %main OriginUpperLeft const auto got = test::ToString(p->program()); const std::string expected = R"(fn main_1() { var x_1 : u32; - let x_2 : ptr = &(x_1); + let x_2 = &(x_1); return; } @@ -1018,11 +1020,11 @@ TEST_F(SpvParserMemoryTest, RemapStorageBuffer_ThroughAccessChain_NonCascaded_Us EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto got = test::ToString(p->program(), ast_body); - EXPECT_THAT(got, HasSubstr(R"(let x_1 : ptr = &(myvar.field0); + EXPECT_THAT(got, HasSubstr(R"(let x_1 = &(myvar.field0); *(x_1) = 0u; *(x_1) = 0u; -let x_2 : ptr = &(myvar.field1[1u]); -let x_3 : u32 = *(x_2); +let x_2 = &(myvar.field1[1u]); +let x_3 = *(x_2); *(x_2) = 0u; )")); } @@ -1054,11 +1056,11 @@ TEST_F(SpvParserMemoryTest, RemapStorageBuffer_ThroughAccessChain_NonCascaded_Us EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto got = test::ToString(p->program(), ast_body); - EXPECT_THAT(got, HasSubstr(R"(let x_1 : ptr = &(myvar.field0); + EXPECT_THAT(got, HasSubstr(R"(let x_1 = &(myvar.field0); *(x_1) = 0u; *(x_1) = 0u; -let x_2 : ptr = &(myvar.field1[1u]); -let x_3 : u32 = *(x_2); +let x_2 = &(myvar.field1[1u]); +let x_3 = *(x_2); *(x_2) = 0u; )")) << got << assembly; @@ -1093,11 +1095,11 @@ TEST_F(SpvParserMemoryTest, StorageBuffer_ThroughAccessChain_NonCascaded_UsedTwi EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto got = test::ToString(p->program(), ast_body); - EXPECT_THAT(got, HasSubstr(R"(let x_1 : ptr = &(myvar.field0); + EXPECT_THAT(got, HasSubstr(R"(let x_1 = &(myvar.field0); *(x_1) = 0u; *(x_1) = 0u; -let x_2 : ptr = &(myvar.field1[1u]); -let x_3 : u32 = *(x_2); +let x_2 = &(myvar.field1[1u]); +let x_3 = *(x_2); *(x_2) = 0u; )")) << got; } @@ -1133,11 +1135,11 @@ TEST_F(SpvParserMemoryTest, StorageBuffer_ThroughAccessChain_NonCascaded_UsedTwi EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto got = test::ToString(p->program(), ast_body); - EXPECT_THAT(got, HasSubstr(R"(let x_1 : ptr = &(myvar.field0); + EXPECT_THAT(got, HasSubstr(R"(let x_1 = &(myvar.field0); *(x_1) = 0u; *(x_1) = 0u; -let x_2 : ptr = &(myvar.field1[1u]); -let x_3 : u32 = *(x_2); +let x_2 = &(myvar.field1[1u]); +let x_3 = *(x_2); *(x_2) = 0u; )")) << got; } @@ -1216,8 +1218,7 @@ TEST_F(SpvParserMemoryTest, RemapStorageBuffer_ThroughCopyObject_WithoutHoisting auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr(R"(let x_2 : ptr = &(myvar.field1[1u]); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_2 = &(myvar.field1[1u]); *(x_2) = 0u; )")) << p->error(); @@ -1275,7 +1276,7 @@ TEST_F(SpvParserMemoryTest, ArrayLength_FromVar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body_str = test::ToString(p->program(), ast_body); - EXPECT_THAT(body_str, HasSubstr("let x_1 : u32 = arrayLength(&(myvar.rtarr));")) << body_str; + EXPECT_THAT(body_str, HasSubstr("let x_1 = arrayLength(&(myvar.rtarr));")) << body_str; } TEST_F(SpvParserMemoryTest, ArrayLength_FromCopyObject) { @@ -1295,8 +1296,8 @@ TEST_F(SpvParserMemoryTest, ArrayLength_FromCopyObject) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body_str = test::ToString(p->program(), ast_body); - EXPECT_THAT(body_str, HasSubstr(R"(let x_2 : ptr = &(myvar); -let x_1 : u32 = arrayLength(&((*(x_2)).rtarr)); + EXPECT_THAT(body_str, HasSubstr(R"(let x_2 = &(myvar); +let x_1 = arrayLength(&((*(x_2)).rtarr)); )")) << body_str; p->SkipDumpingPending("crbug.com/tint/1041 track access mode in spirv-reader parser type"); @@ -1319,7 +1320,7 @@ TEST_F(SpvParserMemoryTest, ArrayLength_FromAccessChain) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body_str = test::ToString(p->program(), ast_body); - EXPECT_THAT(body_str, HasSubstr("let x_1 : u32 = arrayLength(&(myvar.rtarr));")) << body_str; + EXPECT_THAT(body_str, HasSubstr("let x_1 = arrayLength(&(myvar.rtarr));")) << body_str; } std::string InvalidPointerPreamble() { diff --git a/src/tint/reader/spirv/function_misc_test.cc b/src/tint/reader/spirv/function_misc_test.cc index 2c984d204a..3ab14e81ca 100644 --- a/src/tint/reader/spirv/function_misc_test.cc +++ b/src/tint/reader/spirv/function_misc_test.cc @@ -72,10 +72,10 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_BeforeFunction_Scalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_11 : bool = false; -let x_12 : u32 = 0u; -let x_13 : i32 = 0i; -let x_14 : f32 = 0.0f; + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_11 = false; +let x_12 = 0u; +let x_13 = 0i; +let x_14 = 0.0f; return; )")); } @@ -102,11 +102,10 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_BeforeFunction_Vector) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr(R"(let x_14 : vec2 = vec2(); -let x_11 : vec2u = vec2u(); -let x_12 : vec2i = vec2i(); -let x_13 : vec2f = vec2f(); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_14 = vec2(); +let x_11 = vec2u(); +let x_12 = vec2i(); +let x_13 = vec2f(); )")); } @@ -131,10 +130,10 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Scalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_11 : bool = false; -let x_12 : u32 = 0u; -let x_13 : i32 = 0i; -let x_14 : f32 = 0.0f; + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_11 = false; +let x_12 = 0u; +let x_13 = 0i; +let x_14 = 0.0f; return; )")); } @@ -158,9 +157,9 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Vector) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_11 : vec2u = vec2u(); -let x_12 : vec2i = vec2i(); -let x_13 : vec2f = vec2f(); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_11 = vec2u(); +let x_12 = vec2i(); +let x_13 = vec2f(); )")); } @@ -181,8 +180,7 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Matrix) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_11 : mat2x2f = mat2x2f();")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_11 = mat2x2f();")); } TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Array) { @@ -203,8 +201,7 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Array) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_11 : array = array();")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_11 = array();")); } TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Struct) { @@ -225,7 +222,7 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Struct) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_11 : S = S(false, 0u, 0i, 0.0f);")); + HasSubstr("let x_11 = S(false, 0u, 0i, 0.0f);")); } TEST_F(SpvParserTestMiscInstruction, OpNop) { diff --git a/src/tint/reader/spirv/function_var_test.cc b/src/tint/reader/spirv/function_var_test.cc index fd3580be1b..f9f5ead18d 100644 --- a/src/tint/reader/spirv/function_var_test.cc +++ b/src/tint/reader/spirv/function_var_test.cc @@ -181,11 +181,11 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ScalarInitializers) { EXPECT_TRUE(fe.EmitFunctionVariables()); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(var a : bool = true; -var b : bool = false; -var c : i32 = -1i; -var d : u32 = 1u; -var e : f32 = 1.5f; + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(var a = true; +var b = false; +var c = -1i; +var d = 1u; +var e = 1.5f; )")); } @@ -210,10 +210,10 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ScalarNullInitializers) { EXPECT_TRUE(fe.EmitFunctionVariables()); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(var a : bool = false; -var b : i32 = 0i; -var c : u32 = 0u; -var d : f32 = 0.0f; + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(var a = false; +var b = 0i; +var c = 0u; +var d = 0.0f; )")); } @@ -235,7 +235,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_VectorInitializer) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("var x_200 : vec2f = vec2f(1.5f, 2.0f);")); + HasSubstr("var x_200 = vec2f(1.5f, 2.0f);")); } TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_MatrixInitializer) { @@ -260,7 +260,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_MatrixInitializer) { EXPECT_TRUE(fe.EmitFunctionVariables()); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("var x_200 : mat3x2f = mat3x2f(" + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("var x_200 = mat3x2f(" "vec2f(1.5f, 2.0f), " "vec2f(2.0f, 3.0f), " "vec2f(3.0f, 4.0f));")); @@ -284,7 +284,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ArrayInitializer) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("var x_200 : array = array(1u, 2u);")); + HasSubstr("var x_200 = array(1u, 2u);")); } TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ArrayInitializer_Alias) { @@ -311,7 +311,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ArrayInitializer_Alias) { auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); - const char* expect = "var x_200 : Arr = Arr(1u, 2u);\n"; + const char* expect = "var x_200 = Arr(1u, 2u);\n"; EXPECT_EQ(expect, got); } @@ -332,8 +332,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ArrayInitializer_Null) { EXPECT_TRUE(fe.EmitFunctionVariables()); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("var x_200 : array = array();")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("var x_200 = array();")); } TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ArrayInitializer_Alias_Null) { @@ -360,7 +359,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ArrayInitializer_Alias_Nu auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("var x_200 : Arr = @stride(16) array();")); + HasSubstr("var x_200 = @stride(16) array();")); } TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_StructInitializer) { @@ -382,7 +381,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_StructInitializer) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("var x_200 : S = S(1u, 1.5f, array(1u, 2u));")); + HasSubstr("var x_200 = S(1u, 1.5f, array(1u, 2u));")); } TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_StructInitializer_Null) { @@ -404,7 +403,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_StructInitializer_Null) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("var x_200 : S = S(0u, 0.0f, array());")); + HasSubstr("var x_200 = S(0u, 0.0f, array());")); } TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_Decorate_RelaxedPrecision) { @@ -556,7 +555,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_CombinatorialValue_Immediate_Used auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); auto* expect = R"(var x_25 : u32; -let x_2 : u32 = (1u + 1u); +let x_2 = (1u + 1u); x_25 = 1u; x_25 = x_2; x_25 = x_2; @@ -601,7 +600,7 @@ TEST_F(SpvParserFunctionVarTest, auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); auto* expect = R"(var x_25 : u32; -let x_2 : u32 = (1u + 1u); +let x_2 = (1u + 1u); x_25 = 1u; loop { @@ -740,10 +739,10 @@ TEST_F(SpvParserFunctionVarTest, // a const definition. auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); - auto* expect = R"(let x_1 : u32 = 1u; + auto* expect = R"(let x_1 = 1u; if (true) { } -let x_3 : u32 = x_1; +let x_3 = x_1; x_200 = x_3; return; )"; @@ -801,10 +800,10 @@ TEST_F(SpvParserFunctionVarTest, auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); auto* expect = R"(if (true) { - let x_1 : u32 = 1u; + let x_1 = 1u; if (true) { } - let x_3 : u32 = x_1; + let x_3 = x_1; x_200 = x_3; } return; @@ -857,14 +856,14 @@ TEST_F(SpvParserFunctionVarTest, auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); auto* expect = R"(if (true) { - let x_1 : u32 = 1u; + let x_1 = 1u; switch(1u) { case 0u: { } default: { } } - let x_3 : u32 = x_1; + let x_3 = x_1; x_200 = x_3; } return; @@ -911,8 +910,8 @@ TEST_F(SpvParserFunctionVarTest, // a const definition. auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); - auto* expect = R"(let x_1 : u32 = 1u; -let x_2 : u32 = x_1; + auto* expect = R"(let x_1 = 1u; +let x_2 = x_1; if (true) { } return; @@ -1015,8 +1014,8 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_SingleBlockLoopIndex) { auto* expect = R"(loop { var x_2 : u32; var x_3 : u32; - let x_101 : bool = x_7; - let x_102 : bool = x_8; + let x_101 = x_7; + let x_102 = x_8; x_2 = 0u; x_3 = 1u; if (x_101) { @@ -1088,8 +1087,8 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_MultiBlockLoopIndex) { auto* expect = R"(loop { var x_2 : u32; var x_3 : u32; - let x_101 : bool = x_7; - let x_102 : bool = x_8; + let x_101 = x_7; + let x_102 = x_8; x_2 = 0u; x_3 = 1u; if (x_101) { @@ -1164,7 +1163,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_ValueFromLoopBodyAndContinuin auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); - auto* expect = R"(let x_101 : bool = x_17; + auto* expect = R"(let x_101 = x_17; loop { var x_2 : u32; var x_5 : u32; @@ -1182,7 +1181,7 @@ loop { continuing { x_7 = (x_4 + x_6); - let x_8 : u32 = x_5; + let x_8 = x_5; x_2 = x_4; x_5 = x_7; } @@ -1244,8 +1243,8 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_FromElseAndThen) { auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); - auto* expect = R"(let x_101 : bool = x_7; -let x_102 : bool = x_8; + auto* expect = R"(let x_101 = x_7; +let x_102 = x_8; loop { var x_2 : u32; if (x_101) { @@ -1317,8 +1316,8 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_FromHeaderAndThen) { auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); - auto* expect = R"(let x_101 : bool = x_7; -let x_102 : bool = x_8; + auto* expect = R"(let x_101 = x_7; +let x_102 = x_8; loop { var x_2 : u32; if (x_101) { @@ -1380,13 +1379,13 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_UseInPhiCountsAsUse) { auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); auto* expect = R"(var x_101 : bool; -let x_11 : bool = (true & true); -let x_12 : bool = !(x_11); +let x_11 = (true & true); +let x_12 = !(x_11); x_101 = x_11; if (true) { x_101 = x_12; } -let x_102 : bool = x_101; +let x_102 = x_101; return; )"; EXPECT_EQ(expect, got); @@ -1532,7 +1531,7 @@ loop { x_101 = x_999; } } -let x_1000 : bool = x_101; +let x_1000 = x_101; return; )"; EXPECT_EQ(expect, got); @@ -1698,7 +1697,7 @@ loop { x_101 = x_999; } } -let x_1000 : bool = x_101; +let x_1000 = x_101; return; )"; EXPECT_EQ(expect, got); @@ -1737,7 +1736,7 @@ if (true) { } else { return; } -let x_201 : vec2i = x_200; +let x_201 = x_200; return; )"; auto ast_body = fe.ast_body(); @@ -1780,7 +1779,7 @@ if (true) { } else { return; } -let x_201 : vec2i = x_200; +let x_201 = x_200; return; )"; EXPECT_EQ(got, expected) << got; diff --git a/src/tint/reader/spirv/parser_impl.cc b/src/tint/reader/spirv/parser_impl.cc index 220ccb9f1e..fa9572a871 100644 --- a/src/tint/reader/spirv/parser_impl.cc +++ b/src/tint/reader/spirv/parser_impl.cc @@ -1610,16 +1610,15 @@ const ast::Var* ParserImpl::MakeVar(uint32_t id, return nullptr; } + // Use type inference if there is an initializer. auto sym = builder_.Symbols().Register(namer_.Name(id)); - return builder_.Var(Source{}, sym, storage_type->Build(builder_), address_space, access, - initializer, std::move(attrs.list)); + return builder_.Var(Source{}, sym, initializer ? ast::Type{} : storage_type->Build(builder_), + address_space, access, initializer, std::move(attrs.list)); } -const ast::Let* ParserImpl::MakeLet(uint32_t id, - const Type* type, - const ast::Expression* initializer) { +const ast::Let* ParserImpl::MakeLet(uint32_t id, const ast::Expression* initializer) { auto sym = builder_.Symbols().Register(namer_.Name(id)); - return builder_.Let(Source{}, sym, type->Build(builder_), initializer, utils::Empty); + return builder_.Let(Source{}, sym, initializer, utils::Empty); } const ast::Override* ParserImpl::MakeOverride(uint32_t id, diff --git a/src/tint/reader/spirv/parser_impl.h b/src/tint/reader/spirv/parser_impl.h index 9c28aef19b..028414c87c 100644 --- a/src/tint/reader/spirv/parser_impl.h +++ b/src/tint/reader/spirv/parser_impl.h @@ -446,10 +446,9 @@ class ParserImpl : Reader { /// Creates an AST 'let' node for a SPIR-V ID, including any attached decorations,. /// @param id the SPIR-V result ID - /// @param type the type of the variable /// @param initializer the variable initializer /// @returns the AST 'let' node - const ast::Let* MakeLet(uint32_t id, const Type* type, const ast::Expression* initializer); + const ast::Let* MakeLet(uint32_t id, const ast::Expression* initializer); /// Creates an AST 'override' node for a SPIR-V ID, including any attached decorations. /// @param id the SPIR-V result ID diff --git a/src/tint/reader/spirv/parser_impl_function_decl_test.cc b/src/tint/reader/spirv/parser_impl_function_decl_test.cc index e463551feb..6d793abf54 100644 --- a/src/tint/reader/spirv/parser_impl_function_decl_test.cc +++ b/src/tint/reader/spirv/parser_impl_function_decl_test.cc @@ -377,12 +377,12 @@ TEST_F(SpvParserTest, EmitFunctions_CalleePrecedesCaller) { } fn branch() -> u32 { - let leaf_result : u32 = leaf(); + let leaf_result = leaf(); return leaf_result; } fn root() { - let branch_result : u32 = branch(); + let branch_result = branch(); return; } )")) << program_ast; diff --git a/src/tint/reader/spirv/parser_impl_handle_test.cc b/src/tint/reader/spirv/parser_impl_handle_test.cc index 0447110c0d..206e258985 100644 --- a/src/tint/reader/spirv/parser_impl_handle_test.cc +++ b/src/tint/reader/spirv/parser_impl_handle_test.cc @@ -1827,8 +1827,31 @@ INSTANTIATE_TEST_SUITE_P( @group(0) @binding(1) var x_30 : sampler_comparison; )", R"( - let x_200 : vec4f = vec4f(textureSample(x_20, x_10, coords12), 0.0f, 0.0f, 0.0f); - let x_210 : f32 = textureSampleCompare(x_20, x_30, coords12, 0.20000000298023223877f); + +@group(2) @binding(1) var x_20 : texture_depth_2d; + +@group(0) @binding(1) var x_30 : sampler_comparison; + +fn main_1() { + let f1 = 1.0f; + let vf12 = vec2f(1.0f, 2.0f); + let vf21 = vec2f(2.0f, 1.0f); + let vf123 = vec3f(1.0f, 2.0f, 3.0f); + let vf1234 = vec4f(1.0f, 2.0f, 3.0f, 4.0f); + let i1 = 1i; + let vi12 = vec2i(1i, 2i); + let vi123 = vec3i(1i, 2i, 3i); + let vi1234 = vec4i(1i, 2i, 3i, 4i); + let u1 = 1u; + let vu12 = vec2u(1u, 2u); + let vu123 = vec3u(1u, 2u, 3u); + let vu1234 = vec4u(1u, 2u, 3u, 4u); + let coords1 = 1.0f; + let coords12 = vf12; + let coords123 = vf123; + let coords1234 = vf1234; + let x_200 = vec4f(textureSample(x_20, x_10, coords12), 0.0f, 0.0f, 0.0f); + let x_210 = textureSampleCompare(x_20, x_30, coords12, 0.20000000298023223877f); )"})); INSTANTIATE_TEST_SUITE_P( @@ -2649,20 +2672,20 @@ INSTANTIATE_TEST_SUITE_P( // Level of detail is injected for sampled texture {"%float 2D 0 0 0 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12", R"(@group(2) @binding(1) var x_20 : texture_2d;)", - R"(let x_99 : vec4f = textureLoad(x_20, vi12, 0i);)"}, + R"(let x_99 = textureLoad(x_20, vi12, 0i);)"}, // OpImageFetch with explicit level, on sampled texture {"%float 2D 0 0 0 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12 Lod %int_3", R"(@group(2) @binding(1) var x_20 : texture_2d;)", - R"(let x_99 : vec4f = textureLoad(x_20, vi12, 3i);)"}, + R"(let x_99 = textureLoad(x_20, vi12, 3i);)"}, // OpImageFetch with no extra params, on depth texture // Level of detail is injected for depth texture {"%float 2D 1 0 0 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12", R"(@group(2) @binding(1) var x_20 : texture_depth_2d;)", - R"(let x_99 : vec4f = vec4f(textureLoad(x_20, vi12, 0i), 0.0f, 0.0f, 0.0f);)"}, + R"(let x_99 = vec4f(textureLoad(x_20, vi12, 0i), 0.0f, 0.0f, 0.0f);)"}, // OpImageFetch with extra params, on depth texture {"%float 2D 1 0 0 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12 Lod %int_3", R"(@group(2) @binding(1) var x_20 : texture_depth_2d;)", - R"(let x_99 : vec4f = vec4f(textureLoad(x_20, vi12, 3i), 0.0f, 0.0f, 0.0f);)"}})); + R"(let x_99 = vec4f(textureLoad(x_20, vi12, 3i), 0.0f, 0.0f, 0.0f);)"}})); INSTANTIATE_TEST_SUITE_P( ImageFetch_Depth, @@ -2675,7 +2698,7 @@ INSTANTIATE_TEST_SUITE_P( // ImageFetch on depth image. {"%float 2D 1 0 0 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12 ", R"(@group(2) @binding(1) var x_20 : texture_depth_2d;)", - R"(let x_99 : vec4f = vec4f(textureLoad(x_20, vi12, 0i), 0.0f, 0.0f, 0.0f);)"}})); + R"(let x_99 = vec4f(textureLoad(x_20, vi12, 0i), 0.0f, 0.0f, 0.0f);)"}})); INSTANTIATE_TEST_SUITE_P( ImageFetch_DepthMultisampled, @@ -2688,7 +2711,7 @@ INSTANTIATE_TEST_SUITE_P( // ImageFetch on multisampled depth image. {"%float 2D 1 0 1 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12 Sample %i1", R"(@group(2) @binding(1) var x_20 : texture_depth_multisampled_2d;)", - R"(let x_99 : vec4f = vec4f(textureLoad(x_20, vi12, i1), 0.0f, 0.0f, 0.0f);)"}})); + R"(let x_99 = vec4f(textureLoad(x_20, vi12, i1), 0.0f, 0.0f, 0.0f);)"}})); INSTANTIATE_TEST_SUITE_P(ImageFetch_Multisampled, SpvParserHandleTest_ImageAccessTest, @@ -2703,7 +2726,7 @@ INSTANTIATE_TEST_SUITE_P(ImageFetch_Multisampled, {"%float 2D 0 0 1 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12 Sample %i1", R"(@group(2) @binding(1) var x_20 : texture_multisampled_2d;)", - R"(let x_99 : vec4f = textureLoad(x_20, vi12, i1);)"}})); + R"(let x_99 = textureLoad(x_20, vi12, i1);)"}})); INSTANTIATE_TEST_SUITE_P(ImageFetch_Multisampled_ConvertSampleOperand, SpvParserHandleTest_ImageAccessTest, @@ -2711,7 +2734,7 @@ INSTANTIATE_TEST_SUITE_P(ImageFetch_Multisampled_ConvertSampleOperand, {"%float 2D 0 0 1 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12 Sample %u1", R"(@group(2) @binding(1) var x_20 : texture_multisampled_2d;)", - R"(let x_99 : vec4f = textureLoad(x_20, vi12, i32(u1));)"}})); + R"(let x_99 = textureLoad(x_20, vi12, i32(u1));)"}})); INSTANTIATE_TEST_SUITE_P(ConvertResultSignedness, SpvParserHandleTest_SampledImageAccessTest, @@ -2733,11 +2756,11 @@ INSTANTIATE_TEST_SUITE_P(ConvertResultSignedness, // OpImageFetch requires no conversion, float -> v4float {"%float 2D 0 0 0 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12", R"(@group(2) @binding(1) var x_20 : texture_2d;)", - R"(let x_99 : vec4f = textureLoad(x_20, vi12, 0i);)"}, + R"(let x_99 = textureLoad(x_20, vi12, 0i);)"}, // OpImageFetch requires no conversion, uint -> v4uint {"%uint 2D 0 0 0 1 Unknown", "%99 = OpImageFetch %v4uint %im %vi12", R"(@group(2) @binding(1) var x_20 : texture_2d;)", - R"(let x_99 : vec4u = textureLoad(x_20, vi12, 0i);)"}, + R"(let x_99 = textureLoad(x_20, vi12, 0i);)"}, // OpImageFetch requires conversion, uint -> v4int // is invalid SPIR-V: // "Expected Image 'Sampled Type' to be the same as Result Type @@ -2746,7 +2769,7 @@ INSTANTIATE_TEST_SUITE_P(ConvertResultSignedness, // OpImageFetch requires no conversion, int -> v4int {"%int 2D 0 0 0 1 Unknown", "%99 = OpImageFetch %v4int %im %vi12", R"(@group(2) @binding(1) var x_20 : texture_2d;)", - R"(let x_99 : vec4i = textureLoad(x_20, vi12, 0i);)"}, + R"(let x_99 = textureLoad(x_20, vi12, 0i);)"}, // OpImageFetch requires conversion, int -> v4uint // is invalid SPIR-V: // "Expected Image 'Sampled Type' to be the same as Result Type @@ -2759,11 +2782,11 @@ INSTANTIATE_TEST_SUITE_P(ConvertResultSignedness, // OpImageRead requires no conversion, float -> v4float {"%float 2D 0 0 0 2 Rgba32f", "%99 = OpImageRead %v4float %im %vi12", R"(@group(2) @binding(1) var x_20 : texture_2d;)", - R"(let x_99 : vec4f = textureLoad(x_20, vi12, 0i);)"}, + R"(let x_99 = textureLoad(x_20, vi12, 0i);)"}, // OpImageRead requires no conversion, uint -> v4uint {"%uint 2D 0 0 0 2 Rgba32ui", "%99 = OpImageRead %v4uint %im %vi12", R"(@group(2) @binding(1) var x_20 : texture_2d;)", - R"(let x_99 : vec4u = textureLoad(x_20, vi12, 0i);)"}, + R"(let x_99 = textureLoad(x_20, vi12, 0i);)"}, // OpImageRead requires conversion, uint -> v4int // is invalid SPIR-V: @@ -2773,7 +2796,7 @@ INSTANTIATE_TEST_SUITE_P(ConvertResultSignedness, // OpImageRead requires no conversion, int -> v4int {"%int 2D 0 0 0 2 Rgba32i", "%99 = OpImageRead %v4int %im %vi12", R"(@group(2) @binding(1) var x_20 : texture_2d;)", - R"(let x_99 : vec4i = textureLoad(x_20, vi12, 0i);)"}, + R"(let x_99 = textureLoad(x_20, vi12, 0i);)"}, // OpImageRead requires conversion, int -> v4uint // is invalid SPIR-V: @@ -2792,7 +2815,7 @@ INSTANTIATE_TEST_SUITE_P(ConvertResultSignedness, R"(@group(0) @binding(0) var x_10 : sampler; @group(2) @binding(1) var x_20 : texture_2d;)", - R"(let x_99 : vec4f = textureSample(x_20, x_10, vf12);)"}})); + R"(let x_99 = textureSample(x_20, x_10, vf12);)"}})); INSTANTIATE_TEST_SUITE_P(ImageQuerySize_NonArrayed_SignedResult, // ImageQuerySize requires storage image or multisampled @@ -2806,26 +2829,26 @@ INSTANTIATE_TEST_SUITE_P(ImageQuerySize_NonArrayed_SignedResult, "%98 = OpImageRead %v4float %im %i1\n", // Implicitly mark as // NonWritable R"(@group(2) @binding(1) var x_20 : texture_1d;)", - R"(let x_99 : i32 = i32(textureDimensions(x_20));)"}, + R"(let x_99 = i32(textureDimensions(x_20));)"}, // 2D storage image {"%float 2D 0 0 0 2 Rgba32f", "%99 = OpImageQuerySize %v2int %im \n" "%98 = OpImageRead %v4float %im %vi12\n", // Implicitly mark as // NonWritable R"(@group(2) @binding(1) var x_20 : texture_2d;)", - R"(let x_99 : vec2i = vec2i(textureDimensions(x_20))"}, + R"(let x_99 = vec2i(textureDimensions(x_20))"}, // 3D storage image {"%float 3D 0 0 0 2 Rgba32f", "%99 = OpImageQuerySize %v3int %im \n" "%98 = OpImageRead %v4float %im %vi123\n", // Implicitly mark as // NonWritable R"(@group(2) @binding(1) var x_20 : texture_3d;)", - R"(let x_99 : vec3i = vec3i(textureDimensions(x_20));)"}, + R"(let x_99 = vec3i(textureDimensions(x_20));)"}, // Multisampled {"%float 2D 0 0 1 1 Unknown", "%99 = OpImageQuerySize %v2int %im \n", R"(@group(2) @binding(1) var x_20 : texture_multisampled_2d;)", - R"(let x_99 : vec2i = vec2i(textureDimensions(x_20));)"}})); + R"(let x_99 = vec2i(textureDimensions(x_20));)"}})); INSTANTIATE_TEST_SUITE_P( ImageQuerySize_Arrayed_SignedResult, @@ -2841,7 +2864,7 @@ INSTANTIATE_TEST_SUITE_P( "%99 = OpImageQuerySize %v3int %im \n" "%98 = OpImageRead %v4float %im %vi123\n", R"(@group(2) @binding(1) var x_20 : texture_2d_array;)", - R"(let x_99 : vec3i = vec3i(vec3u(textureDimensions(x_20), textureNumLayers(x_20)));)"} + R"(let x_99 = vec3i(vec3u(textureDimensions(x_20), textureNumLayers(x_20)));)"} // 3D array storage image doesn't exist. // Multisampled array @@ -2857,32 +2880,32 @@ INSTANTIATE_TEST_SUITE_P( // 1D {"%float 1D 0 0 0 1 Unknown", "%99 = OpImageQuerySizeLod %int %im %i1\n", R"(@group(2) @binding(1) var x_20 : texture_1d;)", - R"(let x_99 : i32 = i32(textureDimensions(x_20, i1)))"}, + R"(let x_99 = i32(textureDimensions(x_20, i1)))"}, // 2D {"%float 2D 0 0 0 1 Unknown", "%99 = OpImageQuerySizeLod %v2int %im %i1\n", R"(@group(2) @binding(1) var x_20 : texture_2d;)", - R"(let x_99 : vec2i = vec2i(textureDimensions(x_20, i1));)"}, + R"(let x_99 = vec2i(textureDimensions(x_20, i1));)"}, // 3D {"%float 3D 0 0 0 1 Unknown", "%99 = OpImageQuerySizeLod %v3int %im %i1\n", R"(@group(2) @binding(1) var x_20 : texture_3d;)", - R"(let x_99 : vec3i = vec3i(textureDimensions(x_20, i1));)"}, + R"(let x_99 = vec3i(textureDimensions(x_20, i1));)"}, // Cube {"%float Cube 0 0 0 1 Unknown", "%99 = OpImageQuerySizeLod %v2int %im %i1\n", R"(@group(2) @binding(1) var x_20 : texture_cube;)", - R"(let x_99 : vec2i = vec2i(textureDimensions(x_20, i1).xy);)"}, + R"(let x_99 = vec2i(textureDimensions(x_20, i1).xy);)"}, // Depth 2D {"%float 2D 1 0 0 1 Unknown", "%99 = OpImageQuerySizeLod %v2int %im %i1\n", R"(@group(2) @binding(1) var x_20 : texture_depth_2d;)", - R"(let x_99 : vec2i = vec2i(textureDimensions(x_20, i1));)"}, + R"(let x_99 = vec2i(textureDimensions(x_20, i1));)"}, // Depth Cube {"%float Cube 1 0 0 1 Unknown", "%99 = OpImageQuerySizeLod %v2int %im %i1\n", R"(@group(2) @binding(1) var x_20 : texture_depth_cube;)", - R"(let x_99 : vec2i = vec2i(textureDimensions(x_20, i1).xy);)"}})); + R"(let x_99 = vec2i(textureDimensions(x_20, i1).xy);)"}})); INSTANTIATE_TEST_SUITE_P( ImageQuerySizeLod_Arrayed_SignedResult_SignedLevel, @@ -2897,7 +2920,7 @@ INSTANTIATE_TEST_SUITE_P( // 2D array {"%float 2D 0 1 0 1 Unknown", "%99 = OpImageQuerySizeLod %v3int %im %i1\n", R"(@group(2) @binding(1) var x_20 : texture_2d_array;)", - R"(let x_99 : vec3i = vec3i(vec3u(textureDimensions(x_20, i1), textureNumLayers(x_20)));)"}, + R"(let x_99 = vec3i(vec3u(textureDimensions(x_20, i1), textureNumLayers(x_20)));)"}, // There is no 3D array @@ -2908,12 +2931,12 @@ INSTANTIATE_TEST_SUITE_P( // https://github.com/gpuweb/gpuweb/issues/1345 {"%float Cube 0 1 0 1 Unknown", "%99 = OpImageQuerySizeLod %v3int %im %i1\n", R"(@group(2) @binding(1) var x_20 : texture_cube_array;)", - R"(let x_99 : vec3i = vec3i(vec3u(textureDimensions(x_20, i1).xy, textureNumLayers(x_20)));)"}, + R"(let x_99 = vec3i(vec3u(textureDimensions(x_20, i1).xy, textureNumLayers(x_20)));)"}, // Depth 2D array {"%float 2D 1 1 0 1 Unknown", "%99 = OpImageQuerySizeLod %v3int %im %i1\n", R"(@group(2) @binding(1) var x_20 : texture_depth_2d_array;)", - R"(let x_99 : vec3i = vec3i(vec3u(textureDimensions(x_20, i1), textureNumLayers(x_20)));)"}, + R"(let x_99 = vec3i(vec3u(textureDimensions(x_20, i1), textureNumLayers(x_20)));)"}, // Depth Cube Array // @@ -2922,7 +2945,7 @@ INSTANTIATE_TEST_SUITE_P( // https://github.com/gpuweb/gpuweb/issues/1345 {"%float Cube 1 1 0 1 Unknown", "%99 = OpImageQuerySizeLod %v3int %im %i1\n", R"(@group(2) @binding(1) var x_20 : texture_depth_cube_array;)", - R"(let x_99 : vec3i = vec3i(vec3u(textureDimensions(x_20, i1).xy, textureNumLayers(x_20)));)"}})); + R"(let x_99 = vec3i(vec3u(textureDimensions(x_20, i1).xy, textureNumLayers(x_20)));)"}})); INSTANTIATE_TEST_SUITE_P( // textureDimensions accepts both signed and unsigned the level-of-detail values. @@ -2932,7 +2955,7 @@ INSTANTIATE_TEST_SUITE_P( {"%float 1D 0 0 0 1 Unknown", "%99 = OpImageQuerySizeLod %int %im %u1\n", R"(@group(2) @binding(1) var x_20 : texture_1d;)", - R"(let x_99 : i32 = i32(textureDimensions(x_20, u1));)"}})); + R"(let x_99 = i32(textureDimensions(x_20, u1));)"}})); INSTANTIATE_TEST_SUITE_P( // When SPIR-V wants the result type to be unsigned, we have to @@ -2945,7 +2968,7 @@ INSTANTIATE_TEST_SUITE_P( {"%float 1D 0 0 0 1 Unknown", "%99 = OpImageQuerySizeLod %uint %im %i1\n", R"(@group(2) @binding(1) var x_20 : texture_1d;)", - R"(let x_99 : i32 = i32(textureDimensions(x_20, i1));)"}})); + R"(let x_99 = i32(textureDimensions(x_20, i1));)"}})); INSTANTIATE_TEST_SUITE_P(ImageQueryLevels_SignedResult, SpvParserHandleTest_SampledImageAccessTest, @@ -2958,47 +2981,47 @@ INSTANTIATE_TEST_SUITE_P(ImageQueryLevels_SignedResult, // 2D {"%float 2D 0 0 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n", R"(@group(2) @binding(1) var x_20 : texture_2d;)", - R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"}, + R"(let x_99 = i32(textureNumLevels(x_20));)"}, // 2D array {"%float 2D 0 1 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n", R"(@group(2) @binding(1) var x_20 : texture_2d_array;)", - R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"}, + R"(let x_99 = i32(textureNumLevels(x_20));)"}, // 3D {"%float 3D 0 0 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n", R"(@group(2) @binding(1) var x_20 : texture_3d;)", - R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"}, + R"(let x_99 = i32(textureNumLevels(x_20));)"}, // Cube {"%float Cube 0 0 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n", R"(@group(2) @binding(1) var x_20 : texture_cube;)", - R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"}, + R"(let x_99 = i32(textureNumLevels(x_20));)"}, // Cube array {"%float Cube 0 1 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n", R"(@group(2) @binding(1) var x_20 : texture_cube_array;)", - R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"}, + R"(let x_99 = i32(textureNumLevels(x_20));)"}, // depth 2d {"%float 2D 1 0 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n", R"(@group(2) @binding(1) var x_20 : texture_depth_2d;)", - R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"}, + R"(let x_99 = i32(textureNumLevels(x_20));)"}, // depth 2d array {"%float 2D 1 1 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n", R"(@group(2) @binding(1) var x_20 : texture_depth_2d_array;)", - R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"}, + R"(let x_99 = i32(textureNumLevels(x_20));)"}, // depth cube {"%float Cube 1 0 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n", R"(@group(2) @binding(1) var x_20 : texture_depth_cube;)", - R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"}, + R"(let x_99 = i32(textureNumLevels(x_20));)"}, // depth cube array {"%float Cube 1 1 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n", R"(@group(2) @binding(1) var x_20 : texture_depth_cube_array;)", - R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"}})); + R"(let x_99 = i32(textureNumLevels(x_20));)"}})); INSTANTIATE_TEST_SUITE_P( // Spot check that a value conversion is inserted when SPIR-V asks for an unsigned int result. @@ -3007,7 +3030,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(std::vector{ {"%float 2D 0 0 0 1 Unknown", "%99 = OpImageQueryLevels %uint %im\n", R"(@group(2) @binding(1) var x_20 : texture_2d;)", - R"(let x_99 : u32 = textureNumLevels(x_20);)"}})); + R"(let x_99 = textureNumLevels(x_20);)"}})); INSTANTIATE_TEST_SUITE_P(ImageQuerySamples_SignedResult, SpvParserHandleTest_SampledImageAccessTest, @@ -3015,7 +3038,7 @@ INSTANTIATE_TEST_SUITE_P(ImageQuerySamples_SignedResult, // Multsample 2D {"%float 2D 0 0 1 1 Unknown", "%99 = OpImageQuerySamples %int %im\n", R"(@group(2) @binding(1) var x_20 : texture_multisampled_2d;)", - R"(let x_99 : i32 = i32(textureNumSamples(x_20));)"} + R"(let x_99 = i32(textureNumSamples(x_20));)"} // Multisample 2D array // Not in WebGPU @@ -3029,7 +3052,7 @@ INSTANTIATE_TEST_SUITE_P( // Multisample 2D {"%float 2D 0 0 1 1 Unknown", "%99 = OpImageQuerySamples %uint %im\n", R"(@group(2) @binding(1) var x_20 : texture_multisampled_2d;)", - R"(let x_99 : u32 = textureNumSamples(x_20);)"} + R"(let x_99 = textureNumSamples(x_20);)"} // Multisample 2D array // Not in WebGPU @@ -3815,8 +3838,8 @@ TEST_F(SpvParserHandleTest, NeverGenerateConstDeclForHandle_UseVariableDirectly) auto ast_body = fe.ast_body(); const auto got = test::ToString(p->program(), ast_body); auto* expect = R"(var var_1 : vec4f; -let x_22 : vec4f = textureSample(x_2, x_3, vec2f()); -let x_26 : vec4f = textureSample(x_2, x_3, vec2f()); +let x_22 = textureSample(x_2, x_3, vec2f()); +let x_26 = textureSample(x_2, x_3, vec2f()); var_1 = (x_22 + x_26); return; )"; @@ -3890,7 +3913,7 @@ TEST_F(SpvParserHandleTest, SamplerLoadedInEnclosingConstruct_DontGenerateVar) { auto* expect = R"(switch(0i) { default: { if (true) { - let x_24 : vec4f = textureSample(var_im, var_s, vec2f()); + let x_24 = textureSample(var_im, var_s, vec2f()); } } } @@ -3977,7 +4000,7 @@ OpFunctionEnd x_900 = 0.0f; if (true) { if (true) { - let x_18 : vec4f = textureSample(x_20, x_10, x_900); + let x_18 = textureSample(x_20, x_10, x_900); } } return; @@ -4064,7 +4087,7 @@ OpFunctionEnd x_900 = vec2f(); if (true) { if (true) { - let x_19 : vec4f = textureSample(x_20, x_10, x_900.x); + let x_19 = textureSample(x_20, x_10, x_900.x); } } return; @@ -4226,7 +4249,7 @@ loop { x_15 = x_17; } } -let x_21 : f32 = select(0.0f, x_14, (x_14 > 1.0f)); +let x_21 = select(0.0f, x_14, (x_14 > 1.0f)); x_1 = vec4f(x_21, x_21, x_21, x_21); return; )"; diff --git a/src/tint/reader/spirv/parser_impl_module_var_test.cc b/src/tint/reader/spirv/parser_impl_module_var_test.cc index 871edf76d1..6855479784 100644 --- a/src/tint/reader/spirv/parser_impl_module_var_test.cc +++ b/src/tint/reader/spirv/parser_impl_module_var_test.cc @@ -881,15 +881,15 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarInitializers) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr(R"(var x_1 : bool = true; + EXPECT_THAT(module_str, HasSubstr(R"(var x_1 = true; -var x_2 : bool = false; +var x_2 = false; -var x_3 : i32 = -1i; +var x_3 = -1i; -var x_4 : u32 = 1u; +var x_4 = 1u; -var x_5 : f32 = 1.5f; +var x_5 = 1.5f; )")); } @@ -908,13 +908,13 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarNullInitializers) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr(R"(var x_1 : bool = false; + EXPECT_THAT(module_str, HasSubstr(R"(var x_1 = false; -var x_2 : i32 = 0i; +var x_2 = 0i; -var x_3 : u32 = 0u; +var x_3 = 0u; -var x_4 : f32 = 0.0f; +var x_4 = 0.0f; )")); } @@ -933,13 +933,13 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarUndefInitializers) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error(); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr(R"(var x_1 : bool = false; + EXPECT_THAT(module_str, HasSubstr(R"(var x_1 = false; -var x_2 : i32 = 0i; +var x_2 = 0i; -var x_3 : u32 = 0u; +var x_3 = 0u; -var x_4 : f32 = 0.0f; +var x_4 = 0.0f; )")); // This example module emits ok, but is not valid SPIR-V in the first place. @@ -956,7 +956,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : vec2f = vec2f(1.5f, 2.0f);")); + EXPECT_THAT(module_str, HasSubstr("var x_200 = vec2f(1.5f, 2.0f);")); } TEST_F(SpvModuleScopeVarParserTest, VectorBoolNullInitializer) { @@ -968,7 +968,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorBoolNullInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : vec2 = vec2();")); + EXPECT_THAT(module_str, HasSubstr("var x_200 = vec2();")); } TEST_F(SpvModuleScopeVarParserTest, VectorBoolUndefInitializer) { @@ -980,7 +980,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorBoolUndefInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : vec2 = vec2();")); + EXPECT_THAT(module_str, HasSubstr("var x_200 = vec2();")); // This example module emits ok, but is not valid SPIR-V in the first place. p->DeliberatelyInvalidSpirv(); @@ -995,7 +995,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorUintNullInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : vec2u = vec2u();")); + EXPECT_THAT(module_str, HasSubstr("var x_200 = vec2u();")); } TEST_F(SpvModuleScopeVarParserTest, VectorUintUndefInitializer) { @@ -1007,7 +1007,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorUintUndefInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : vec2u = vec2u();")); + EXPECT_THAT(module_str, HasSubstr("var x_200 = vec2u();")); // This example module emits ok, but is not valid SPIR-V in the first place. p->DeliberatelyInvalidSpirv(); @@ -1022,7 +1022,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorIntNullInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : vec2i = vec2i();")); + EXPECT_THAT(module_str, HasSubstr("var x_200 = vec2i();")); } TEST_F(SpvModuleScopeVarParserTest, VectorIntUndefInitializer) { @@ -1034,7 +1034,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorIntUndefInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : vec2i = vec2i();")); + EXPECT_THAT(module_str, HasSubstr("var x_200 = vec2i();")); // This example module emits ok, but is not valid SPIR-V in the first place. p->DeliberatelyInvalidSpirv(); @@ -1049,7 +1049,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorFloatNullInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : vec2f = vec2f();")); + EXPECT_THAT(module_str, HasSubstr("var x_200 = vec2f();")); } TEST_F(SpvModuleScopeVarParserTest, VectorFloatUndefInitializer) { @@ -1061,7 +1061,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorFloatUndefInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : vec2f = vec2f();")); + EXPECT_THAT(module_str, HasSubstr("var x_200 = vec2f();")); // This example module emits ok, but is not valid SPIR-V in the first place. p->DeliberatelyInvalidSpirv(); @@ -1082,7 +1082,7 @@ TEST_F(SpvModuleScopeVarParserTest, MatrixInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : mat3x2f = mat3x2f(" + EXPECT_THAT(module_str, HasSubstr("var x_200 = mat3x2f(" "vec2f(1.5f, 2.0f), " "vec2f(2.0f, 3.0f), " "vec2f(3.0f, 4.0f));")); @@ -1097,7 +1097,7 @@ TEST_F(SpvModuleScopeVarParserTest, MatrixNullInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : mat3x2f = mat3x2f();")); + EXPECT_THAT(module_str, HasSubstr("var x_200 = mat3x2f();")); } TEST_F(SpvModuleScopeVarParserTest, MatrixUndefInitializer) { @@ -1109,7 +1109,7 @@ TEST_F(SpvModuleScopeVarParserTest, MatrixUndefInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : mat3x2f = mat3x2f();")); + EXPECT_THAT(module_str, HasSubstr("var x_200 = mat3x2f();")); // This example module emits ok, but is not valid SPIR-V in the first place. p->DeliberatelyInvalidSpirv(); @@ -1125,8 +1125,7 @@ TEST_F(SpvModuleScopeVarParserTest, ArrayInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, - HasSubstr("var x_200 : array = array(1u, 2u);")); + EXPECT_THAT(module_str, HasSubstr("var x_200 = array(1u, 2u);")); } TEST_F(SpvModuleScopeVarParserTest, ArrayNullInitializer) { @@ -1138,7 +1137,7 @@ TEST_F(SpvModuleScopeVarParserTest, ArrayNullInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : array = array();")); + EXPECT_THAT(module_str, HasSubstr("var x_200 = array();")); } TEST_F(SpvModuleScopeVarParserTest, ArrayUndefInitializer) { @@ -1150,7 +1149,7 @@ TEST_F(SpvModuleScopeVarParserTest, ArrayUndefInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : array = array();")); + EXPECT_THAT(module_str, HasSubstr("var x_200 = array();")); // This example module emits ok, but is not valid SPIR-V in the first place. p->DeliberatelyInvalidSpirv(); @@ -1167,8 +1166,7 @@ TEST_F(SpvModuleScopeVarParserTest, StructInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, - HasSubstr("var x_200 : S = S(1u, 1.5f, array(1u, 2u));")) + EXPECT_THAT(module_str, HasSubstr("var x_200 = S(1u, 1.5f, array(1u, 2u));")) << module_str; } @@ -1181,7 +1179,7 @@ TEST_F(SpvModuleScopeVarParserTest, StructNullInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error(); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : S = S(0u, 0.0f, array());")) + EXPECT_THAT(module_str, HasSubstr("var x_200 = S(0u, 0.0f, array());")) << module_str; } @@ -1195,7 +1193,7 @@ TEST_F(SpvModuleScopeVarParserTest, StructUndefInitializer) { EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : S = S(0u, 0.0f, array());")) + EXPECT_THAT(module_str, HasSubstr("var x_200 = S(0u, 0.0f, array());")) << module_str; // This example module emits ok, but is not valid SPIR-V in the first place. @@ -1660,7 +1658,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_I32_Load_Direct) { R"(var x_1 : i32; fn main_1() { - let x_2 : i32 = x_1; + let x_2 = x_1; return; } @@ -1773,7 +1771,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_I32_Load_AccessChain) { const std::string expected = R"(var x_1 : i32; fn main_1() { - let x_2 : i32 = x_1; + let x_2 = x_1; return; } @@ -1826,7 +1824,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_Direct) { const std::string expected = R"(var x_1 : u32; fn main_1() { - let x_2 : u32 = x_1; + let x_2 = x_1; return; } @@ -1855,8 +1853,8 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_CopyObject) { const std::string expected = R"(var x_1 : u32; fn main_1() { - let x_11 : ptr = &(x_1); - let x_2 : u32 = *(x_11); + let x_11 = &(x_1); + let x_2 = *(x_11); return; } @@ -1885,7 +1883,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_AccessChain) { const std::string expected = R"(var x_1 : u32; fn main_1() { - let x_2 : u32 = x_1; + let x_2 = x_1; return; } @@ -1999,7 +1997,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_U32_Direct) { const std::string expected = R"(var x_1 : array; fn main_1() { - let x_3 : u32 = x_1[0i]; + let x_3 = x_1[0i]; return; } @@ -2031,7 +2029,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_U32_CopyObject) { const std::string expected = R"(var x_1 : array; fn main_1() { - let x_4 : u32 = x_1[0i]; + let x_4 = x_1[0i]; return; } @@ -2063,7 +2061,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_U32_AccessChain) { const std::string expected = R"(var x_1 : array; fn main_1() { - let x_4 : u32 = x_1[0i]; + let x_4 = x_1[0i]; return; } @@ -2094,7 +2092,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_Direct) { const std::string expected = R"(var x_1 : array; fn main_1() { - let x_3 : i32 = x_1[0i]; + let x_3 = x_1[0i]; return; } @@ -2126,7 +2124,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_CopyObject) { const std::string expected = R"(var x_1 : array; fn main_1() { - let x_4 : i32 = x_1[0i]; + let x_4 = x_1[0i]; return; } @@ -2158,7 +2156,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_AccessChain) { const std::string expected = R"(var x_1 : array; fn main_1() { - let x_4 : i32 = x_1[0i]; + let x_4 = x_1[0i]; return; } @@ -2435,7 +2433,7 @@ alias Arr_3 = @stride(4) array; var x_1 : Arr; fn main_1() { - let x_3 : u32 = x_1[0i]; + let x_3 = x_1[0i]; return; } @@ -2532,7 +2530,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_Direct) { var x_4 : vec4f; fn main_1() { - let x_2 : i32 = x_1; + let x_2 = x_1; return; } @@ -2589,9 +2587,9 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_UsedTwice_DifferentConstructs) { var x_5 : vec4f; fn main_1() { - let x_2 : u32 = x_1; + let x_2 = x_1; if (true) { - let x_3 : u32 = x_1; + let x_3 = x_1; if (true) { } } @@ -2631,8 +2629,8 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_CopyObject) { var x_4 : vec4f; fn main_1() { - let x_14 : ptr = &(x_1); - let x_2 : i32 = *(x_14); + let x_14 = &(x_1); + let x_2 = *(x_14); return; } @@ -2669,7 +2667,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_AccessChain) { var x_4 : vec4f; fn main_1() { - let x_2 : i32 = x_1; + let x_2 = x_1; return; } @@ -2705,7 +2703,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_Direct) { var x_4 : vec4f; fn main_1() { - let x_2 : u32 = x_1; + let x_2 = x_1; return; } @@ -2742,8 +2740,8 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_CopyObject) { var x_4 : vec4f; fn main_1() { - let x_14 : ptr = &(x_1); - let x_2 : u32 = *(x_14); + let x_14 = &(x_1); + let x_2 = *(x_14); return; } @@ -2780,7 +2778,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_AccessChain) { var x_4 : vec4f; fn main_1() { - let x_2 : u32 = x_1; + let x_2 = x_1; return; } @@ -2864,7 +2862,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_Direct) { var position_1 : vec4f; fn main_1() { - let x_2 : i32 = x_1; + let x_2 = x_1; return; } @@ -2901,8 +2899,8 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_CopyObject) { var position_1 : vec4f; fn main_1() { - let x_14 : ptr = &(x_1); - let x_2 : i32 = *(x_14); + let x_14 = &(x_1); + let x_2 = *(x_14); return; } @@ -2939,7 +2937,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_AccessChain) { var position_1 : vec4f; fn main_1() { - let x_2 : i32 = x_1; + let x_2 = x_1; return; } @@ -2998,7 +2996,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_Direct) { var position_1 : vec4f; fn main_1() { - let x_2 : u32 = x_1; + let x_2 = x_1; return; } @@ -3035,8 +3033,8 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_CopyObject) { var position_1 : vec4f; fn main_1() { - let x_14 : ptr = &(x_1); - let x_2 : u32 = *(x_14); + let x_14 = &(x_1); + let x_2 = *(x_14); return; } @@ -3073,7 +3071,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_AccessChain) { var position_1 : vec4f; fn main_1() { - let x_2 : u32 = x_1; + let x_2 = x_1; return; } @@ -3230,7 +3228,7 @@ TEST_P(SpvModuleScopeVarParserTest_ComputeBuiltin, Load_Direct) { std::string expected = R"(var x_1 : ${wgsl_type}; fn main_1() { - let x_2 : ${wgsl_type} = x_1; + let x_2 = x_1; return; } @@ -3275,8 +3273,8 @@ TEST_P(SpvModuleScopeVarParserTest_ComputeBuiltin, Load_CopyObject) { std::string expected = R"(var x_1 : ${wgsl_type}; fn main_1() { - let x_13 : ptr = &(x_1); - let x_2 : ${wgsl_type} = *(x_13); + let x_13 = &(x_1); + let x_2 = *(x_13); return; } @@ -3321,7 +3319,7 @@ TEST_P(SpvModuleScopeVarParserTest_ComputeBuiltin, Load_AccessChain) { std::string expected = R"(var x_1 : ${wgsl_type}; fn main_1() { - let x_2 : ${wgsl_type} = x_1; + let x_2 = x_1; return; } @@ -3396,7 +3394,7 @@ TEST_P(SpvModuleScopeVarParserTest_ComputeBuiltinVector, Load_Component_Direct) std::string expected = R"(var x_1 : ${wgsl_type}; fn main_1() { - let x_2 : ${wgsl_component_type} = x_1.y; + let x_2 = x_1.y; return; } @@ -3582,7 +3580,7 @@ TEST_F(SpvModuleScopeVarParserTest, OutputVarsConvertedToPrivate_WithInitializer ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto got = test::ToString(p->program()); - const std::string expected = "var x_1 : u32 = 1u;"; + const std::string expected = "var x_1 = 1u;"; EXPECT_THAT(got, HasSubstr(expected)) << got; } @@ -3602,7 +3600,7 @@ TEST_F(SpvModuleScopeVarParserTest, Builtin_Output_Initializer_SameSignednessAsW ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto got = test::ToString(p->program()); - const std::string expected = "var x_1 : array = array(2u);"; + const std::string expected = "var x_1 = array(2u);"; EXPECT_THAT(got, HasSubstr(expected)) << got; } @@ -3622,7 +3620,7 @@ TEST_F(SpvModuleScopeVarParserTest, Builtin_Output_Initializer_OppositeSignednes ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto got = test::ToString(p->program()); - const std::string expected = "var x_1 : array = array(14i);"; + const std::string expected = "var x_1 = array(14i);"; EXPECT_THAT(got, HasSubstr(expected)) << got; } @@ -3749,7 +3747,7 @@ TEST_F(SpvModuleScopeVarParserTest, EntryPointWrapping_BuiltinVar_Input_SameSign var x_4 : vec4f; fn main_1() { - let x_2 : u32 = x_1; + let x_2 = x_1; return; } @@ -3798,7 +3796,7 @@ TEST_F(SpvModuleScopeVarParserTest, EntryPointWrapping_BuiltinVar_Input_Opposite var x_4 : vec4f; fn main_1() { - let x_2 : i32 = x_1; + let x_2 = x_1; return; } @@ -3920,7 +3918,7 @@ TEST_F(SpvModuleScopeVarParserTest, EXPECT_TRUE(p->error().empty()); const auto got = test::ToString(p->program()); const std::string expected = - R"(var x_1 : array = array(); + R"(var x_1 = array(); fn main_1() { return; @@ -3966,7 +3964,7 @@ TEST_F(SpvModuleScopeVarParserTest, EXPECT_TRUE(p->error().empty()); const auto got = test::ToString(p->program()); const std::string expected = - R"(var x_1 : array = array(); + R"(var x_1 = array(); fn main_1() { return; @@ -4009,7 +4007,7 @@ TEST_F(SpvModuleScopeVarParserTest, EntryPointWrapping_BuiltinVar_FragDepth_Out_ ASSERT_TRUE(p->Parse()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto got = test::ToString(p->program()); - const std::string expected = R"(var x_1 : f32 = 0.0f; + const std::string expected = R"(var x_1 = 0.0f; fn main_1() { return; @@ -4112,7 +4110,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPosition_BuiltIn_Position_Initializer const auto got = test::ToString(p->program()); const std::string expected = - R"(var gl_Position : vec4f = vec4f(1.0f, 2.0f, 3.0f, 4.0f); + R"(var gl_Position = vec4f(1.0f, 2.0f, 3.0f, 4.0f); fn main_1() { return; diff --git a/test/tint/access/let/matrix.spvasm.expected.wgsl b/test/tint/access/let/matrix.spvasm.expected.wgsl index ddb9c8cd89..aee4b45b97 100644 --- a/test/tint/access/let/matrix.spvasm.expected.wgsl +++ b/test/tint/access/let/matrix.spvasm.expected.wgsl @@ -1,5 +1,5 @@ fn main_1() { - let x_24 : f32 = mat3x3f(vec3f(1.0f, 2.0f, 3.0f), vec3f(4.0f, 5.0f, 6.0f), vec3f(7.0f, 8.0f, 9.0f))[1u].y; + let x_24 = mat3x3f(vec3f(1.0f, 2.0f, 3.0f), vec3f(4.0f, 5.0f, 6.0f), vec3f(7.0f, 8.0f, 9.0f))[1u].y; return; } diff --git a/test/tint/access/let/vector.spvasm.expected.wgsl b/test/tint/access/let/vector.spvasm.expected.wgsl index 0d7f6cce06..da53bac5a5 100644 --- a/test/tint/access/let/vector.spvasm.expected.wgsl +++ b/test/tint/access/let/vector.spvasm.expected.wgsl @@ -1,9 +1,9 @@ const x_10 = vec3f(1.0f, 2.0f, 3.0f); fn main_1() { - let x_11 : f32 = x_10.y; - let x_13 : vec2f = vec2f(x_10.x, x_10.z); - let x_14 : vec3f = vec3f(x_10.x, x_10.z, x_10.y); + let x_11 = x_10.y; + let x_13 = vec2f(x_10.x, x_10.z); + let x_14 = vec3f(x_10.x, x_10.z, x_10.y); return; } diff --git a/test/tint/access/var/matrix.spvasm.expected.wgsl b/test/tint/access/var/matrix.spvasm.expected.wgsl index bc5623421b..373a61d6fe 100644 --- a/test/tint/access/var/matrix.spvasm.expected.wgsl +++ b/test/tint/access/var/matrix.spvasm.expected.wgsl @@ -1,7 +1,7 @@ fn main_1() { - var m : mat3x3f = mat3x3f(); - let x_15 : vec3f = m[1i]; - let x_16 : f32 = x_15.y; + var m = mat3x3f(); + let x_15 = m[1i]; + let x_16 = x_15.y; return; } diff --git a/test/tint/access/var/vector.spvasm.expected.wgsl b/test/tint/access/var/vector.spvasm.expected.wgsl index b254811076..80a5198745 100644 --- a/test/tint/access/var/vector.spvasm.expected.wgsl +++ b/test/tint/access/var/vector.spvasm.expected.wgsl @@ -1,10 +1,10 @@ fn main_1() { - var v : vec3f = vec3f(); - let x_14 : f32 = v.y; - let x_16 : vec3f = v; - let x_17 : vec2f = vec2f(x_16.x, x_16.z); - let x_18 : vec3f = v; - let x_19 : vec3f = vec3f(x_18.x, x_18.z, x_18.y); + var v = vec3f(); + let x_14 = v.y; + let x_16 = v; + let x_17 = vec2f(x_16.x, x_16.z); + let x_18 = v; + let x_19 = vec3f(x_18.x, x_18.z, x_18.y); return; } diff --git a/test/tint/array/strides.spvasm.expected.wgsl b/test/tint/array/strides.spvasm.expected.wgsl index bd82154f62..d3daca341e 100644 --- a/test/tint/array/strides.spvasm.expected.wgsl +++ b/test/tint/array/strides.spvasm.expected.wgsl @@ -22,10 +22,10 @@ struct S { @group(0) @binding(0) var s : S; fn f_1() { - let x_19 : Arr_2 = s.a; - let x_24 : Arr_1 = s.a[3i].el; - let x_28 : Arr = s.a[3i].el[2i]; - let x_32 : f32 = s.a[3i].el[2i][1i].el; + let x_19 = s.a; + let x_24 = s.a[3i].el; + let x_28 = s.a[3i].el[2i]; + let x_32 = s.a[3i].el[2i][1i].el; s.a = array(); s.a[3i].el[2i][1i].el = 5.0f; return; diff --git a/test/tint/bug/oss-fuzz/57795.spv.expected.wgsl b/test/tint/bug/oss-fuzz/57795.spv.expected.wgsl index 026a9ebbf4..7b2f976c64 100644 --- a/test/tint/bug/oss-fuzz/57795.spv.expected.wgsl +++ b/test/tint/bug/oss-fuzz/57795.spv.expected.wgsl @@ -34,7 +34,7 @@ const x_72 = vec4f(0.0f, 0.0f, 0.0f, 0.0f); const x_73 = mat4x4f(x_72, x_72, x_72, x_72); -var x_75 : array = array(x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73); +var x_75 = array(x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73, x_73); const x_77 = vec3f(0.0f, 0.0f, 0.0f); @@ -42,12 +42,12 @@ const x_78 = array(x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x const x_80 = S_6(array, 13u>(x_78, x_78, x_78, x_78, x_78, x_78, x_78, x_78, x_78, x_78, x_78, x_78, x_78)); -var x_82 : array = array(x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80); +var x_82 = array(x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80, x_80); -var x_85 : array = array(x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77); +var x_85 = array(x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77, x_77); fn main_1() { - let x_88 : u32 = 58u; + let x_88 = 58u; return; } diff --git a/test/tint/bug/tint/1061.spvasm.expected.wgsl b/test/tint/bug/tint/1061.spvasm.expected.wgsl index 016c549861..88344a0b4b 100644 --- a/test/tint/bug/tint/1061.spvasm.expected.wgsl +++ b/test/tint/bug/tint/1061.spvasm.expected.wgsl @@ -11,13 +11,13 @@ fn main_1() { var f : f32; var v : vec4f; f = determinant(mat3x3f(vec3f(1.0f, 0.0f, 0.0f), vec3f(0.0f, 1.0f, 0.0f), vec3f(0.0f, 0.0f, 1.0f))); - let x_33 : f32 = f; - let x_35 : f32 = f; - let x_37 : f32 = f; - let x_39 : f32 = f; + let x_33 = f; + let x_35 = f; + let x_37 = f; + let x_39 = f; v = vec4f(sin(x_33), cos(x_35), exp2(x_37), log(x_39)); - let x_42 : vec4f = v; - let x_44 : vec4f = x_7.r; + let x_42 = v; + let x_44 = x_7.r; if ((distance(x_42, x_44) < 0.10000000149011611938f)) { x_GLF_color = vec4f(1.0f, 0.0f, 0.0f, 1.0f); } else { diff --git a/test/tint/bug/tint/1088.spvasm.expected.wgsl b/test/tint/bug/tint/1088.spvasm.expected.wgsl index 1db30f9668..235d3aa343 100644 --- a/test/tint/bug/tint/1088.spvasm.expected.wgsl +++ b/test/tint/bug/tint/1088.spvasm.expected.wgsl @@ -33,24 +33,24 @@ var gl_Position : vec4f; fn main_1() { var q : vec4f; var p : vec3f; - let x_13 : vec3f = position_1; + let x_13 = position_1; q = vec4f(x_13.x, x_13.y, x_13.z, 1.0f); - let x_21 : vec4f = q; + let x_21 = q; p = vec3f(x_21.x, x_21.y, x_21.z); - let x_27 : f32 = p.x; - let x_41 : f32 = x_14.test[0i].el; - let x_45 : f32 = position_1.y; - let x_49 : f32 = x_14.time; + let x_27 = p.x; + let x_41 = x_14.test[0i].el; + let x_45 = position_1.y; + let x_49 = x_14.time; p.x = (x_27 + sin(((x_41 * x_45) + x_49))); - let x_55 : f32 = p.y; - let x_57 : f32 = x_14.time; + let x_55 = p.y; + let x_57 = x_14.time; p.y = (x_55 + sin((x_57 + 4.0f))); - let x_69 : mat4x4f = x_14.worldViewProjection; - let x_70 : vec3f = p; + let x_69 = x_14.worldViewProjection; + let x_70 = p; gl_Position = (x_69 * vec4f(x_70.x, x_70.y, x_70.z, 1.0f)); - let x_83 : vec2f = uv; + let x_83 = uv; vUV = x_83; - let x_87 : f32 = gl_Position.y; + let x_87 = gl_Position.y; gl_Position.y = (x_87 * -1.0f); return; } diff --git a/test/tint/bug/tint/1520.spvasm.expected.wgsl b/test/tint/bug/tint/1520.spvasm.expected.wgsl index bfad42b00f..1d771cda7c 100644 --- a/test/tint/bug/tint/1520.spvasm.expected.wgsl +++ b/test/tint/bug/tint/1520.spvasm.expected.wgsl @@ -35,8 +35,8 @@ fn test_int_S1_c0_b() -> bool { var x_55 : bool; var x_65 : bool; var x_66 : bool; - let x_26 : f32 = x_4.unknownInput_S1_c0; - let x_27 : i32 = i32(x_26); + let x_26 = x_4.unknownInput_S1_c0; + let x_27 = i32(x_26); unknown = x_27; ok = true; x_41 = false; @@ -45,15 +45,15 @@ fn test_int_S1_c0_b() -> bool { x_41 = x_40; } ok = x_41; - let x_44 : vec4i = vec4i(x_27, x_27, x_27, x_27); + let x_44 = vec4i(x_27, x_27, x_27, x_27); val = x_44; - let x_47 : vec4i = (x_44 + x_46); + let x_47 = (x_44 + x_46); val = x_47; - let x_48 : vec4i = (x_47 - x_46); + let x_48 = (x_47 - x_46); val = x_48; - let x_49 : vec4i = (x_48 + x_46); + let x_49 = (x_48 + x_46); val = x_49; - let x_50 : vec4i = (x_49 - x_46); + let x_50 = (x_49 - x_46); val = x_50; x_55 = false; if (x_41) { @@ -61,13 +61,13 @@ fn test_int_S1_c0_b() -> bool { x_55 = x_54; } ok = x_55; - let x_58 : vec4i = (x_50 * x_57); + let x_58 = (x_50 * x_57); val = x_58; - let x_59 : vec4i = (x_58 / x_57); + let x_59 = (x_58 / x_57); val = x_59; - let x_60 : vec4i = (x_59 * x_57); + let x_60 = (x_59 * x_57); val = x_60; - let x_61 : vec4i = (x_60 / x_57); + let x_61 = (x_60 / x_57); val = x_61; x_66 = false; if (x_55) { @@ -99,9 +99,9 @@ fn main_1() { var x_111 : bool; var x_114 : bool; var x_115 : bool; - let x_72 : vec4f = vcolor_S0; + let x_72 = vcolor_S0; outputColor_S0 = x_72; - let x_77 : f32 = x_4.unknownInput_S1_c0; + let x_77 = x_4.unknownInput_S1_c0; x_8_unknown = x_77; x_9_ok = true; x_87 = false; @@ -110,15 +110,15 @@ fn main_1() { x_87 = x_86; } x_9_ok = x_87; - let x_89 : vec4f = vec4f(x_77, x_77, x_77, x_77); + let x_89 = vec4f(x_77, x_77, x_77, x_77); x_10_val = x_89; - let x_92 : vec4f = (x_89 + x_91); + let x_92 = (x_89 + x_91); x_10_val = x_92; - let x_93 : vec4f = (x_92 - x_91); + let x_93 = (x_92 - x_91); x_10_val = x_93; - let x_94 : vec4f = (x_93 + x_91); + let x_94 = (x_93 + x_91); x_10_val = x_94; - let x_95 : vec4f = (x_94 - x_91); + let x_95 = (x_94 - x_91); x_10_val = x_95; x_100 = false; if (x_87) { @@ -126,13 +126,13 @@ fn main_1() { x_100 = x_99; } x_9_ok = x_100; - let x_103 : vec4f = (x_95 * x_102); + let x_103 = (x_95 * x_102); x_10_val = x_103; - let x_104 : vec4f = (x_103 / x_102); + let x_104 = (x_103 / x_102); x_10_val = x_104; - let x_105 : vec4f = (x_104 * x_102); + let x_105 = (x_104 * x_102); x_10_val = x_105; - let x_106 : vec4f = (x_105 / x_102); + let x_106 = (x_105 / x_102); x_10_val = x_106; x_111 = false; if (x_100) { @@ -146,13 +146,13 @@ fn main_1() { x_115 = x_114; } if (x_115) { - let x_122 : vec4f = x_4.ucolorGreen_S1_c0; + let x_122 = x_4.ucolorGreen_S1_c0; x_116 = x_122; } else { - let x_124 : vec4f = x_4.ucolorRed_S1_c0; + let x_124 = x_4.ucolorRed_S1_c0; x_116 = x_124; } - let x_125 : vec4f = x_116; + let x_125 = x_116; output_S1 = x_125; sk_FragColor = x_125; return; diff --git a/test/tint/bug/tint/1670.spvasm.expected.wgsl b/test/tint/bug/tint/1670.spvasm.expected.wgsl index ff35a02b7a..564b443c79 100644 --- a/test/tint/bug/tint/1670.spvasm.expected.wgsl +++ b/test/tint/bug/tint/1670.spvasm.expected.wgsl @@ -5,13 +5,13 @@ fn main_1() { var m3 : mat3x3f; var m4i : mat4x4f; var m4 : mat4x4f; - let x_12 : mat2x2f = m2; + let x_12 = m2; let s = (1.0f / determinant(x_12)); m2i = mat2x2f(vec2f((s * x_12[1u][1u]), (-(s) * x_12[0u][1u])), vec2f((-(s) * x_12[1u][0u]), (s * x_12[0u][0u]))); - let x_19 : mat3x3f = m3; + let x_19 = m3; let s_1 = (1.0f / determinant(x_19)); m3i = (s_1 * mat3x3f(vec3f(((x_19[1u][1u] * x_19[2u][2u]) - (x_19[1u][2u] * x_19[2u][1u])), ((x_19[0u][2u] * x_19[2u][1u]) - (x_19[0u][1u] * x_19[2u][2u])), ((x_19[0u][1u] * x_19[1u][2u]) - (x_19[0u][2u] * x_19[1u][1u]))), vec3f(((x_19[1u][2u] * x_19[2u][0u]) - (x_19[1u][0u] * x_19[2u][2u])), ((x_19[0u][0u] * x_19[2u][2u]) - (x_19[0u][2u] * x_19[2u][0u])), ((x_19[0u][2u] * x_19[1u][0u]) - (x_19[0u][0u] * x_19[1u][2u]))), vec3f(((x_19[1u][0u] * x_19[2u][1u]) - (x_19[1u][1u] * x_19[2u][0u])), ((x_19[0u][1u] * x_19[2u][0u]) - (x_19[0u][0u] * x_19[2u][1u])), ((x_19[0u][0u] * x_19[1u][1u]) - (x_19[0u][1u] * x_19[1u][0u]))))); - let x_26 : mat4x4f = m4; + let x_26 = m4; let s_2 = (1.0f / determinant(x_26)); m4i = (s_2 * mat4x4f(vec4f((((x_26[1u][1u] * ((x_26[2u][2u] * x_26[3u][3u]) - (x_26[2u][3u] * x_26[3u][2u]))) - (x_26[1u][2u] * ((x_26[2u][1u] * x_26[3u][3u]) - (x_26[2u][3u] * x_26[3u][1u])))) + (x_26[1u][3u] * ((x_26[2u][1u] * x_26[3u][2u]) - (x_26[2u][2u] * x_26[3u][1u])))), (((-(x_26[0u][1u]) * ((x_26[2u][2u] * x_26[3u][3u]) - (x_26[2u][3u] * x_26[3u][2u]))) + (x_26[0u][2u] * ((x_26[2u][1u] * x_26[3u][3u]) - (x_26[2u][3u] * x_26[3u][1u])))) - (x_26[0u][3u] * ((x_26[2u][1u] * x_26[3u][2u]) - (x_26[2u][2u] * x_26[3u][1u])))), (((x_26[0u][1u] * ((x_26[1u][2u] * x_26[3u][3u]) - (x_26[1u][3u] * x_26[3u][2u]))) - (x_26[0u][2u] * ((x_26[1u][1u] * x_26[3u][3u]) - (x_26[1u][3u] * x_26[3u][1u])))) + (x_26[0u][3u] * ((x_26[1u][1u] * x_26[3u][2u]) - (x_26[1u][2u] * x_26[3u][1u])))), (((-(x_26[0u][1u]) * ((x_26[1u][2u] * x_26[2u][3u]) - (x_26[1u][3u] * x_26[2u][2u]))) + (x_26[0u][2u] * ((x_26[1u][1u] * x_26[2u][3u]) - (x_26[1u][3u] * x_26[2u][1u])))) - (x_26[0u][3u] * ((x_26[1u][1u] * x_26[2u][2u]) - (x_26[1u][2u] * x_26[2u][1u]))))), vec4f((((-(x_26[1u][0u]) * ((x_26[2u][2u] * x_26[3u][3u]) - (x_26[2u][3u] * x_26[3u][2u]))) + (x_26[1u][2u] * ((x_26[2u][0u] * x_26[3u][3u]) - (x_26[2u][3u] * x_26[3u][0u])))) - (x_26[1u][3u] * ((x_26[2u][0u] * x_26[3u][2u]) - (x_26[2u][2u] * x_26[3u][0u])))), (((x_26[0u][0u] * ((x_26[2u][2u] * x_26[3u][3u]) - (x_26[2u][3u] * x_26[3u][2u]))) - (x_26[0u][2u] * ((x_26[2u][0u] * x_26[3u][3u]) - (x_26[2u][3u] * x_26[3u][0u])))) + (x_26[0u][3u] * ((x_26[2u][0u] * x_26[3u][2u]) - (x_26[2u][2u] * x_26[3u][0u])))), (((-(x_26[0u][0u]) * ((x_26[1u][2u] * x_26[3u][3u]) - (x_26[1u][3u] * x_26[3u][2u]))) + (x_26[0u][2u] * ((x_26[1u][0u] * x_26[3u][3u]) - (x_26[1u][3u] * x_26[3u][0u])))) - (x_26[0u][3u] * ((x_26[1u][0u] * x_26[3u][2u]) - (x_26[1u][2u] * x_26[3u][0u])))), (((x_26[0u][0u] * ((x_26[1u][2u] * x_26[2u][3u]) - (x_26[1u][3u] * x_26[2u][2u]))) - (x_26[0u][2u] * ((x_26[1u][0u] * x_26[2u][3u]) - (x_26[1u][3u] * x_26[2u][0u])))) + (x_26[0u][3u] * ((x_26[1u][0u] * x_26[2u][2u]) - (x_26[1u][2u] * x_26[2u][0u]))))), vec4f((((x_26[1u][0u] * ((x_26[2u][1u] * x_26[3u][3u]) - (x_26[2u][3u] * x_26[3u][1u]))) - (x_26[1u][1u] * ((x_26[2u][0u] * x_26[3u][3u]) - (x_26[2u][3u] * x_26[3u][0u])))) + (x_26[1u][3u] * ((x_26[2u][0u] * x_26[3u][1u]) - (x_26[2u][1u] * x_26[3u][0u])))), (((-(x_26[0u][0u]) * ((x_26[2u][1u] * x_26[3u][3u]) - (x_26[2u][3u] * x_26[3u][1u]))) + (x_26[0u][1u] * ((x_26[2u][0u] * x_26[3u][3u]) - (x_26[2u][3u] * x_26[3u][0u])))) - (x_26[0u][3u] * ((x_26[2u][0u] * x_26[3u][1u]) - (x_26[2u][1u] * x_26[3u][0u])))), (((x_26[0u][0u] * ((x_26[1u][1u] * x_26[3u][3u]) - (x_26[1u][3u] * x_26[3u][1u]))) - (x_26[0u][1u] * ((x_26[1u][0u] * x_26[3u][3u]) - (x_26[1u][3u] * x_26[3u][0u])))) + (x_26[0u][3u] * ((x_26[1u][0u] * x_26[3u][1u]) - (x_26[1u][1u] * x_26[3u][0u])))), (((-(x_26[0u][0u]) * ((x_26[1u][1u] * x_26[2u][3u]) - (x_26[1u][3u] * x_26[2u][1u]))) + (x_26[0u][1u] * ((x_26[1u][0u] * x_26[2u][3u]) - (x_26[1u][3u] * x_26[2u][0u])))) - (x_26[0u][3u] * ((x_26[1u][0u] * x_26[2u][1u]) - (x_26[1u][1u] * x_26[2u][0u]))))), vec4f((((-(x_26[1u][0u]) * ((x_26[2u][1u] * x_26[3u][2u]) - (x_26[2u][2u] * x_26[3u][1u]))) + (x_26[1u][1u] * ((x_26[2u][0u] * x_26[3u][2u]) - (x_26[2u][2u] * x_26[3u][0u])))) - (x_26[1u][2u] * ((x_26[2u][0u] * x_26[3u][1u]) - (x_26[2u][1u] * x_26[3u][0u])))), (((x_26[0u][0u] * ((x_26[2u][1u] * x_26[3u][2u]) - (x_26[2u][2u] * x_26[3u][1u]))) - (x_26[0u][1u] * ((x_26[2u][0u] * x_26[3u][2u]) - (x_26[2u][2u] * x_26[3u][0u])))) + (x_26[0u][2u] * ((x_26[2u][0u] * x_26[3u][1u]) - (x_26[2u][1u] * x_26[3u][0u])))), (((-(x_26[0u][0u]) * ((x_26[1u][1u] * x_26[3u][2u]) - (x_26[1u][2u] * x_26[3u][1u]))) + (x_26[0u][1u] * ((x_26[1u][0u] * x_26[3u][2u]) - (x_26[1u][2u] * x_26[3u][0u])))) - (x_26[0u][2u] * ((x_26[1u][0u] * x_26[3u][1u]) - (x_26[1u][1u] * x_26[3u][0u])))), (((x_26[0u][0u] * ((x_26[1u][1u] * x_26[2u][2u]) - (x_26[1u][2u] * x_26[2u][1u]))) - (x_26[0u][1u] * ((x_26[1u][0u] * x_26[2u][2u]) - (x_26[1u][2u] * x_26[2u][0u])))) + (x_26[0u][2u] * ((x_26[1u][0u] * x_26[2u][1u]) - (x_26[1u][1u] * x_26[2u][0u]))))))); return; diff --git a/test/tint/bug/tint/1776.spvasm.expected.wgsl b/test/tint/bug/tint/1776.spvasm.expected.wgsl index d1d383ef0c..f9988fa5b2 100644 --- a/test/tint/bug/tint/1776.spvasm.expected.wgsl +++ b/test/tint/bug/tint/1776.spvasm.expected.wgsl @@ -15,7 +15,7 @@ struct sb_block { @group(0) @binding(0) var sb : sb_block; fn main_1() { - let x_18 : S = sb.inner[1i]; + let x_18 = sb.inner[1i]; return; } diff --git a/test/tint/bug/tint/1932.spvasm.expected.wgsl b/test/tint/bug/tint/1932.spvasm.expected.wgsl index 4bc74a3ccf..5216558ffc 100644 --- a/test/tint/bug/tint/1932.spvasm.expected.wgsl +++ b/test/tint/bug/tint/1932.spvasm.expected.wgsl @@ -1,8 +1,8 @@ const x_22 = vec2f(2.0f, 2.0f); fn main_1() { - let distance_1 : vec2f = x_22; - let x_10 : f32 = distance(distance_1, x_22); + let distance_1 = x_22; + let x_10 = distance(distance_1, x_22); return; } diff --git a/test/tint/bug/tint/219.spvasm.expected.wgsl b/test/tint/bug/tint/219.spvasm.expected.wgsl index d8e9d45493..3730f00188 100644 --- a/test/tint/bug/tint/219.spvasm.expected.wgsl +++ b/test/tint/bug/tint/219.spvasm.expected.wgsl @@ -1,11 +1,11 @@ fn x_200(x_201 : ptr) -> f32 { - let x_212 : f32 = (*(x_201)).x; + let x_212 = (*(x_201)).x; return x_212; } fn main_1() { var x_11 : vec2f; - let x_12 : f32 = x_200(&(x_11)); + let x_12 = x_200(&(x_11)); return; } diff --git a/test/tint/bug/tint/413.spvasm.expected.wgsl b/test/tint/bug/tint/413.spvasm.expected.wgsl index 2b8773e7fe..7fa44f359a 100644 --- a/test/tint/bug/tint/413.spvasm.expected.wgsl +++ b/test/tint/bug/tint/413.spvasm.expected.wgsl @@ -6,11 +6,11 @@ const x_17 = vec2i(0i, 0i); fn main_1() { var srcValue : vec4u; - let x_18 : vec4u = textureLoad(Src, x_17, 0i); + let x_18 = textureLoad(Src, x_17, 0i); srcValue = x_18; - let x_22 : u32 = srcValue.x; + let x_22 = srcValue.x; srcValue.x = (x_22 + bitcast(1i)); - let x_27 : vec4u = srcValue; + let x_27 = srcValue; textureStore(Dst, x_17, x_27); return; } diff --git a/test/tint/bug/tint/870.spvasm.expected.wgsl b/test/tint/bug/tint/870.spvasm.expected.wgsl index 2f586595fc..8a283eba7a 100644 --- a/test/tint/bug/tint/870.spvasm.expected.wgsl +++ b/test/tint/bug/tint/870.spvasm.expected.wgsl @@ -20,7 +20,7 @@ struct x_B4_BuildInformation { fn main_1() { var orientation : array; - let x_23 : Arr = sspp962805860buildInformation.passthru.orientation; + let x_23 = sspp962805860buildInformation.passthru.orientation; orientation[0i] = x_23[0u]; orientation[1i] = x_23[1u]; orientation[2i] = x_23[2u]; diff --git a/test/tint/bug/tint/977.spvasm.expected.wgsl b/test/tint/bug/tint/977.spvasm.expected.wgsl index d4650155b9..8e71e787fd 100644 --- a/test/tint/bug/tint/977.spvasm.expected.wgsl +++ b/test/tint/bug/tint/977.spvasm.expected.wgsl @@ -40,22 +40,22 @@ var gl_GlobalInvocationID : vec3u; fn binaryOperation_f1_f1_(a : ptr, b : ptr) -> f32 { var x_26 : f32; - let x_13 : f32 = *(b); + let x_13 = *(b); if ((x_13 == 0.0f)) { return 1.0f; } - let x_21 : f32 = *(b); + let x_21 = *(b); if (!((round((x_21 - (2.0f * floor((x_21 / 2.0f))))) == 1.0f))) { - let x_29 : f32 = *(a); - let x_31 : f32 = *(b); + let x_29 = *(a); + let x_31 = *(b); x_26 = pow(abs(x_29), x_31); } else { - let x_34 : f32 = *(a); - let x_36 : f32 = *(a); - let x_38 : f32 = *(b); + let x_34 = *(a); + let x_36 = *(a); + let x_38 = *(b); x_26 = (sign(x_34) * pow(abs(x_36), x_38)); } - let x_41 : f32 = x_26; + let x_41 = x_26; return x_41; } @@ -64,13 +64,13 @@ fn main_1() { var a_1 : i32; var param : f32; var param_1 : f32; - let x_54 : u32 = gl_GlobalInvocationID.x; + let x_54 = gl_GlobalInvocationID.x; index = bitcast(x_54); a_1 = -10i; - let x_63 : i32 = index; + let x_63 = index; param = -4.0f; param_1 = -3.0f; - let x_68 : f32 = binaryOperation_f1_f1_(&(param), &(param_1)); + let x_68 = binaryOperation_f1_f1_(&(param), &(param_1)); resultMatrix.numbers[x_63] = x_68; return; } diff --git a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.wgsl b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.wgsl index cab082308b..bce030562c 100644 --- a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.wgsl +++ b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.wgsl @@ -9,20 +9,20 @@ var local_invocation_index_1 : u32; var wg : array, 1u>, 2u>, 3u>; fn compute_main_inner(local_invocation_index_2 : u32) { - var idx : u32 = 0u; + var idx = 0u; idx = local_invocation_index_2; loop { - let x_25 : u32 = idx; + let x_25 = idx; if (!((x_25 < 6u))) { break; } - let x_31 : u32 = idx; - let x_33 : u32 = idx; - let x_35 : u32 = idx; + let x_31 = idx; + let x_33 = idx; + let x_35 = idx; atomicStore(&(wg[(x_31 / 2u)][(x_33 % 2u)][(x_35 % 1u)]), 0u); continuing { - let x_42 : u32 = idx; + let x_42 = idx; idx = (x_42 + 1u); } } @@ -32,7 +32,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_57 : u32 = local_invocation_index_1; + let x_57 = local_invocation_index_1; compute_main_inner(x_57); return; } diff --git a/test/tint/builtins/atomicStore/array/array.spvasm.expected.wgsl b/test/tint/builtins/atomicStore/array/array.spvasm.expected.wgsl index 6b51227140..cef44f0299 100644 --- a/test/tint/builtins/atomicStore/array/array.spvasm.expected.wgsl +++ b/test/tint/builtins/atomicStore/array/array.spvasm.expected.wgsl @@ -5,18 +5,18 @@ var local_invocation_index_1 : u32; var wg : array, 4u>; fn compute_main_inner(local_invocation_index_2 : u32) { - var idx : u32 = 0u; + var idx = 0u; idx = local_invocation_index_2; loop { - let x_21 : u32 = idx; + let x_21 = idx; if (!((x_21 < 4u))) { break; } - let x_26 : u32 = idx; + let x_26 = idx; atomicStore(&(wg[x_26]), 0u); continuing { - let x_33 : u32 = idx; + let x_33 = idx; idx = (x_33 + 1u); } } @@ -26,7 +26,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_47 : u32 = local_invocation_index_1; + let x_47 = local_invocation_index_1; compute_main_inner(x_47); return; } diff --git a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.wgsl b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.wgsl index cab082308b..bce030562c 100644 --- a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.wgsl +++ b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.wgsl @@ -9,20 +9,20 @@ var local_invocation_index_1 : u32; var wg : array, 1u>, 2u>, 3u>; fn compute_main_inner(local_invocation_index_2 : u32) { - var idx : u32 = 0u; + var idx = 0u; idx = local_invocation_index_2; loop { - let x_25 : u32 = idx; + let x_25 = idx; if (!((x_25 < 6u))) { break; } - let x_31 : u32 = idx; - let x_33 : u32 = idx; - let x_35 : u32 = idx; + let x_31 = idx; + let x_33 = idx; + let x_35 = idx; atomicStore(&(wg[(x_31 / 2u)][(x_33 % 2u)][(x_35 % 1u)]), 0u); continuing { - let x_42 : u32 = idx; + let x_42 = idx; idx = (x_42 + 1u); } } @@ -32,7 +32,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_57 : u32 = local_invocation_index_1; + let x_57 = local_invocation_index_1; compute_main_inner(x_57); return; } diff --git a/test/tint/builtins/atomicStore/struct/array_of_struct.spvasm.expected.wgsl b/test/tint/builtins/atomicStore/struct/array_of_struct.spvasm.expected.wgsl index 81a23a5f90..96194e94a9 100644 --- a/test/tint/builtins/atomicStore/struct/array_of_struct.spvasm.expected.wgsl +++ b/test/tint/builtins/atomicStore/struct/array_of_struct.spvasm.expected.wgsl @@ -23,20 +23,20 @@ var local_invocation_index_1 : u32; var wg : array; fn compute_main_inner(local_invocation_index_2 : u32) { - var idx : u32 = 0u; + var idx = 0u; idx = local_invocation_index_2; loop { - let x_23 : u32 = idx; + let x_23 = idx; if (!((x_23 < 10u))) { break; } - let x_28 : u32 = idx; + let x_28 = idx; wg[x_28].x = 0i; atomicStore(&(wg[x_28].a), 0u); wg[x_28].y = 0u; continuing { - let x_41 : u32 = idx; + let x_41 = idx; idx = (x_41 + 1u); } } @@ -46,7 +46,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_53 : u32 = local_invocation_index_1; + let x_53 = local_invocation_index_1; compute_main_inner(x_53); return; } diff --git a/test/tint/builtins/atomicStore/struct/flat_multiple_atomics.spvasm.expected.wgsl b/test/tint/builtins/atomicStore/struct/flat_multiple_atomics.spvasm.expected.wgsl index 3f9e97bf9d..498386f96d 100644 --- a/test/tint/builtins/atomicStore/struct/flat_multiple_atomics.spvasm.expected.wgsl +++ b/test/tint/builtins/atomicStore/struct/flat_multiple_atomics.spvasm.expected.wgsl @@ -31,7 +31,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_39 : u32 = local_invocation_index_1; + let x_39 = local_invocation_index_1; compute_main_inner(x_39); return; } diff --git a/test/tint/builtins/atomicStore/struct/flat_single_atomic.spvasm.expected.wgsl b/test/tint/builtins/atomicStore/struct/flat_single_atomic.spvasm.expected.wgsl index 5180091389..4110d94ca8 100644 --- a/test/tint/builtins/atomicStore/struct/flat_single_atomic.spvasm.expected.wgsl +++ b/test/tint/builtins/atomicStore/struct/flat_single_atomic.spvasm.expected.wgsl @@ -30,7 +30,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_35 : u32 = local_invocation_index_1; + let x_35 = local_invocation_index_1; compute_main_inner(x_35); return; } diff --git a/test/tint/builtins/atomicStore/struct/nested.spvasm.expected.wgsl b/test/tint/builtins/atomicStore/struct/nested.spvasm.expected.wgsl index 268d74fe41..e400b04340 100644 --- a/test/tint/builtins/atomicStore/struct/nested.spvasm.expected.wgsl +++ b/test/tint/builtins/atomicStore/struct/nested.spvasm.expected.wgsl @@ -85,7 +85,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_44 : u32 = local_invocation_index_1; + let x_44 = local_invocation_index_1; compute_main_inner(x_44); return; } diff --git a/test/tint/builtins/atomicStore/struct/struct_of_array.spvasm.expected.wgsl b/test/tint/builtins/atomicStore/struct/struct_of_array.spvasm.expected.wgsl index d03070cb52..a867eda4bd 100644 --- a/test/tint/builtins/atomicStore/struct/struct_of_array.spvasm.expected.wgsl +++ b/test/tint/builtins/atomicStore/struct/struct_of_array.spvasm.expected.wgsl @@ -23,20 +23,20 @@ var local_invocation_index_1 : u32; var wg : S_atomic; fn compute_main_inner(local_invocation_index_2 : u32) { - var idx : u32 = 0u; + var idx = 0u; wg.x = 0i; wg.y = 0u; idx = local_invocation_index_2; loop { - let x_30 : u32 = idx; + let x_30 = idx; if (!((x_30 < 10u))) { break; } - let x_35 : u32 = idx; + let x_35 = idx; atomicStore(&(wg.a[x_35]), 0u); continuing { - let x_41 : u32 = idx; + let x_41 = idx; idx = (x_41 + 1u); } } @@ -46,7 +46,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_53 : u32 = local_invocation_index_1; + let x_53 = local_invocation_index_1; compute_main_inner(x_53); return; } diff --git a/test/tint/builtins/atomicStore/struct/via_ptr_let.spvasm.expected.wgsl b/test/tint/builtins/atomicStore/struct/via_ptr_let.spvasm.expected.wgsl index 5180091389..4110d94ca8 100644 --- a/test/tint/builtins/atomicStore/struct/via_ptr_let.spvasm.expected.wgsl +++ b/test/tint/builtins/atomicStore/struct/via_ptr_let.spvasm.expected.wgsl @@ -30,7 +30,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_35 : u32 = local_invocation_index_1; + let x_35 = local_invocation_index_1; compute_main_inner(x_35); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.wgsl index 13dd085365..f8c3621782 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAdd_d32fe4() { - var res : i32 = 0i; - let x_9 : i32 = atomicAdd(&(sb_rw.arg_0), 1i); + var res = 0i; + let x_9 = atomicAdd(&(sb_rw.arg_0), 1i); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.wgsl index c6e4f53ef2..c26ffeb8c2 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAdd_8a199a() { - var res : u32 = 0u; - let x_9 : u32 = atomicAdd(&(sb_rw.arg_0), 1u); + var res = 0u; + let x_9 = atomicAdd(&(sb_rw.arg_0), 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/workgroup_i32.spvasm.expected.wgsl index d59a523473..64920e2ab1 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/workgroup_i32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAdd_794055() { - var res : i32 = 0i; - let x_11 : i32 = atomicAdd(&(arg_0), 1i); + var res = 0i; + let x_11 = atomicAdd(&(arg_0), 1i); res = x_11; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_31 : u32 = local_invocation_index_1; + let x_31 = local_invocation_index_1; compute_main_inner(x_31); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/workgroup_u32.spvasm.expected.wgsl index 5a1db0ecf7..bbb74d484d 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/workgroup_u32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAdd_d5db1d() { - var res : u32 = 0u; - let x_10 : u32 = atomicAdd(&(arg_0), 1u); + var res = 0u; + let x_10 = atomicAdd(&(arg_0), 1u); res = x_10; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_30 : u32 = local_invocation_index_1; + let x_30 = local_invocation_index_1; compute_main_inner(x_30); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.wgsl index fa4790ba84..fe0bf79347 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAnd_152966() { - var res : i32 = 0i; - let x_9 : i32 = atomicAnd(&(sb_rw.arg_0), 1i); + var res = 0i; + let x_9 = atomicAnd(&(sb_rw.arg_0), 1i); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.wgsl index a7c316a9bd..73cabbc90d 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAnd_85a8d9() { - var res : u32 = 0u; - let x_9 : u32 = atomicAnd(&(sb_rw.arg_0), 1u); + var res = 0u; + let x_9 = atomicAnd(&(sb_rw.arg_0), 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/workgroup_i32.spvasm.expected.wgsl index 7ac8d286ae..f2948b248c 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/workgroup_i32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAnd_45a819() { - var res : i32 = 0i; - let x_11 : i32 = atomicAnd(&(arg_0), 1i); + var res = 0i; + let x_11 = atomicAnd(&(arg_0), 1i); res = x_11; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_31 : u32 = local_invocation_index_1; + let x_31 = local_invocation_index_1; compute_main_inner(x_31); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/workgroup_u32.spvasm.expected.wgsl index a077ce7348..1f9311b612 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/workgroup_u32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAnd_34edd3() { - var res : u32 = 0u; - let x_10 : u32 = atomicAnd(&(arg_0), 1u); + var res = 0u; + let x_10 = atomicAnd(&(arg_0), 1u); res = x_10; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_30 : u32 = local_invocation_index_1; + let x_30 = local_invocation_index_1; compute_main_inner(x_30); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.wgsl index fb78b80ab5..4355b9319a 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.wgsl @@ -18,9 +18,9 @@ struct x__atomic_compare_exchange_resulti32 { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicCompareExchangeWeak_1bd40a() { - var res : x__atomic_compare_exchange_resulti32 = x__atomic_compare_exchange_resulti32(0i, false); + var res = x__atomic_compare_exchange_resulti32(0i, false); let old_value_1 = atomicCompareExchangeWeak(&(sb_rw.arg_0), 1i, 1i).old_value; - let x_19 : i32 = old_value_1; + let x_19 = old_value_1; res = x__atomic_compare_exchange_resulti32(x_19, (x_19 == 1i)); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.wgsl index acb5674caf..4b31dec081 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.wgsl @@ -18,9 +18,9 @@ struct x__atomic_compare_exchange_resultu32 { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicCompareExchangeWeak_63d8e6() { - var res : x__atomic_compare_exchange_resultu32 = x__atomic_compare_exchange_resultu32(0u, false); + var res = x__atomic_compare_exchange_resultu32(0u, false); let old_value_1 = atomicCompareExchangeWeak(&(sb_rw.arg_0), 1u, 1u).old_value; - let x_17 : u32 = old_value_1; + let x_17 = old_value_1; res = x__atomic_compare_exchange_resultu32(x_17, (x_17 == 1u)); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.wgsl index 4104721006..703c4e50c7 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.wgsl @@ -10,9 +10,9 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicCompareExchangeWeak_e88938() { - var res : x__atomic_compare_exchange_resulti32 = x__atomic_compare_exchange_resulti32(0i, false); + var res = x__atomic_compare_exchange_resulti32(0i, false); let old_value_1 = atomicCompareExchangeWeak(&(arg_0), 1i, 1i).old_value; - let x_18 : i32 = old_value_1; + let x_18 = old_value_1; res = x__atomic_compare_exchange_resulti32(x_18, (x_18 == 1i)); return; } @@ -25,7 +25,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_36 : u32 = local_invocation_index_1; + let x_36 = local_invocation_index_1; compute_main_inner(x_36); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.wgsl index df6689483e..153618dfc2 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.wgsl @@ -10,9 +10,9 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicCompareExchangeWeak_83580d() { - var res : x__atomic_compare_exchange_resultu32 = x__atomic_compare_exchange_resultu32(0u, false); + var res = x__atomic_compare_exchange_resultu32(0u, false); let old_value_1 = atomicCompareExchangeWeak(&(arg_0), 1u, 1u).old_value; - let x_17 : u32 = old_value_1; + let x_17 = old_value_1; res = x__atomic_compare_exchange_resultu32(x_17, (x_17 == 1u)); return; } @@ -25,7 +25,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_35 : u32 = local_invocation_index_1; + let x_35 = local_invocation_index_1; compute_main_inner(x_35); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.wgsl index 540d5734e0..1c9a15e904 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicExchange_f2e22f() { - var res : i32 = 0i; - let x_9 : i32 = atomicExchange(&(sb_rw.arg_0), 1i); + var res = 0i; + let x_9 = atomicExchange(&(sb_rw.arg_0), 1i); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.wgsl index 86a83f3fd8..427b8646d9 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicExchange_d59712() { - var res : u32 = 0u; - let x_9 : u32 = atomicExchange(&(sb_rw.arg_0), 1u); + var res = 0u; + let x_9 = atomicExchange(&(sb_rw.arg_0), 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/workgroup_i32.spvasm.expected.wgsl index b8eb11a96b..5c8127836f 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/workgroup_i32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicExchange_e114ba() { - var res : i32 = 0i; - let x_11 : i32 = atomicExchange(&(arg_0), 1i); + var res = 0i; + let x_11 = atomicExchange(&(arg_0), 1i); res = x_11; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_31 : u32 = local_invocation_index_1; + let x_31 = local_invocation_index_1; compute_main_inner(x_31); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/workgroup_u32.spvasm.expected.wgsl index e52c9b7312..96efac1e2c 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/workgroup_u32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicExchange_0a5dca() { - var res : u32 = 0u; - let x_10 : u32 = atomicExchange(&(arg_0), 1u); + var res = 0u; + let x_10 = atomicExchange(&(arg_0), 1u); res = x_10; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_30 : u32 = local_invocation_index_1; + let x_30 = local_invocation_index_1; compute_main_inner(x_30); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.wgsl index 713ca8a454..29a0d2c31a 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicLoad_0806ad() { - var res : i32 = 0i; - let x_9 : i32 = atomicLoad(&(sb_rw.arg_0)); + var res = 0i; + let x_9 = atomicLoad(&(sb_rw.arg_0)); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.wgsl index 076cf38f6e..dad6639820 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicLoad_fe6cc3() { - var res : u32 = 0u; - let x_9 : u32 = atomicLoad(&(sb_rw.arg_0)); + var res = 0u; + let x_9 = atomicLoad(&(sb_rw.arg_0)); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/workgroup_i32.spvasm.expected.wgsl index ba60171363..e47aab1fc1 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/workgroup_i32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicLoad_afcc03() { - var res : i32 = 0i; - let x_11 : i32 = atomicLoad(&(arg_0)); + var res = 0i; + let x_11 = atomicLoad(&(arg_0)); res = x_11; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_30 : u32 = local_invocation_index_1; + let x_30 = local_invocation_index_1; compute_main_inner(x_30); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/workgroup_u32.spvasm.expected.wgsl index d9fd46d242..31e8fcc923 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/workgroup_u32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicLoad_361bf1() { - var res : u32 = 0u; - let x_10 : u32 = atomicLoad(&(arg_0)); + var res = 0u; + let x_10 = atomicLoad(&(arg_0)); res = x_10; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_29 : u32 = local_invocation_index_1; + let x_29 = local_invocation_index_1; compute_main_inner(x_29); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.wgsl index b6e2367dc6..f979548751 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicMax_92aa72() { - var res : i32 = 0i; - let x_9 : i32 = atomicMax(&(sb_rw.arg_0), 1i); + var res = 0i; + let x_9 = atomicMax(&(sb_rw.arg_0), 1i); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.wgsl index 8a7a1d5da0..731022ae85 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicMax_51b9be() { - var res : u32 = 0u; - let x_9 : u32 = atomicMax(&(sb_rw.arg_0), 1u); + var res = 0u; + let x_9 = atomicMax(&(sb_rw.arg_0), 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMax/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicMax/workgroup_i32.spvasm.expected.wgsl index 08ebe32bac..04d3c17134 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMax/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMax/workgroup_i32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicMax_a89cc3() { - var res : i32 = 0i; - let x_11 : i32 = atomicMax(&(arg_0), 1i); + var res = 0i; + let x_11 = atomicMax(&(arg_0), 1i); res = x_11; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_31 : u32 = local_invocation_index_1; + let x_31 = local_invocation_index_1; compute_main_inner(x_31); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMax/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicMax/workgroup_u32.spvasm.expected.wgsl index 759d72d0ea..fafd0e0029 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMax/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMax/workgroup_u32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicMax_beccfc() { - var res : u32 = 0u; - let x_10 : u32 = atomicMax(&(arg_0), 1u); + var res = 0u; + let x_10 = atomicMax(&(arg_0), 1u); res = x_10; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_30 : u32 = local_invocation_index_1; + let x_30 = local_invocation_index_1; compute_main_inner(x_30); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.wgsl index b5b5a4bafc..49ddef7abb 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicMin_8e38dc() { - var res : i32 = 0i; - let x_9 : i32 = atomicMin(&(sb_rw.arg_0), 1i); + var res = 0i; + let x_9 = atomicMin(&(sb_rw.arg_0), 1i); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.wgsl index 06d1469b7b..4a09f32631 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicMin_c67a74() { - var res : u32 = 0u; - let x_9 : u32 = atomicMin(&(sb_rw.arg_0), 1u); + var res = 0u; + let x_9 = atomicMin(&(sb_rw.arg_0), 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMin/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicMin/workgroup_i32.spvasm.expected.wgsl index 525b7f9cf2..48bd2dd662 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMin/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMin/workgroup_i32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicMin_278235() { - var res : i32 = 0i; - let x_11 : i32 = atomicMin(&(arg_0), 1i); + var res = 0i; + let x_11 = atomicMin(&(arg_0), 1i); res = x_11; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_31 : u32 = local_invocation_index_1; + let x_31 = local_invocation_index_1; compute_main_inner(x_31); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMin/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicMin/workgroup_u32.spvasm.expected.wgsl index 6b2873d983..610ff0d1bc 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMin/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMin/workgroup_u32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicMin_69d383() { - var res : u32 = 0u; - let x_10 : u32 = atomicMin(&(arg_0), 1u); + var res = 0u; + let x_10 = atomicMin(&(arg_0), 1u); res = x_10; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_30 : u32 = local_invocation_index_1; + let x_30 = local_invocation_index_1; compute_main_inner(x_30); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.wgsl index 42130b33c7..925f2a4e3c 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicOr_8d96a0() { - var res : i32 = 0i; - let x_9 : i32 = atomicOr(&(sb_rw.arg_0), 1i); + var res = 0i; + let x_9 = atomicOr(&(sb_rw.arg_0), 1i); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.wgsl index 7a5c53a2ce..59b76e1b46 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicOr_5e95d4() { - var res : u32 = 0u; - let x_9 : u32 = atomicOr(&(sb_rw.arg_0), 1u); + var res = 0u; + let x_9 = atomicOr(&(sb_rw.arg_0), 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicOr/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicOr/workgroup_i32.spvasm.expected.wgsl index 92c3719a74..e1724ed7ad 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicOr/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicOr/workgroup_i32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicOr_d09248() { - var res : i32 = 0i; - let x_11 : i32 = atomicOr(&(arg_0), 1i); + var res = 0i; + let x_11 = atomicOr(&(arg_0), 1i); res = x_11; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_31 : u32 = local_invocation_index_1; + let x_31 = local_invocation_index_1; compute_main_inner(x_31); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicOr/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicOr/workgroup_u32.spvasm.expected.wgsl index 773349a04c..799ff5efbd 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicOr/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicOr/workgroup_u32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicOr_5e3d61() { - var res : u32 = 0u; - let x_10 : u32 = atomicOr(&(arg_0), 1u); + var res = 0u; + let x_10 = atomicOr(&(arg_0), 1u); res = x_10; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_30 : u32 = local_invocation_index_1; + let x_30 = local_invocation_index_1; compute_main_inner(x_30); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicStore/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicStore/workgroup_i32.spvasm.expected.wgsl index 08fdac1b3f..3df27ace35 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicStore/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicStore/workgroup_i32.spvasm.expected.wgsl @@ -15,7 +15,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_29 : u32 = local_invocation_index_1; + let x_29 = local_invocation_index_1; compute_main_inner(x_29); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicStore/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicStore/workgroup_u32.spvasm.expected.wgsl index 6644f12c43..d29da69bdb 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicStore/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicStore/workgroup_u32.spvasm.expected.wgsl @@ -15,7 +15,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_28 : u32 = local_invocation_index_1; + let x_28 = local_invocation_index_1; compute_main_inner(x_28); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.wgsl index 8a692bd305..95c7d67b91 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicSub_051100() { - var res : i32 = 0i; - let x_9 : i32 = atomicSub(&(sb_rw.arg_0), 1i); + var res = 0i; + let x_9 = atomicSub(&(sb_rw.arg_0), 1i); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.wgsl index 4761d22ad9..573d44306e 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicSub_15bfc9() { - var res : u32 = 0u; - let x_9 : u32 = atomicSub(&(sb_rw.arg_0), 1u); + var res = 0u; + let x_9 = atomicSub(&(sb_rw.arg_0), 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicSub/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicSub/workgroup_i32.spvasm.expected.wgsl index 78a324801e..aa3db883b2 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicSub/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicSub/workgroup_i32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicSub_77883a() { - var res : i32 = 0i; - let x_11 : i32 = atomicSub(&(arg_0), 1i); + var res = 0i; + let x_11 = atomicSub(&(arg_0), 1i); res = x_11; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_31 : u32 = local_invocation_index_1; + let x_31 = local_invocation_index_1; compute_main_inner(x_31); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicSub/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicSub/workgroup_u32.spvasm.expected.wgsl index cb4dbd1f2d..dcb8190f7c 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicSub/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicSub/workgroup_u32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicSub_0d26c2() { - var res : u32 = 0u; - let x_10 : u32 = atomicSub(&(arg_0), 1u); + var res = 0u; + let x_10 = atomicSub(&(arg_0), 1u); res = x_10; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_30 : u32 = local_invocation_index_1; + let x_30 = local_invocation_index_1; compute_main_inner(x_30); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.wgsl index d73e8773f6..0b5f736efa 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicXor_c1b78c() { - var res : i32 = 0i; - let x_9 : i32 = atomicXor(&(sb_rw.arg_0), 1i); + var res = 0i; + let x_9 = atomicXor(&(sb_rw.arg_0), 1i); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.wgsl index a721751759..362f320099 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicXor_54510e() { - var res : u32 = 0u; - let x_9 : u32 = atomicXor(&(sb_rw.arg_0), 1u); + var res = 0u; + let x_9 = atomicXor(&(sb_rw.arg_0), 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicXor/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicXor/workgroup_i32.spvasm.expected.wgsl index b28291e92e..6ea8478ae3 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicXor/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicXor/workgroup_i32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicXor_75dc95() { - var res : i32 = 0i; - let x_11 : i32 = atomicXor(&(arg_0), 1i); + var res = 0i; + let x_11 = atomicXor(&(arg_0), 1i); res = x_11; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_31 : u32 = local_invocation_index_1; + let x_31 = local_invocation_index_1; compute_main_inner(x_31); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicXor/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/atomicXor/workgroup_u32.spvasm.expected.wgsl index f8d1b77c17..f7c07ec78d 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicXor/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicXor/workgroup_u32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicXor_c8e6be() { - var res : u32 = 0u; - let x_10 : u32 = atomicXor(&(arg_0), 1u); + var res = 0u; + let x_10 = atomicXor(&(arg_0), 1u); res = x_10; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_30 : u32 = local_invocation_index_1; + let x_30 = local_invocation_index_1; compute_main_inner(x_30); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.wgsl index 2ad75d2cee..42175e6c06 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAdd_d32fe4() { - var res : i32 = 0i; - let x_9 : i32 = atomicSub(&(sb_rw.arg_0), 1i); + var res = 0i; + let x_9 = atomicSub(&(sb_rw.arg_0), 1i); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.wgsl index 933808f43e..27f153de2c 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAdd_8a199a() { - var res : u32 = 0u; - let x_9 : u32 = atomicSub(&(sb_rw.arg_0), 1u); + var res = 0u; + let x_9 = atomicSub(&(sb_rw.arg_0), 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/workgroup_i32.spvasm.expected.wgsl index ff925f623d..f2dd3837b1 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/workgroup_i32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAdd_794055() { - var res : i32 = 0i; - let x_11 : i32 = atomicSub(&(arg_0), 1i); + var res = 0i; + let x_11 = atomicSub(&(arg_0), 1i); res = x_11; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_31 : u32 = local_invocation_index_1; + let x_31 = local_invocation_index_1; compute_main_inner(x_31); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/workgroup_u32.spvasm.expected.wgsl index 0a37a1596f..b2f20a04a3 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/workgroup_u32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAdd_d5db1d() { - var res : u32 = 0u; - let x_10 : u32 = atomicSub(&(arg_0), 1u); + var res = 0u; + let x_10 = atomicSub(&(arg_0), 1u); res = x_10; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_30 : u32 = local_invocation_index_1; + let x_30 = local_invocation_index_1; compute_main_inner(x_30); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.wgsl index 13dd085365..f8c3621782 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAdd_d32fe4() { - var res : i32 = 0i; - let x_9 : i32 = atomicAdd(&(sb_rw.arg_0), 1i); + var res = 0i; + let x_9 = atomicAdd(&(sb_rw.arg_0), 1i); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.wgsl index c6e4f53ef2..c26ffeb8c2 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAdd_8a199a() { - var res : u32 = 0u; - let x_9 : u32 = atomicAdd(&(sb_rw.arg_0), 1u); + var res = 0u; + let x_9 = atomicAdd(&(sb_rw.arg_0), 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/workgroup_i32.spvasm.expected.wgsl index d59a523473..64920e2ab1 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/workgroup_i32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAdd_794055() { - var res : i32 = 0i; - let x_11 : i32 = atomicAdd(&(arg_0), 1i); + var res = 0i; + let x_11 = atomicAdd(&(arg_0), 1i); res = x_11; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_31 : u32 = local_invocation_index_1; + let x_31 = local_invocation_index_1; compute_main_inner(x_31); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/workgroup_u32.spvasm.expected.wgsl index 5a1db0ecf7..bbb74d484d 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/workgroup_u32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAdd_d5db1d() { - var res : u32 = 0u; - let x_10 : u32 = atomicAdd(&(arg_0), 1u); + var res = 0u; + let x_10 = atomicAdd(&(arg_0), 1u); res = x_10; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_30 : u32 = local_invocation_index_1; + let x_30 = local_invocation_index_1; compute_main_inner(x_30); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.wgsl index 483fc27d45..06dcf53ae7 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAdd_d32fe4() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_20 : i32 = arg_1; - let x_13 : i32 = atomicAdd(&(sb_rw.arg_0), x_20); + let x_20 = arg_1; + let x_13 = atomicAdd(&(sb_rw.arg_0), x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.wgsl index b0b8cfa8f6..c1941da4cf 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAdd_8a199a() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_13 : u32 = atomicAdd(&(sb_rw.arg_0), x_18); + let x_18 = arg_1; + let x_13 = atomicAdd(&(sb_rw.arg_0), x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAdd/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicAdd/workgroup_i32.spvasm.expected.wgsl index e7a62ef012..18d99825bc 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAdd/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAdd/workgroup_i32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAdd_794055() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_19 : i32 = arg_1; - let x_15 : i32 = atomicAdd(&(arg_0), x_19); + let x_19 = arg_1; + let x_15 = atomicAdd(&(arg_0), x_19); res = x_15; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_33 : u32 = local_invocation_index_1; + let x_33 = local_invocation_index_1; compute_main_inner(x_33); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAdd/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicAdd/workgroup_u32.spvasm.expected.wgsl index 676530e715..adce156c0a 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAdd/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAdd/workgroup_u32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAdd_d5db1d() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_14 : u32 = atomicAdd(&(arg_0), x_18); + let x_18 = arg_1; + let x_14 = atomicAdd(&(arg_0), x_18); res = x_14; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_32 : u32 = local_invocation_index_1; + let x_32 = local_invocation_index_1; compute_main_inner(x_32); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.wgsl index 1e387a0ab1..eb21d7a2b7 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAnd_152966() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_20 : i32 = arg_1; - let x_13 : i32 = atomicAnd(&(sb_rw.arg_0), x_20); + let x_20 = arg_1; + let x_13 = atomicAnd(&(sb_rw.arg_0), x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.wgsl index f8f4bcfd6d..dc700a8a53 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAnd_85a8d9() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_13 : u32 = atomicAnd(&(sb_rw.arg_0), x_18); + let x_18 = arg_1; + let x_13 = atomicAnd(&(sb_rw.arg_0), x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAnd/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicAnd/workgroup_i32.spvasm.expected.wgsl index 7e25958a24..f8b81a6fd7 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAnd/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAnd/workgroup_i32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAnd_45a819() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_19 : i32 = arg_1; - let x_15 : i32 = atomicAnd(&(arg_0), x_19); + let x_19 = arg_1; + let x_15 = atomicAnd(&(arg_0), x_19); res = x_15; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_33 : u32 = local_invocation_index_1; + let x_33 = local_invocation_index_1; compute_main_inner(x_33); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAnd/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicAnd/workgroup_u32.spvasm.expected.wgsl index 08b4866519..4179a2300d 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAnd/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAnd/workgroup_u32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAnd_34edd3() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_14 : u32 = atomicAnd(&(arg_0), x_18); + let x_18 = arg_1; + let x_14 = atomicAnd(&(arg_0), x_18); res = x_14; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_32 : u32 = local_invocation_index_1; + let x_32 = local_invocation_index_1; compute_main_inner(x_32); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.wgsl index 0345c33b2c..b8dd8aeb25 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.wgsl @@ -18,15 +18,15 @@ struct x__atomic_compare_exchange_resulti32 { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicCompareExchangeWeak_1bd40a() { - var arg_1 : i32 = 0i; - var arg_2 : i32 = 0i; - var res : x__atomic_compare_exchange_resulti32 = x__atomic_compare_exchange_resulti32(0i, false); + var arg_1 = 0i; + var arg_2 = 0i; + var res = x__atomic_compare_exchange_resulti32(0i, false); arg_1 = 1i; arg_2 = 1i; - let x_23 : i32 = arg_2; - let x_24 : i32 = arg_1; + let x_23 = arg_2; + let x_24 = arg_1; let old_value_1 = atomicCompareExchangeWeak(&(sb_rw.arg_0), x_24, x_23).old_value; - let x_25 : i32 = old_value_1; + let x_25 = old_value_1; res = x__atomic_compare_exchange_resulti32(x_25, (x_25 == x_23)); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.wgsl index 9bf485881d..5876c06207 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.wgsl @@ -18,15 +18,15 @@ struct x__atomic_compare_exchange_resultu32 { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicCompareExchangeWeak_63d8e6() { - var arg_1 : u32 = 0u; - var arg_2 : u32 = 0u; - var res : x__atomic_compare_exchange_resultu32 = x__atomic_compare_exchange_resultu32(0u, false); + var arg_1 = 0u; + var arg_2 = 0u; + var res = x__atomic_compare_exchange_resultu32(0u, false); arg_1 = 1u; arg_2 = 1u; - let x_21 : u32 = arg_2; - let x_22 : u32 = arg_1; + let x_21 = arg_2; + let x_22 = arg_1; let old_value_1 = atomicCompareExchangeWeak(&(sb_rw.arg_0), x_22, x_21).old_value; - let x_23 : u32 = old_value_1; + let x_23 = old_value_1; res = x__atomic_compare_exchange_resultu32(x_23, (x_23 == x_21)); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.wgsl index 797f95b159..81968f2d1e 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_i32.spvasm.expected.wgsl @@ -10,15 +10,15 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicCompareExchangeWeak_e88938() { - var arg_1 : i32 = 0i; - var arg_2 : i32 = 0i; - var res : x__atomic_compare_exchange_resulti32 = x__atomic_compare_exchange_resulti32(0i, false); + var arg_1 = 0i; + var arg_2 = 0i; + var res = x__atomic_compare_exchange_resulti32(0i, false); arg_1 = 1i; arg_2 = 1i; - let x_22 : i32 = arg_2; - let x_23 : i32 = arg_1; + let x_22 = arg_2; + let x_23 = arg_1; let old_value_1 = atomicCompareExchangeWeak(&(arg_0), x_23, x_22).old_value; - let x_24 : i32 = old_value_1; + let x_24 = old_value_1; res = x__atomic_compare_exchange_resulti32(x_24, (x_24 == x_22)); return; } @@ -31,7 +31,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_41 : u32 = local_invocation_index_1; + let x_41 = local_invocation_index_1; compute_main_inner(x_41); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.wgsl index e0782fce72..754d24c030 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/workgroup_u32.spvasm.expected.wgsl @@ -10,15 +10,15 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicCompareExchangeWeak_83580d() { - var arg_1 : u32 = 0u; - var arg_2 : u32 = 0u; - var res : x__atomic_compare_exchange_resultu32 = x__atomic_compare_exchange_resultu32(0u, false); + var arg_1 = 0u; + var arg_2 = 0u; + var res = x__atomic_compare_exchange_resultu32(0u, false); arg_1 = 1u; arg_2 = 1u; - let x_21 : u32 = arg_2; - let x_22 : u32 = arg_1; + let x_21 = arg_2; + let x_22 = arg_1; let old_value_1 = atomicCompareExchangeWeak(&(arg_0), x_22, x_21).old_value; - let x_23 : u32 = old_value_1; + let x_23 = old_value_1; res = x__atomic_compare_exchange_resultu32(x_23, (x_23 == x_21)); return; } @@ -31,7 +31,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_40 : u32 = local_invocation_index_1; + let x_40 = local_invocation_index_1; compute_main_inner(x_40); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.wgsl index 0362d77e15..31fc661df5 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicExchange_f2e22f() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_20 : i32 = arg_1; - let x_13 : i32 = atomicExchange(&(sb_rw.arg_0), x_20); + let x_20 = arg_1; + let x_13 = atomicExchange(&(sb_rw.arg_0), x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.wgsl index 633c7a6027..d0ae602066 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicExchange_d59712() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_13 : u32 = atomicExchange(&(sb_rw.arg_0), x_18); + let x_18 = arg_1; + let x_13 = atomicExchange(&(sb_rw.arg_0), x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicExchange/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicExchange/workgroup_i32.spvasm.expected.wgsl index a28a09051a..234169ecfe 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicExchange/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicExchange/workgroup_i32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicExchange_e114ba() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_19 : i32 = arg_1; - let x_15 : i32 = atomicExchange(&(arg_0), x_19); + let x_19 = arg_1; + let x_15 = atomicExchange(&(arg_0), x_19); res = x_15; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_33 : u32 = local_invocation_index_1; + let x_33 = local_invocation_index_1; compute_main_inner(x_33); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicExchange/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicExchange/workgroup_u32.spvasm.expected.wgsl index c13602a3d0..9cc33b42e6 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicExchange/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicExchange/workgroup_u32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicExchange_0a5dca() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_14 : u32 = atomicExchange(&(arg_0), x_18); + let x_18 = arg_1; + let x_14 = atomicExchange(&(arg_0), x_18); res = x_14; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_32 : u32 = local_invocation_index_1; + let x_32 = local_invocation_index_1; compute_main_inner(x_32); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.wgsl index 713ca8a454..29a0d2c31a 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicLoad_0806ad() { - var res : i32 = 0i; - let x_9 : i32 = atomicLoad(&(sb_rw.arg_0)); + var res = 0i; + let x_9 = atomicLoad(&(sb_rw.arg_0)); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.wgsl index 076cf38f6e..dad6639820 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.wgsl @@ -11,8 +11,8 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicLoad_fe6cc3() { - var res : u32 = 0u; - let x_9 : u32 = atomicLoad(&(sb_rw.arg_0)); + var res = 0u; + let x_9 = atomicLoad(&(sb_rw.arg_0)); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicLoad/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicLoad/workgroup_i32.spvasm.expected.wgsl index ba60171363..e47aab1fc1 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicLoad/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicLoad/workgroup_i32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicLoad_afcc03() { - var res : i32 = 0i; - let x_11 : i32 = atomicLoad(&(arg_0)); + var res = 0i; + let x_11 = atomicLoad(&(arg_0)); res = x_11; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_30 : u32 = local_invocation_index_1; + let x_30 = local_invocation_index_1; compute_main_inner(x_30); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicLoad/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicLoad/workgroup_u32.spvasm.expected.wgsl index d9fd46d242..31e8fcc923 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicLoad/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicLoad/workgroup_u32.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicLoad_361bf1() { - var res : u32 = 0u; - let x_10 : u32 = atomicLoad(&(arg_0)); + var res = 0u; + let x_10 = atomicLoad(&(arg_0)); res = x_10; return; } @@ -17,7 +17,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_29 : u32 = local_invocation_index_1; + let x_29 = local_invocation_index_1; compute_main_inner(x_29); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.wgsl index effbc0eaac..4a5914fcfd 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicMax_92aa72() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_20 : i32 = arg_1; - let x_13 : i32 = atomicMax(&(sb_rw.arg_0), x_20); + let x_20 = arg_1; + let x_13 = atomicMax(&(sb_rw.arg_0), x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.wgsl index 4bd55a5a1a..a490363821 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicMax_51b9be() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_13 : u32 = atomicMax(&(sb_rw.arg_0), x_18); + let x_18 = arg_1; + let x_13 = atomicMax(&(sb_rw.arg_0), x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMax/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicMax/workgroup_i32.spvasm.expected.wgsl index 85bdef4ee5..60d8bd3312 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMax/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMax/workgroup_i32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicMax_a89cc3() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_19 : i32 = arg_1; - let x_15 : i32 = atomicMax(&(arg_0), x_19); + let x_19 = arg_1; + let x_15 = atomicMax(&(arg_0), x_19); res = x_15; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_33 : u32 = local_invocation_index_1; + let x_33 = local_invocation_index_1; compute_main_inner(x_33); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMax/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicMax/workgroup_u32.spvasm.expected.wgsl index fb24f1f3e5..52768a5e43 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMax/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMax/workgroup_u32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicMax_beccfc() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_14 : u32 = atomicMax(&(arg_0), x_18); + let x_18 = arg_1; + let x_14 = atomicMax(&(arg_0), x_18); res = x_14; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_32 : u32 = local_invocation_index_1; + let x_32 = local_invocation_index_1; compute_main_inner(x_32); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.wgsl index 138b81d2f9..602f3f02fb 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicMin_8e38dc() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_20 : i32 = arg_1; - let x_13 : i32 = atomicMin(&(sb_rw.arg_0), x_20); + let x_20 = arg_1; + let x_13 = atomicMin(&(sb_rw.arg_0), x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.wgsl index e1815701ba..54c3b51057 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicMin_c67a74() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_13 : u32 = atomicMin(&(sb_rw.arg_0), x_18); + let x_18 = arg_1; + let x_13 = atomicMin(&(sb_rw.arg_0), x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMin/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicMin/workgroup_i32.spvasm.expected.wgsl index 336f3d6cdc..0938b104c6 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMin/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMin/workgroup_i32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicMin_278235() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_19 : i32 = arg_1; - let x_15 : i32 = atomicMin(&(arg_0), x_19); + let x_19 = arg_1; + let x_15 = atomicMin(&(arg_0), x_19); res = x_15; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_33 : u32 = local_invocation_index_1; + let x_33 = local_invocation_index_1; compute_main_inner(x_33); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMin/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicMin/workgroup_u32.spvasm.expected.wgsl index ed65056a1e..21b2d95937 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMin/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMin/workgroup_u32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicMin_69d383() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_14 : u32 = atomicMin(&(arg_0), x_18); + let x_18 = arg_1; + let x_14 = atomicMin(&(arg_0), x_18); res = x_14; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_32 : u32 = local_invocation_index_1; + let x_32 = local_invocation_index_1; compute_main_inner(x_32); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.wgsl index d361e4b56f..6053d4db9b 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicOr_8d96a0() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_20 : i32 = arg_1; - let x_13 : i32 = atomicOr(&(sb_rw.arg_0), x_20); + let x_20 = arg_1; + let x_13 = atomicOr(&(sb_rw.arg_0), x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.wgsl index c9c04e696d..8a614c4867 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicOr_5e95d4() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_13 : u32 = atomicOr(&(sb_rw.arg_0), x_18); + let x_18 = arg_1; + let x_13 = atomicOr(&(sb_rw.arg_0), x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicOr/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicOr/workgroup_i32.spvasm.expected.wgsl index a3edfe06b1..8da9c49868 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicOr/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicOr/workgroup_i32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicOr_d09248() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_19 : i32 = arg_1; - let x_15 : i32 = atomicOr(&(arg_0), x_19); + let x_19 = arg_1; + let x_15 = atomicOr(&(arg_0), x_19); res = x_15; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_33 : u32 = local_invocation_index_1; + let x_33 = local_invocation_index_1; compute_main_inner(x_33); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicOr/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicOr/workgroup_u32.spvasm.expected.wgsl index 4aaef480da..c01b797763 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicOr/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicOr/workgroup_u32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicOr_5e3d61() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_14 : u32 = atomicOr(&(arg_0), x_18); + let x_18 = arg_1; + let x_14 = atomicOr(&(arg_0), x_18); res = x_14; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_32 : u32 = local_invocation_index_1; + let x_32 = local_invocation_index_1; compute_main_inner(x_32); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.wgsl index 384aabe325..c0efe8f427 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.wgsl @@ -11,9 +11,9 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicStore_d1e9a6() { - var arg_1 : i32 = 0i; + var arg_1 = 0i; arg_1 = 1i; - let x_20 : i32 = arg_1; + let x_20 = arg_1; atomicStore(&(sb_rw.arg_0), x_20); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.wgsl index b0023d5eda..945f11b3e2 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.wgsl @@ -11,9 +11,9 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicStore_cdc29e() { - var arg_1 : u32 = 0u; + var arg_1 = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; + let x_18 = arg_1; atomicStore(&(sb_rw.arg_0), x_18); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicStore/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicStore/workgroup_i32.spvasm.expected.wgsl index 9c22f99054..b64bfea787 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicStore/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicStore/workgroup_i32.spvasm.expected.wgsl @@ -3,9 +3,9 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicStore_8bea94() { - var arg_1 : i32 = 0i; + var arg_1 = 0i; arg_1 = 1i; - let x_19 : i32 = arg_1; + let x_19 = arg_1; atomicStore(&(arg_0), x_19); return; } @@ -18,7 +18,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_32 : u32 = local_invocation_index_1; + let x_32 = local_invocation_index_1; compute_main_inner(x_32); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicStore/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicStore/workgroup_u32.spvasm.expected.wgsl index 8e401802d7..acd7442231 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicStore/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicStore/workgroup_u32.spvasm.expected.wgsl @@ -3,9 +3,9 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicStore_726882() { - var arg_1 : u32 = 0u; + var arg_1 = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; + let x_18 = arg_1; atomicStore(&(arg_0), x_18); return; } @@ -18,7 +18,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_31 : u32 = local_invocation_index_1; + let x_31 = local_invocation_index_1; compute_main_inner(x_31); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.wgsl index cfb3a9c04c..8bcd9b14c8 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicSub_051100() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_20 : i32 = arg_1; - let x_13 : i32 = atomicSub(&(sb_rw.arg_0), x_20); + let x_20 = arg_1; + let x_13 = atomicSub(&(sb_rw.arg_0), x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.wgsl index 3b0b466533..bcb2ab540e 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicSub_15bfc9() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_13 : u32 = atomicSub(&(sb_rw.arg_0), x_18); + let x_18 = arg_1; + let x_13 = atomicSub(&(sb_rw.arg_0), x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicSub/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicSub/workgroup_i32.spvasm.expected.wgsl index e4b82dbac4..680b6cfe8c 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicSub/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicSub/workgroup_i32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicSub_77883a() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_19 : i32 = arg_1; - let x_15 : i32 = atomicSub(&(arg_0), x_19); + let x_19 = arg_1; + let x_15 = atomicSub(&(arg_0), x_19); res = x_15; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_33 : u32 = local_invocation_index_1; + let x_33 = local_invocation_index_1; compute_main_inner(x_33); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicSub/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicSub/workgroup_u32.spvasm.expected.wgsl index 6a118946f9..7f5486096d 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicSub/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicSub/workgroup_u32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicSub_0d26c2() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_14 : u32 = atomicSub(&(arg_0), x_18); + let x_18 = arg_1; + let x_14 = atomicSub(&(arg_0), x_18); res = x_14; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_32 : u32 = local_invocation_index_1; + let x_32 = local_invocation_index_1; compute_main_inner(x_32); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.wgsl index 9f46aefc6c..df7f4a01ca 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicXor_c1b78c() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_20 : i32 = arg_1; - let x_13 : i32 = atomicXor(&(sb_rw.arg_0), x_20); + let x_20 = arg_1; + let x_13 = atomicXor(&(sb_rw.arg_0), x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.wgsl index c1c18f99c8..8fba5c71dd 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.wgsl @@ -11,11 +11,11 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicXor_54510e() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_13 : u32 = atomicXor(&(sb_rw.arg_0), x_18); + let x_18 = arg_1; + let x_13 = atomicXor(&(sb_rw.arg_0), x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicXor/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicXor/workgroup_i32.spvasm.expected.wgsl index 6bf52a00a5..b9153cb080 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicXor/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicXor/workgroup_i32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicXor_75dc95() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_19 : i32 = arg_1; - let x_15 : i32 = atomicXor(&(arg_0), x_19); + let x_19 = arg_1; + let x_15 = atomicXor(&(arg_0), x_19); res = x_15; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_33 : u32 = local_invocation_index_1; + let x_33 = local_invocation_index_1; compute_main_inner(x_33); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicXor/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/atomicXor/workgroup_u32.spvasm.expected.wgsl index be98d875c5..8c22294a23 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicXor/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicXor/workgroup_u32.spvasm.expected.wgsl @@ -3,11 +3,11 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicXor_c8e6be() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_18 : u32 = arg_1; - let x_14 : u32 = atomicXor(&(arg_0), x_18); + let x_18 = arg_1; + let x_14 = atomicXor(&(arg_0), x_18); res = x_14; return; } @@ -20,7 +20,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_32 : u32 = local_invocation_index_1; + let x_32 = local_invocation_index_1; compute_main_inner(x_32); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.wgsl index 339117c748..51859d07d7 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.wgsl @@ -11,10 +11,10 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAdd_d32fe4() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_13 : i32 = atomicSub(&(sb_rw.arg_0), 1i); + let x_13 = atomicSub(&(sb_rw.arg_0), 1i); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.wgsl index a08ea2c622..d8f6e84b27 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.wgsl @@ -11,10 +11,10 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAdd_8a199a() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_13 : u32 = atomicSub(&(sb_rw.arg_0), 1u); + let x_13 = atomicSub(&(sb_rw.arg_0), 1u); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/workgroup_i32.spvasm.expected.wgsl index cb88afd1f7..29c74ee178 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/workgroup_i32.spvasm.expected.wgsl @@ -3,10 +3,10 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAdd_794055() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_15 : i32 = atomicSub(&(arg_0), 1i); + let x_15 = atomicSub(&(arg_0), 1i); res = x_15; return; } @@ -19,7 +19,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_33 : u32 = local_invocation_index_1; + let x_33 = local_invocation_index_1; compute_main_inner(x_33); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/workgroup_u32.spvasm.expected.wgsl index c7c95650e8..80e71481d2 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/workgroup_u32.spvasm.expected.wgsl @@ -3,10 +3,10 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAdd_d5db1d() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_14 : u32 = atomicSub(&(arg_0), 1u); + let x_14 = atomicSub(&(arg_0), 1u); res = x_14; return; } @@ -19,7 +19,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_32 : u32 = local_invocation_index_1; + let x_32 = local_invocation_index_1; compute_main_inner(x_32); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.wgsl index e19dbe31b4..d40853e80c 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.wgsl @@ -11,10 +11,10 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAdd_d32fe4() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_13 : i32 = atomicAdd(&(sb_rw.arg_0), 1i); + let x_13 = atomicAdd(&(sb_rw.arg_0), 1i); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.wgsl index 3f0103eb5f..5f9410edd3 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.wgsl @@ -11,10 +11,10 @@ struct SB_RW { @group(0) @binding(0) var sb_rw : SB_RW_atomic; fn atomicAdd_8a199a() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_13 : u32 = atomicAdd(&(sb_rw.arg_0), 1u); + let x_13 = atomicAdd(&(sb_rw.arg_0), 1u); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/workgroup_i32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/workgroup_i32.spvasm.expected.wgsl index 4bbcf3422e..bd58c25501 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/workgroup_i32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/workgroup_i32.spvasm.expected.wgsl @@ -3,10 +3,10 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAdd_794055() { - var arg_1 : i32 = 0i; - var res : i32 = 0i; + var arg_1 = 0i; + var res = 0i; arg_1 = 1i; - let x_15 : i32 = atomicAdd(&(arg_0), 1i); + let x_15 = atomicAdd(&(arg_0), 1i); res = x_15; return; } @@ -19,7 +19,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_33 : u32 = local_invocation_index_1; + let x_33 = local_invocation_index_1; compute_main_inner(x_33); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/workgroup_u32.spvasm.expected.wgsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/workgroup_u32.spvasm.expected.wgsl index 26effa5f58..640cc4a38a 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/workgroup_u32.spvasm.expected.wgsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/workgroup_u32.spvasm.expected.wgsl @@ -3,10 +3,10 @@ var local_invocation_index_1 : u32; var arg_0 : atomic; fn atomicAdd_d5db1d() { - var arg_1 : u32 = 0u; - var res : u32 = 0u; + var arg_1 = 0u; + var res = 0u; arg_1 = 1u; - let x_14 : u32 = atomicAdd(&(arg_0), 1u); + let x_14 = atomicAdd(&(arg_0), 1u); res = x_14; return; } @@ -19,7 +19,7 @@ fn compute_main_inner(local_invocation_index_2 : u32) { } fn compute_main_1() { - let x_32 : u32 = local_invocation_index_1; + let x_32 = local_invocation_index_1; compute_main_inner(x_32); return; } diff --git a/test/tint/builtins/degrees.spvasm.expected.wgsl b/test/tint/builtins/degrees.spvasm.expected.wgsl index d5a3382ea2..b3059e1316 100644 --- a/test/tint/builtins/degrees.spvasm.expected.wgsl +++ b/test/tint/builtins/degrees.spvasm.expected.wgsl @@ -2,7 +2,7 @@ fn main_1() { var a : f32; var b : f32; a = 42.0f; - let x_11 : f32 = a; + let x_11 = a; b = degrees(x_11); return; } diff --git a/test/tint/builtins/extractBits/scalar/i32.spvasm.expected.wgsl b/test/tint/builtins/extractBits/scalar/i32.spvasm.expected.wgsl index c381fada48..fcf6600dd3 100644 --- a/test/tint/builtins/extractBits/scalar/i32.spvasm.expected.wgsl +++ b/test/tint/builtins/extractBits/scalar/i32.spvasm.expected.wgsl @@ -1,11 +1,11 @@ fn f_1() { - var v : i32 = 0i; - var offset_1 : u32 = 0u; - var count : u32 = 0u; - let x_16 : i32 = v; - let x_17 : u32 = offset_1; - let x_18 : u32 = count; - let x_14 : i32 = extractBits(x_16, x_17, x_18); + var v = 0i; + var offset_1 = 0u; + var count = 0u; + let x_16 = v; + let x_17 = offset_1; + let x_18 = count; + let x_14 = extractBits(x_16, x_17, x_18); return; } diff --git a/test/tint/builtins/extractBits/scalar/u32.spvasm.expected.wgsl b/test/tint/builtins/extractBits/scalar/u32.spvasm.expected.wgsl index c9987a9ac2..e6934417c4 100644 --- a/test/tint/builtins/extractBits/scalar/u32.spvasm.expected.wgsl +++ b/test/tint/builtins/extractBits/scalar/u32.spvasm.expected.wgsl @@ -1,11 +1,11 @@ fn f_1() { - var v : u32 = 0u; - var offset_1 : u32 = 0u; - var count : u32 = 0u; - let x_13 : u32 = v; - let x_14 : u32 = offset_1; - let x_15 : u32 = count; - let x_11 : u32 = extractBits(x_13, x_14, x_15); + var v = 0u; + var offset_1 = 0u; + var count = 0u; + let x_13 = v; + let x_14 = offset_1; + let x_15 = count; + let x_11 = extractBits(x_13, x_14, x_15); return; } diff --git a/test/tint/builtins/extractBits/vec3/i32.spvasm.expected.wgsl b/test/tint/builtins/extractBits/vec3/i32.spvasm.expected.wgsl index 3d154c703b..177a58b5c6 100644 --- a/test/tint/builtins/extractBits/vec3/i32.spvasm.expected.wgsl +++ b/test/tint/builtins/extractBits/vec3/i32.spvasm.expected.wgsl @@ -1,11 +1,11 @@ fn f_1() { - var v : vec3i = vec3i(); - var offset_1 : u32 = 0u; - var count : u32 = 0u; - let x_17 : vec3i = v; - let x_18 : u32 = offset_1; - let x_19 : u32 = count; - let x_15 : vec3i = extractBits(x_17, x_18, x_19); + var v = vec3i(); + var offset_1 = 0u; + var count = 0u; + let x_17 = v; + let x_18 = offset_1; + let x_19 = count; + let x_15 = extractBits(x_17, x_18, x_19); return; } diff --git a/test/tint/builtins/extractBits/vec3/u32.spvasm.expected.wgsl b/test/tint/builtins/extractBits/vec3/u32.spvasm.expected.wgsl index 315aa5164d..010925f8bd 100644 --- a/test/tint/builtins/extractBits/vec3/u32.spvasm.expected.wgsl +++ b/test/tint/builtins/extractBits/vec3/u32.spvasm.expected.wgsl @@ -1,11 +1,11 @@ fn f_1() { - var v : vec3u = vec3u(); - var offset_1 : u32 = 0u; - var count : u32 = 0u; - let x_16 : vec3u = v; - let x_17 : u32 = offset_1; - let x_18 : u32 = count; - let x_14 : vec3u = extractBits(x_16, x_17, x_18); + var v = vec3u(); + var offset_1 = 0u; + var count = 0u; + let x_16 = v; + let x_17 = offset_1; + let x_18 = count; + let x_14 = extractBits(x_16, x_17, x_18); return; } diff --git a/test/tint/builtins/insertBits/scalar/i32.spvasm.expected.wgsl b/test/tint/builtins/insertBits/scalar/i32.spvasm.expected.wgsl index b10742e8d9..c26b035bd3 100644 --- a/test/tint/builtins/insertBits/scalar/i32.spvasm.expected.wgsl +++ b/test/tint/builtins/insertBits/scalar/i32.spvasm.expected.wgsl @@ -1,13 +1,13 @@ fn f_1() { - var v : i32 = 0i; - var n : i32 = 0i; - var offset_1 : u32 = 0u; - var count : u32 = 0u; - let x_17 : i32 = v; - let x_18 : i32 = n; - let x_19 : u32 = offset_1; - let x_20 : u32 = count; - let x_15 : i32 = insertBits(x_17, x_18, x_19, x_20); + var v = 0i; + var n = 0i; + var offset_1 = 0u; + var count = 0u; + let x_17 = v; + let x_18 = n; + let x_19 = offset_1; + let x_20 = count; + let x_15 = insertBits(x_17, x_18, x_19, x_20); return; } diff --git a/test/tint/builtins/insertBits/scalar/u32.spvasm.expected.wgsl b/test/tint/builtins/insertBits/scalar/u32.spvasm.expected.wgsl index b10c69d299..49a3b954ea 100644 --- a/test/tint/builtins/insertBits/scalar/u32.spvasm.expected.wgsl +++ b/test/tint/builtins/insertBits/scalar/u32.spvasm.expected.wgsl @@ -1,13 +1,13 @@ fn f_1() { - var v : u32 = 0u; - var n : u32 = 0u; - var offset_1 : u32 = 0u; - var count : u32 = 0u; - let x_14 : u32 = v; - let x_15 : u32 = n; - let x_16 : u32 = offset_1; - let x_17 : u32 = count; - let x_12 : u32 = insertBits(x_14, x_15, x_16, x_17); + var v = 0u; + var n = 0u; + var offset_1 = 0u; + var count = 0u; + let x_14 = v; + let x_15 = n; + let x_16 = offset_1; + let x_17 = count; + let x_12 = insertBits(x_14, x_15, x_16, x_17); return; } diff --git a/test/tint/builtins/insertBits/vec3/i32.spvasm.expected.wgsl b/test/tint/builtins/insertBits/vec3/i32.spvasm.expected.wgsl index 8deba6035b..202aa40035 100644 --- a/test/tint/builtins/insertBits/vec3/i32.spvasm.expected.wgsl +++ b/test/tint/builtins/insertBits/vec3/i32.spvasm.expected.wgsl @@ -1,13 +1,13 @@ fn f_1() { - var v : vec3i = vec3i(); - var n : vec3i = vec3i(); - var offset_1 : u32 = 0u; - var count : u32 = 0u; - let x_18 : vec3i = v; - let x_19 : vec3i = n; - let x_20 : u32 = offset_1; - let x_21 : u32 = count; - let x_16 : vec3i = insertBits(x_18, x_19, x_20, x_21); + var v = vec3i(); + var n = vec3i(); + var offset_1 = 0u; + var count = 0u; + let x_18 = v; + let x_19 = n; + let x_20 = offset_1; + let x_21 = count; + let x_16 = insertBits(x_18, x_19, x_20, x_21); return; } diff --git a/test/tint/builtins/insertBits/vec3/u32.spvasm.expected.wgsl b/test/tint/builtins/insertBits/vec3/u32.spvasm.expected.wgsl index 071458d8de..d0d2ba3e4e 100644 --- a/test/tint/builtins/insertBits/vec3/u32.spvasm.expected.wgsl +++ b/test/tint/builtins/insertBits/vec3/u32.spvasm.expected.wgsl @@ -1,13 +1,13 @@ fn f_1() { - var v : vec3u = vec3u(); - var n : vec3u = vec3u(); - var offset_1 : u32 = 0u; - var count : u32 = 0u; - let x_17 : vec3u = v; - let x_18 : vec3u = n; - let x_19 : u32 = offset_1; - let x_20 : u32 = count; - let x_15 : vec3u = insertBits(x_17, x_18, x_19, x_20); + var v = vec3u(); + var n = vec3u(); + var offset_1 = 0u; + var count = 0u; + let x_17 = v; + let x_18 = n; + let x_19 = offset_1; + let x_20 = count; + let x_15 = insertBits(x_17, x_18, x_19, x_20); return; } diff --git a/test/tint/builtins/radians.spvasm.expected.wgsl b/test/tint/builtins/radians.spvasm.expected.wgsl index a3de69200f..c0fccb54a1 100644 --- a/test/tint/builtins/radians.spvasm.expected.wgsl +++ b/test/tint/builtins/radians.spvasm.expected.wgsl @@ -2,7 +2,7 @@ fn main_1() { var a : f32; var b : f32; a = 42.0f; - let x_11 : f32 = a; + let x_11 = a; b = radians(x_11); return; } diff --git a/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.wgsl b/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.wgsl index c8a3c7b86c..7c1669d7e2 100644 --- a/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.wgsl +++ b/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.wgsl @@ -1,10 +1,10 @@ @group(1) @binding(0) var arg_0 : texture_depth_multisampled_2d; -var tint_symbol_1 : vec4f = vec4f(); +var tint_symbol_1 = vec4f(); fn textureDimensions_f60bdb() { - var res : vec2i = vec2i(); - let x_16 : vec2i = vec2i(textureDimensions(arg_0)); + var res = vec2i(); + let x_16 = vec2i(textureDimensions(arg_0)); res = x_16; return; } diff --git a/test/tint/builtins/textureLoad/depth_ms.spvasm.expected.wgsl b/test/tint/builtins/textureLoad/depth_ms.spvasm.expected.wgsl index 8340c9d364..2da4ee4199 100644 --- a/test/tint/builtins/textureLoad/depth_ms.spvasm.expected.wgsl +++ b/test/tint/builtins/textureLoad/depth_ms.spvasm.expected.wgsl @@ -1,10 +1,10 @@ @group(1) @binding(0) var arg_0 : texture_depth_multisampled_2d; -var tint_symbol_1 : vec4f = vec4f(); +var tint_symbol_1 = vec4f(); fn textureLoad_6273b1() { - var res : f32 = 0.0f; - let x_17 : vec4f = vec4f(textureLoad(arg_0, vec2i(), 1i), 0.0f, 0.0f, 0.0f); + var res = 0.0f; + let x_17 = vec4f(textureLoad(arg_0, vec2i(), 1i), 0.0f, 0.0f, 0.0f); res = x_17.x; return; } diff --git a/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.wgsl b/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.wgsl index 2fb6a4a26e..779bd6190e 100644 --- a/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.wgsl +++ b/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.wgsl @@ -1,10 +1,10 @@ @group(1) @binding(0) var arg_0 : texture_depth_multisampled_2d; -var tint_symbol_1 : vec4f = vec4f(); +var tint_symbol_1 = vec4f(); fn textureNumSamples_a3c8a0() { - var res : i32 = 0i; - let x_16 : i32 = i32(textureNumSamples(arg_0)); + var res = 0i; + let x_16 = i32(textureNumSamples(arg_0)); res = x_16; return; } diff --git a/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.wgsl b/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.wgsl index 9d83f4d0c7..c37997c113 100644 --- a/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.wgsl +++ b/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.wgsl @@ -19,7 +19,7 @@ fn mat2x2_stride_16_to_arr(m : mat2x2) -> array { } fn f_1() { - let x_15 : mat2x2f = arr_to_mat2x2_stride_16(ssbo.m); + let x_15 = arr_to_mat2x2_stride_16(ssbo.m); ssbo.m = mat2x2_stride_16_to_arr(x_15); return; } diff --git a/test/tint/ptr_ref/access/matrix.spvasm.expected.wgsl b/test/tint/ptr_ref/access/matrix.spvasm.expected.wgsl index 57e0ee3e82..c5a058af92 100644 --- a/test/tint/ptr_ref/access/matrix.spvasm.expected.wgsl +++ b/test/tint/ptr_ref/access/matrix.spvasm.expected.wgsl @@ -1,5 +1,5 @@ fn main_1() { - var m : mat3x3f = mat3x3f(); + var m = mat3x3f(); m = mat3x3f(vec3f(1.0f, 2.0f, 3.0f), vec3f(4.0f, 5.0f, 6.0f), vec3f(7.0f, 8.0f, 9.0f)); m[1i] = vec3f(5.0f, 5.0f, 5.0f); return; diff --git a/test/tint/ptr_ref/load/global/i32.spvasm.expected.wgsl b/test/tint/ptr_ref/load/global/i32.spvasm.expected.wgsl index 52e0e8a9fd..f8aef94b4d 100644 --- a/test/tint/ptr_ref/load/global/i32.spvasm.expected.wgsl +++ b/test/tint/ptr_ref/load/global/i32.spvasm.expected.wgsl @@ -1,8 +1,8 @@ -var I : i32 = 0i; +var I = 0i; fn main_1() { - let x_9 : i32 = I; - let x_11 : i32 = (x_9 + 1i); + let x_9 = I; + let x_11 = (x_9 + 1i); return; } diff --git a/test/tint/ptr_ref/load/global/struct_field.spvasm.expected.wgsl b/test/tint/ptr_ref/load/global/struct_field.spvasm.expected.wgsl index 477c131115..69f3fc1056 100644 --- a/test/tint/ptr_ref/load/global/struct_field.spvasm.expected.wgsl +++ b/test/tint/ptr_ref/load/global/struct_field.spvasm.expected.wgsl @@ -6,7 +6,7 @@ var V : S; fn main_1() { var i : i32; - let x_15 : i32 = V.i; + let x_15 = V.i; i = x_15; return; } diff --git a/test/tint/ptr_ref/load/local/i32.spvasm.expected.wgsl b/test/tint/ptr_ref/load/local/i32.spvasm.expected.wgsl index e576470d59..dd291f686c 100644 --- a/test/tint/ptr_ref/load/local/i32.spvasm.expected.wgsl +++ b/test/tint/ptr_ref/load/local/i32.spvasm.expected.wgsl @@ -1,8 +1,8 @@ fn main_1() { - var i : i32 = 0i; + var i = 0i; i = 123i; - let x_10 : i32 = i; - let x_12 : i32 = (x_10 + 1i); + let x_10 = i; + let x_12 = (x_10 + 1i); return; } diff --git a/test/tint/ptr_ref/load/local/struct_field.spvasm.expected.wgsl b/test/tint/ptr_ref/load/local/struct_field.spvasm.expected.wgsl index 2e0efd8d05..9a9221461b 100644 --- a/test/tint/ptr_ref/load/local/struct_field.spvasm.expected.wgsl +++ b/test/tint/ptr_ref/load/local/struct_field.spvasm.expected.wgsl @@ -5,7 +5,7 @@ struct S { fn main_1() { var i : i32; var V : S; - let x_14 : i32 = V.i; + let x_14 = V.i; i = x_14; return; } diff --git a/test/tint/ptr_ref/load/param/ptr.spvasm.expected.wgsl b/test/tint/ptr_ref/load/param/ptr.spvasm.expected.wgsl index 7a2d592cda..7e2b7cf3a8 100644 --- a/test/tint/ptr_ref/load/param/ptr.spvasm.expected.wgsl +++ b/test/tint/ptr_ref/load/param/ptr.spvasm.expected.wgsl @@ -1,13 +1,13 @@ fn func(value : i32, pointer : ptr) -> i32 { - let x_9 : i32 = *(pointer); + let x_9 = *(pointer); return (value + x_9); } fn main_1() { - var i : i32 = 0i; + var i = 0i; i = 123i; - let x_19 : i32 = i; - let x_18 : i32 = func(x_19, &(i)); + let x_19 = i; + let x_18 = func(x_19, &(i)); return; } diff --git a/test/tint/ptr_ref/store/global/i32.spvasm.expected.wgsl b/test/tint/ptr_ref/store/global/i32.spvasm.expected.wgsl index 6db2c9655b..8c9427e85f 100644 --- a/test/tint/ptr_ref/store/global/i32.spvasm.expected.wgsl +++ b/test/tint/ptr_ref/store/global/i32.spvasm.expected.wgsl @@ -1,4 +1,4 @@ -var I : i32 = 0i; +var I = 0i; fn main_1() { I = 123i; diff --git a/test/tint/ptr_ref/store/local/i32.spvasm.expected.wgsl b/test/tint/ptr_ref/store/local/i32.spvasm.expected.wgsl index 1fce2c9e83..5b943e4140 100644 --- a/test/tint/ptr_ref/store/local/i32.spvasm.expected.wgsl +++ b/test/tint/ptr_ref/store/local/i32.spvasm.expected.wgsl @@ -1,5 +1,5 @@ fn main_1() { - var i : i32 = 0i; + var i = 0i; i = 123i; i = 123i; i = ((100i + 20i) + 3i);