From ffb322a096a1d0f1e2166e6e26d86ab36e31dbd6 Mon Sep 17 00:00:00 2001 From: Antonio Maiorano Date: Wed, 21 Dec 2022 21:15:03 +0000 Subject: [PATCH] tint: add bool member to const eval struct member access test Bug: tint:1581 Change-Id: I65955745b9e4078368ba2b3797dd903e07238edd Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/115243 Reviewed-by: James Price Kokoro: Kokoro --- src/tint/resolver/const_eval_member_access_test.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tint/resolver/const_eval_member_access_test.cc b/src/tint/resolver/const_eval_member_access_test.cc index 705ed270e6..65a18f2e29 100644 --- a/src/tint/resolver/const_eval_member_access_test.cc +++ b/src/tint/resolver/const_eval_member_access_test.cc @@ -24,6 +24,7 @@ TEST_F(ResolverConstEvalTest, MemberAccess) { Member("i1", ty.i32()), Member("i2", ty.u32()), Member("i3", ty.f32()), + Member("i4", ty.bool_()), }); Structure("Outer", utils::Vector{ @@ -31,7 +32,7 @@ TEST_F(ResolverConstEvalTest, MemberAccess) { Member("o2", ty.type_name("Inner")), }); auto* outer_expr = Construct(ty.type_name("Outer"), // - Construct(ty.type_name("Inner"), 1_i, 2_u, 3_f), + Construct(ty.type_name("Inner"), 1_i, 2_u, 3_f, true), Construct(ty.type_name("Inner"))); auto* o1_expr = MemberAccessor(outer_expr, "o1"); auto* i2_expr = MemberAccessor(o1_expr, "i2"); @@ -59,6 +60,7 @@ TEST_F(ResolverConstEvalTest, MemberAccess) { EXPECT_EQ(o1->ConstantValue()->Index(0)->ValueAs(), 1_i); EXPECT_EQ(o1->ConstantValue()->Index(1)->ValueAs(), 2_u); EXPECT_EQ(o1->ConstantValue()->Index(2)->ValueAs(), 3_f); + EXPECT_EQ(o1->ConstantValue()->Index(2)->ValueAs(), true); auto* i2 = Sem().Get(i2_expr); ASSERT_NE(i2->ConstantValue(), nullptr);