From d6f9a8a25305a2da47f0fc1d53bdff4ee8b01496 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Thu, 17 Nov 2022 13:19:16 +0000 Subject: [PATCH] Enable some disabled test. This CL enables some of the @const disabled test now that the methods are implemented. Bug: tint:1581 Change-Id: I2cc0aa33188e439a661e2e7c265c6414881c92a0 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110169 Reviewed-by: Ben Clayton Kokoro: Kokoro Commit-Queue: Ben Clayton --- src/tint/transform/builtin_polyfill_test.cc | 26 +++++++-------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/tint/transform/builtin_polyfill_test.cc b/src/tint/transform/builtin_polyfill_test.cc index b7671676a9..fbbd90e4c5 100644 --- a/src/tint/transform/builtin_polyfill_test.cc +++ b/src/tint/transform/builtin_polyfill_test.cc @@ -66,8 +66,7 @@ fn f() { EXPECT_TRUE(ShouldRun(src, polyfillAcosh(Level::kFull))); } -// TODO(crbug.com/tint/1581): Enable once `acosh` is implemented as @const -TEST_F(BuiltinPolyfillTest, DISABLED_Acosh_ConstantExpression) { +TEST_F(BuiltinPolyfillTest, Acosh_ConstantExpression) { auto* src = R"( fn f() { let r : f32 = acosh(1.0); @@ -287,11 +286,10 @@ fn f() { EXPECT_TRUE(ShouldRun(src, polyfillAtanh(Level::kFull))); } -// TODO(crbug.com/tint/1581): Enable once `atanh` is implemented as @const -TEST_F(BuiltinPolyfillTest, DISABLED_Atanh_ConstantExpression) { +TEST_F(BuiltinPolyfillTest, Atanh_ConstantExpression) { auto* src = R"( fn f() { - let r : f32 = atanh(1.23); + let r : f32 = atanh(0.23); } )"; @@ -727,8 +725,7 @@ fn f() { EXPECT_TRUE(ShouldRun(src, polyfillCountLeadingZeros())); } -// TODO(crbug.com/tint/1581): Enable once `countLeadingZeros` is implemented as @const -TEST_F(BuiltinPolyfillTest, DISABLED_CountLeadingZeros_ConstantExpression) { +TEST_F(BuiltinPolyfillTest, CountLeadingZeros_ConstantExpression) { auto* src = R"( fn f() { let r : i32 = countLeadingZeros(15i); @@ -905,8 +902,7 @@ fn f() { EXPECT_TRUE(ShouldRun(src, polyfillCountTrailingZeros())); } -// TODO(crbug.com/tint/1581): Enable once `countTrailingZeros` is implemented as @const -TEST_F(BuiltinPolyfillTest, DISABLED_CountTrailingZeros_ConstantExpression) { +TEST_F(BuiltinPolyfillTest, CountTrailingZeros_ConstantExpression) { auto* src = R"( fn f() { let r : i32 = countTrailingZeros(15i); @@ -1338,8 +1334,7 @@ fn f() { EXPECT_TRUE(ShouldRun(src, polyfillFirstLeadingBit())); } -// TODO(crbug.com/tint/1581): Enable once `firstLeadingBit` is implemented as @const -TEST_F(BuiltinPolyfillTest, DISABLED_FirstLeadingBit_ConstantExpression) { +TEST_F(BuiltinPolyfillTest, FirstLeadingBit_ConstantExpression) { auto* src = R"( fn f() { let r : i32 = firstLeadingBit(15i); @@ -1516,8 +1511,7 @@ fn f() { EXPECT_TRUE(ShouldRun(src, polyfillFirstTrailingBit())); } -// TODO(crbug.com/tint/1581): Enable once `firstTrailingBit` is implemented as @const -TEST_F(BuiltinPolyfillTest, DISABLED_FirstTrailingBit_ConstantExpression) { +TEST_F(BuiltinPolyfillTest, FirstTrailingBit_ConstantExpression) { auto* src = R"( fn f() { let r : i32 = firstTrailingBit(15i); @@ -1696,12 +1690,10 @@ fn f() { EXPECT_TRUE(ShouldRun(src, polyfillInsertBits(Level::kFull))); } -// TODO(crbug.com/tint/1581): Enable once `insertBits` is implemented as @const -TEST_F(BuiltinPolyfillTest, DISABLED_InsertBits_ConstantExpression) { +TEST_F(BuiltinPolyfillTest, InsertBits_ConstantExpression) { auto* src = R"( fn f() { - let v = 1234i; - let r : i32 = insertBits(v, 5678, 5u, 6u); + let r : i32 = insertBits(1234i, 5678i, 5u, 6u); } )";