diff --git a/docs/tint/origin-trial-changes.md b/docs/tint/origin-trial-changes.md index ead20108e7..e118024dee 100644 --- a/docs/tint/origin-trial-changes.md +++ b/docs/tint/origin-trial-changes.md @@ -1,5 +1,11 @@ # Tint changes during Origin Trial +## Changes for M109 + +### New features + +* Uniformity analysis failures are warnings again [tint:1728](crbug.com/tint/1728) + ## Changes for M108 ### New features diff --git a/src/dawn/tests/end2end/ShaderTests.cpp b/src/dawn/tests/end2end/ShaderTests.cpp index dd88e562d3..b8731759a3 100644 --- a/src/dawn/tests/end2end/ShaderTests.cpp +++ b/src/dawn/tests/end2end/ShaderTests.cpp @@ -872,7 +872,8 @@ TEST_P(ShaderTests, ConflictingBindingsDueToTransformOrder) { // Check that chromium_disable_uniformity_analysis can be used. It is normally disallowed as unsafe // but DawnTests allow all unsafe APIs by default. -TEST_P(ShaderTests, CheckUsageOf_chromium_disable_uniformity_analysis) { +// TODO(crbug.com/tint/1728): Enable again when uniformity failures are errors again +TEST_P(ShaderTests, DISABLED_CheckUsageOf_chromium_disable_uniformity_analysis) { wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( enable chromium_disable_uniformity_analysis; diff --git a/src/tint/resolver/resolver.cc b/src/tint/resolver/resolver.cc index 3d949a2865..ba6cfaaa6f 100644 --- a/src/tint/resolver/resolver.cc +++ b/src/tint/resolver/resolver.cc @@ -174,7 +174,9 @@ bool Resolver::ResolveInternal() { if (!enabled_extensions_.Contains(ast::Extension::kChromiumDisableUniformityAnalysis)) { if (!AnalyzeUniformity(builder_, dependencies_)) { - return false; + if (kUniformityFailuresAsError) { + return false; + } } } diff --git a/src/tint/resolver/uniformity.cc b/src/tint/resolver/uniformity.cc index e8f1bb95f6..eb62c0ce2c 100644 --- a/src/tint/resolver/uniformity.cc +++ b/src/tint/resolver/uniformity.cc @@ -1672,7 +1672,9 @@ class UniformityGraph { // the `MakeError` function. auto report = [&](Source source, std::string msg) { diag::Diagnostic error{}; - error.severity = note ? diag::Severity::Note : diag::Severity::Error; + auto failureSeverity = + kUniformityFailuresAsError ? diag::Severity::Error : diag::Severity::Warning; + error.severity = note ? diag::Severity::Note : failureSeverity; error.system = diag::System::Resolver; error.source = source; error.message = msg; diff --git a/src/tint/resolver/uniformity.h b/src/tint/resolver/uniformity.h index 39827cf520..798080119c 100644 --- a/src/tint/resolver/uniformity.h +++ b/src/tint/resolver/uniformity.h @@ -25,6 +25,9 @@ class ProgramBuilder; namespace tint::resolver { +/// If true, uniformity analysis failures will be treated as an error, else as a warning. +constexpr bool kUniformityFailuresAsError = false; + /// Analyze the uniformity of a program. /// @param builder the program to analyze /// @param dependency_graph the dependency-ordered module-scope declarations diff --git a/src/tint/resolver/uniformity_test.cc b/src/tint/resolver/uniformity_test.cc index 249db64e28..5cf475c372 100644 --- a/src/tint/resolver/uniformity_test.cc +++ b/src/tint/resolver/uniformity_test.cc @@ -31,13 +31,10 @@ namespace { class UniformityAnalysisTestBase { protected: - /// Parse and resolve a WGSL shader. - /// @param src the WGSL source code - /// @param should_pass true if `src` should pass the analysis, otherwise false - void RunTest(std::string src, bool should_pass) { - auto file = std::make_unique("test", src); - auto program = reader::wgsl::Parse(file.get()); - + /// Build and resolve a program from a ProgramBuilder object. + /// @param program the program + /// @param should_pass true if `builder` program should pass the analysis, otherwise false + void RunTest(Program&& program, bool should_pass) { diag::Formatter::Style style; style.print_newline_at_end = false; error_ = diag::Formatter(style).format(program.Diagnostics()); @@ -51,21 +48,29 @@ class UniformityAnalysisTestBase { EXPECT_EQ(program.Diagnostics().count(), 0u) << error_; } } else { - EXPECT_FALSE(valid); + if (kUniformityFailuresAsError) { + EXPECT_FALSE(valid); + } else { + EXPECT_TRUE(valid) << error_; + } } } + /// Parse and resolve a WGSL shader. + /// @param src the WGSL source code + /// @param should_pass true if `src` should pass the analysis, otherwise false + void RunTest(std::string src, bool should_pass) { + auto file = std::make_unique("test", src); + auto program = reader::wgsl::Parse(file.get()); + return RunTest(std::move(program), should_pass); + } + /// Build and resolve a program from a ProgramBuilder object. /// @param builder the program builder - /// @returns true on success, false on failure - bool RunTest(ProgramBuilder&& builder) { + /// @param should_pass true if `builder` program should pass the analysis, otherwise false + void RunTest(ProgramBuilder&& builder, bool should_pass) { auto program = Program(std::move(builder)); - - diag::Formatter::Style style; - style.print_newline_at_end = false; - error_ = diag::Formatter(style).format(program.Diagnostics()); - - return program.IsValid(); + return RunTest(std::move(program), should_pass); } /// The error message from the parser or resolver, if any. @@ -317,7 +322,7 @@ fn foo() { bool should_pass = !(MayBeNonUniform(condition) && RequiredToBeUniform(function)); RunTest(src, should_pass); if (!should_pass) { - EXPECT_THAT(error_, ::testing::StartsWith("test:31:5 error: ")); + EXPECT_THAT(error_, ::testing::StartsWith("test:31:5 warning: ")); EXPECT_THAT(error_, ::testing::HasSubstr("must only be called from uniform control flow")); } } @@ -390,7 +395,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:17:3 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:17:3 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -439,7 +444,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:21:3 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:21:3 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -527,7 +532,7 @@ fn bar() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:11:7 error: parameter 'i' of 'foo' must be uniform + R"(test:11:7 warning: parameter 'i' of 'foo' must be uniform foo(rw); ^^ @@ -580,7 +585,7 @@ fn bar() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -645,7 +650,7 @@ fn bar() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:17:3 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:17:3 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -696,7 +701,7 @@ fn main(@builtin()" + GetParam().name + if (!should_pass) { EXPECT_EQ( error_, - R"(test:5:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:5:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -731,7 +736,7 @@ fn main(s : S) { if (!should_pass) { EXPECT_EQ( error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -776,7 +781,7 @@ fn main(s : S) { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -807,7 +812,7 @@ fn main(@builtin()" + GetParam().name + RunTest(src, should_pass); if (!should_pass) { EXPECT_EQ(error_, - R"(test:5:5 error: 'dpdx' must only be called from uniform control flow + R"(test:5:5 warning: 'dpdx' must only be called from uniform control flow dpdx(0.5); ^^^^ @@ -841,7 +846,7 @@ fn main(s : S) { RunTest(src, should_pass); if (!should_pass) { EXPECT_EQ(error_, - R"(test:9:5 error: 'dpdx' must only be called from uniform control flow + R"(test:9:5 warning: 'dpdx' must only be called from uniform control flow dpdx(0.5); ^^^^ @@ -878,7 +883,7 @@ fn main(@location(0) l : f32) { RunTest(src, false); EXPECT_EQ(error_, - R"(test:5:5 error: 'dpdx' must only be called from uniform control flow + R"(test:5:5 warning: 'dpdx' must only be called from uniform control flow dpdx(0.5); ^^^^ @@ -908,7 +913,7 @@ fn main(s : S) { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'dpdx' must only be called from uniform control flow + R"(test:9:5 warning: 'dpdx' must only be called from uniform control flow dpdx(0.5); ^^^^ @@ -1024,7 +1029,7 @@ fn foo() { EXPECT_THAT( error_, ::testing::StartsWith( - R"(test:13:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:13:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier();)")); EXPECT_THAT(error_, ::testing::HasSubstr("test:14:9 note: reading from read_write storage buffer " @@ -1064,7 +1069,7 @@ fn foo() { EXPECT_THAT( error_, ::testing::StartsWith( - R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier();)")); EXPECT_THAT(error_, ::testing::HasSubstr("test:13:9 note: reading from read_write storage buffer " @@ -1105,7 +1110,7 @@ fn foo() { EXPECT_THAT( error_, ::testing::StartsWith( - R"(test:15:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier();)")); EXPECT_THAT(error_, ::testing::HasSubstr("test:13:9 note: reading from read_write storage buffer " @@ -1152,7 +1157,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1203,7 +1208,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1271,7 +1276,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1355,7 +1360,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1393,7 +1398,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1436,7 +1441,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:20:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:20:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1510,7 +1515,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:20:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:20:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1551,7 +1556,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1595,7 +1600,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:16:9 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:16:9 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1636,7 +1641,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1677,7 +1682,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1813,7 +1818,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:3 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:3 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1858,7 +1863,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1893,7 +1898,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1932,7 +1937,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1969,7 +1974,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2024,7 +2029,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2079,7 +2084,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2140,7 +2145,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2185,7 +2190,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:21:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:21:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2227,7 +2232,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2268,7 +2273,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2329,7 +2334,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2366,7 +2371,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2431,7 +2436,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:17:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:17:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2478,7 +2483,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:23:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:23:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2521,7 +2526,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2564,7 +2569,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2659,7 +2664,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2687,7 +2692,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2716,7 +2721,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2745,7 +2750,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2774,7 +2779,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2803,7 +2808,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2831,7 +2836,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2862,7 +2867,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2939,7 +2944,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3022,7 +3027,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:12:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:12:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3059,7 +3064,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:13:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:13:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3216,7 +3221,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:3 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:3 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3246,7 +3251,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:3 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:3 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3283,7 +3288,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3313,7 +3318,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3348,7 +3353,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:11:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:11:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3415,7 +3420,7 @@ fn foo() { fallthrough; ^^^^^^^^^^^ -test:14:7 error: 'workgroupBarrier' must only be called from uniform control flow +test:14:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3485,7 +3490,7 @@ fn foo() { fallthrough; ^^^^^^^^^^^ -test:14:9 error: 'workgroupBarrier' must only be called from uniform control flow +test:14:9 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3524,7 +3529,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:9 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:9 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3564,7 +3569,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:19:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:19:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3630,7 +3635,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:18:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:18:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3699,7 +3704,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:21:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:21:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3741,7 +3746,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3879,7 +3884,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:17:3 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:17:3 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3916,7 +3921,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3946,7 +3951,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4011,7 +4016,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:11:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:11:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4039,7 +4044,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4068,7 +4073,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4100,7 +4105,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:12:7 error: parameter 'p' of 'bar' must be uniform + R"(test:12:7 warning: parameter 'p' of 'bar' must be uniform bar(&v); ^ @@ -4174,7 +4179,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4222,7 +4227,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4252,7 +4257,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4284,7 +4289,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:11:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:11:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4335,7 +4340,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:11:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:11:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4385,7 +4390,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:12:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:12:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4438,7 +4443,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:12:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:12:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4472,7 +4477,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:13:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:13:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4555,7 +4560,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:21:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:21:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4649,7 +4654,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:18:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:18:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4686,7 +4691,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:16:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:16:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4723,7 +4728,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:16:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:16:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4768,7 +4773,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:24:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:24:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4807,7 +4812,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:18:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:18:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4843,7 +4848,7 @@ fn foo(p : ptr) { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:7 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:7 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4879,7 +4884,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4916,7 +4921,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:16:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:16:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4953,7 +4958,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:16:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:16:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4994,7 +4999,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:20:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:20:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5053,7 +5058,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5110,7 +5115,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5165,7 +5170,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:12:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:12:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5203,7 +5208,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5243,7 +5248,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:16:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:16:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5311,9 +5316,9 @@ TEST_F(UniformityAnalysisTest, MaximumNumberOfPointerParameters) { main_body.Push(b.If(b.Equal("v254", 0_i), b.Block(b.CallStmt(b.Call("workgroupBarrier"))))); b.Func("main", utils::Empty, ty.void_(), main_body); - EXPECT_FALSE(RunTest(std::move(b))); + RunTest(std::move(b), false); EXPECT_EQ(error_, - R"(error: 'workgroupBarrier' must only be called from uniform control flow + R"(warning: 'workgroupBarrier' must only be called from uniform control flow note: control flow depends on non-uniform value note: reading from module-scope private variable 'non_uniform_global' may result in a non-uniform value)"); } @@ -5349,7 +5354,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5378,7 +5383,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5423,7 +5428,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5456,7 +5461,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5574,7 +5579,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5604,7 +5609,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5637,7 +5642,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5666,7 +5671,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5699,7 +5704,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5803,7 +5808,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5836,7 +5841,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5869,7 +5874,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5903,7 +5908,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5938,7 +5943,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5972,7 +5977,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6002,7 +6007,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6033,7 +6038,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6065,7 +6070,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6097,7 +6102,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6127,7 +6132,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6176,7 +6181,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6209,7 +6214,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:12:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:12:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6262,7 +6267,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:12:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:12:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6299,7 +6304,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:13:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:13:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6337,7 +6342,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6375,7 +6380,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6430,7 +6435,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:13:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:13:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6531,7 +6536,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:13:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:13:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6567,7 +6572,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6603,7 +6608,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6640,7 +6645,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:13:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:13:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6681,7 +6686,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6710,7 +6715,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6755,7 +6760,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6786,7 +6791,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6819,7 +6824,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6866,7 +6871,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6899,7 +6904,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6932,7 +6937,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6965,7 +6970,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6999,7 +7004,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7034,7 +7039,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7068,7 +7073,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7195,7 +7200,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7222,7 +7227,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7249,7 +7254,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7279,7 +7284,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7309,7 +7314,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7343,7 +7348,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:3 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:3 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7382,7 +7387,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:3 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:3 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7421,7 +7426,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:3 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:3 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7460,7 +7465,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:3 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:3 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7603,7 +7608,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7630,7 +7635,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 error: 'storageBarrier' must only be called from uniform control flow + R"(test:6:5 warning: 'storageBarrier' must only be called from uniform control flow storageBarrier(); ^^^^^^^^^^^^^^ @@ -7687,9 +7692,9 @@ TEST_F(UniformityAnalysisTest, StressGraphTraversalDepth) { foo_body.Push(b.If(b.Equal(v_last, 0_i), b.Block(b.CallStmt(b.Call("workgroupBarrier"))))); b.Func("foo", utils::Empty, ty.void_(), foo_body); - EXPECT_FALSE(RunTest(std::move(b))); + RunTest(std::move(b), false); EXPECT_EQ(error_, - R"(error: 'workgroupBarrier' must only be called from uniform control flow + R"(warning: 'workgroupBarrier' must only be called from uniform control flow note: control flow depends on non-uniform value note: reading from module-scope private variable 'v0' may result in a non-uniform value)"); } @@ -7715,7 +7720,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 error: 'foo' must only be called from uniform control flow + R"(test:10:5 warning: 'foo' must only be called from uniform control flow foo(); ^^^ @@ -7758,7 +7763,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:18:5 error: 'foo' must only be called from uniform control flow + R"(test:18:5 warning: 'foo' must only be called from uniform control flow foo(); ^^^ @@ -7801,7 +7806,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:19:7 error: parameter 'c' of 'foo' must be uniform + R"(test:19:7 warning: parameter 'c' of 'foo' must be uniform foo(non_uniform); ^^^^^^^^^^^ @@ -7848,7 +7853,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:18:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:18:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7886,7 +7891,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7928,7 +7933,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -7974,7 +7979,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:11 error: 'dpdx' must only be called from uniform control flow + R"(test:15:11 warning: 'dpdx' must only be called from uniform control flow let y = dpdx(vec3()); ^^^^ @@ -8021,7 +8026,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:16:11 error: 'dpdx' must only be called from uniform control flow + R"(test:16:11 warning: 'dpdx' must only be called from uniform control flow let y = dpdx(vec3()); ^^^^ @@ -8067,7 +8072,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:5 error: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:5 warning: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^