diff --git a/src/tint/resolver/attribute_validation_test.cc b/src/tint/resolver/attribute_validation_test.cc index ca36e0b583..18200d4214 100644 --- a/src/tint/resolver/attribute_validation_test.cc +++ b/src/tint/resolver/attribute_validation_test.cc @@ -54,6 +54,7 @@ enum class AttributeKind { kAlign, kBinding, kBuiltin, + kDiagnostic, kGroup, kId, kInterpolate, @@ -95,6 +96,9 @@ static utils::Vector createAttributes(const Source& so return {builder.Binding(source, 1_a)}; case AttributeKind::kBuiltin: return {builder.Builtin(source, ast::BuiltinValue::kPosition)}; + case AttributeKind::kDiagnostic: + return {builder.DiagnosticAttribute(source, ast::DiagnosticSeverity::kInfo, + builder.Expr("chromium_unreachable_code"))}; case AttributeKind::kGroup: return {builder.Group(source, 1_a)}; case AttributeKind::kId: @@ -147,6 +151,7 @@ INSTANTIATE_TEST_SUITE_P(ResolverAttributeValidationTest, testing::Values(TestParams{AttributeKind::kAlign, false}, TestParams{AttributeKind::kBinding, false}, TestParams{AttributeKind::kBuiltin, false}, + TestParams{AttributeKind::kDiagnostic, false}, TestParams{AttributeKind::kGroup, false}, TestParams{AttributeKind::kId, false}, TestParams{AttributeKind::kInterpolate, false}, @@ -183,6 +188,7 @@ INSTANTIATE_TEST_SUITE_P(ResolverAttributeValidationTest, testing::Values(TestParams{AttributeKind::kAlign, false}, TestParams{AttributeKind::kBinding, false}, TestParams{AttributeKind::kBuiltin, false}, + TestParams{AttributeKind::kDiagnostic, false}, TestParams{AttributeKind::kGroup, false}, TestParams{AttributeKind::kId, false}, TestParams{AttributeKind::kInterpolate, false}, @@ -233,6 +239,7 @@ INSTANTIATE_TEST_SUITE_P(ResolverAttributeValidationTest, testing::Values(TestParams{AttributeKind::kAlign, false}, TestParams{AttributeKind::kBinding, false}, TestParams{AttributeKind::kBuiltin, false}, + TestParams{AttributeKind::kDiagnostic, false}, TestParams{AttributeKind::kGroup, false}, TestParams{AttributeKind::kId, false}, TestParams{AttributeKind::kInterpolate, false}, @@ -270,6 +277,7 @@ INSTANTIATE_TEST_SUITE_P(ResolverAttributeValidationTest, testing::Values(TestParams{AttributeKind::kAlign, false}, TestParams{AttributeKind::kBinding, false}, TestParams{AttributeKind::kBuiltin, true}, + TestParams{AttributeKind::kDiagnostic, false}, TestParams{AttributeKind::kGroup, false}, TestParams{AttributeKind::kId, false}, // kInterpolate tested separately (requires @location) @@ -323,6 +331,7 @@ INSTANTIATE_TEST_SUITE_P(ResolverAttributeValidationTest, testing::Values(TestParams{AttributeKind::kAlign, false}, TestParams{AttributeKind::kBinding, false}, TestParams{AttributeKind::kBuiltin, false}, + TestParams{AttributeKind::kDiagnostic, false}, TestParams{AttributeKind::kGroup, false}, TestParams{AttributeKind::kId, false}, TestParams{AttributeKind::kInterpolate, true}, @@ -373,6 +382,7 @@ INSTANTIATE_TEST_SUITE_P(ResolverAttributeValidationTest, testing::Values(TestParams{AttributeKind::kAlign, false}, TestParams{AttributeKind::kBinding, false}, TestParams{AttributeKind::kBuiltin, false}, + TestParams{AttributeKind::kDiagnostic, false}, TestParams{AttributeKind::kGroup, false}, TestParams{AttributeKind::kId, false}, TestParams{AttributeKind::kInterpolate, false}, @@ -425,6 +435,7 @@ INSTANTIATE_TEST_SUITE_P(ResolverAttributeValidationTest, testing::Values(TestParams{AttributeKind::kAlign, false}, TestParams{AttributeKind::kBinding, false}, TestParams{AttributeKind::kBuiltin, false}, + TestParams{AttributeKind::kDiagnostic, false}, TestParams{AttributeKind::kGroup, false}, TestParams{AttributeKind::kId, false}, TestParams{AttributeKind::kInterpolate, true}, @@ -474,6 +485,7 @@ INSTANTIATE_TEST_SUITE_P(ResolverAttributeValidationTest, testing::Values(TestParams{AttributeKind::kAlign, false}, TestParams{AttributeKind::kBinding, false}, TestParams{AttributeKind::kBuiltin, true}, + TestParams{AttributeKind::kDiagnostic, false}, TestParams{AttributeKind::kGroup, false}, TestParams{AttributeKind::kId, false}, // kInterpolate tested separately (requires @location) @@ -578,6 +590,7 @@ INSTANTIATE_TEST_SUITE_P(ResolverAttributeValidationTest, testing::Values(TestParams{AttributeKind::kAlign, false}, TestParams{AttributeKind::kBinding, false}, TestParams{AttributeKind::kBuiltin, false}, + TestParams{AttributeKind::kDiagnostic, false}, TestParams{AttributeKind::kGroup, false}, TestParams{AttributeKind::kId, false}, TestParams{AttributeKind::kInterpolate, false}, @@ -613,6 +626,7 @@ INSTANTIATE_TEST_SUITE_P(ResolverAttributeValidationTest, testing::Values(TestParams{AttributeKind::kAlign, true}, TestParams{AttributeKind::kBinding, false}, TestParams{AttributeKind::kBuiltin, true}, + TestParams{AttributeKind::kDiagnostic, false}, TestParams{AttributeKind::kGroup, false}, TestParams{AttributeKind::kId, false}, // kInterpolate tested separately (requires @location) @@ -854,6 +868,7 @@ INSTANTIATE_TEST_SUITE_P(ResolverAttributeValidationTest, testing::Values(TestParams{AttributeKind::kAlign, false}, TestParams{AttributeKind::kBinding, false}, TestParams{AttributeKind::kBuiltin, false}, + TestParams{AttributeKind::kDiagnostic, false}, TestParams{AttributeKind::kGroup, false}, TestParams{AttributeKind::kId, false}, TestParams{AttributeKind::kInterpolate, false}, @@ -893,6 +908,7 @@ INSTANTIATE_TEST_SUITE_P(ResolverAttributeValidationTest, testing::Values(TestParams{AttributeKind::kAlign, false}, TestParams{AttributeKind::kBinding, false}, TestParams{AttributeKind::kBuiltin, false}, + TestParams{AttributeKind::kDiagnostic, false}, TestParams{AttributeKind::kGroup, false}, TestParams{AttributeKind::kId, false}, TestParams{AttributeKind::kInterpolate, false}, @@ -944,6 +960,7 @@ INSTANTIATE_TEST_SUITE_P(ResolverAttributeValidationTest, testing::Values(TestParams{AttributeKind::kAlign, false}, TestParams{AttributeKind::kBinding, false}, TestParams{AttributeKind::kBuiltin, false}, + TestParams{AttributeKind::kDiagnostic, false}, TestParams{AttributeKind::kGroup, false}, TestParams{AttributeKind::kId, false}, TestParams{AttributeKind::kInterpolate, false}, @@ -987,6 +1004,7 @@ INSTANTIATE_TEST_SUITE_P(ResolverAttributeValidationTest, testing::Values(TestParams{AttributeKind::kAlign, false}, TestParams{AttributeKind::kBinding, false}, TestParams{AttributeKind::kBuiltin, false}, + TestParams{AttributeKind::kDiagnostic, false}, TestParams{AttributeKind::kGroup, false}, TestParams{AttributeKind::kId, true}, TestParams{AttributeKind::kInterpolate, false},