diff --git a/src/tests/end2end/ShaderTests.cpp b/src/tests/end2end/ShaderTests.cpp index e54dc79119..1bcc02448d 100644 --- a/src/tests/end2end/ShaderTests.cpp +++ b/src/tests/end2end/ShaderTests.cpp @@ -86,6 +86,15 @@ TEST_P(ShaderTests, ComputeLog2) { EXPECT_BUFFER_U32_RANGE_EQ(expected.data(), buffer, 0, kSteps); } +TEST_P(ShaderTests, BadWGSL) { + DAWN_SKIP_TEST_IF(HasToggleEnabled("skip_validation")); + + std::string shader = R"( +I am an invalid shader and should never pass validation! +})"; + ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, shader.c_str())); +} + DAWN_INSTANTIATE_TEST(ShaderTests, D3D12Backend(), MetalBackend(),