Add test for bad function attribute

This test reproduces the unhelpful error message described in tint:291.

Bug: tint:291
Change-Id: Ie93cc59d981691981ba978b690d11c93dfe46ae0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31571
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton 2020-11-03 15:33:19 +00:00 committed by Commit Bot service account
parent d59a5da9e5
commit de6938789c
1 changed files with 8 additions and 0 deletions

View File

@ -286,6 +286,14 @@ TEST_F(ParserImplErrorTest, FunctionDeclDecoStageInvalid) {
" ^\n"); " ^\n");
} }
TEST_F(ParserImplErrorTest, FunctionDeclDecoStageTypeInvalid) {
// TODO(bclayton) - BUG(https://crbug.com/tint/291)
EXPECT("[[shader(vertex)]] fn main() -> void {}",
"test.wgsl:1:1 error: invalid token ([[) encountered\n"
"[[shader(vertex)]] fn main() -> void {}\n"
"^^\n");
}
TEST_F(ParserImplErrorTest, FunctionDeclDecoWorkgroupSizeMissingLParen) { TEST_F(ParserImplErrorTest, FunctionDeclDecoWorkgroupSizeMissingLParen) {
EXPECT("[[workgroup_size 1]] fn f() -> void {}", EXPECT("[[workgroup_size 1]] fn f() -> void {}",
"test.wgsl:1:18 error: missing ( for workgroup_size\n" "test.wgsl:1:18 error: missing ( for workgroup_size\n"