mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 01:15:39 +00:00
Add unit test to check LHS is not an intrinsic function name
Identifiers cannot be assigned. Bug: tint:203 Change-Id: Ibe34749264024b690d8a8bd271304f425a2688ed Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54080 Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com> Auto-Submit: Sarah Mashayekhi <sarahmashay@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
This commit is contained in:
@@ -86,6 +86,13 @@ TEST_F(ParserImplErrorTest, AssignmentStmtMissingSemicolon) {
|
||||
" ^\n");
|
||||
}
|
||||
|
||||
TEST_F(ParserImplErrorTest, AssignmentStmtInvalidLHS_IntrinsicFunctionName) {
|
||||
EXPECT("normalize = 5;",
|
||||
"test.wgsl:1:1 error: statement found outside of function body\n"
|
||||
"normalize = 5;\n"
|
||||
"^^^^^^^^^\n");
|
||||
}
|
||||
|
||||
TEST_F(ParserImplErrorTest, AssignmentStmtInvalidRHS) {
|
||||
EXPECT("fn f() { a = >; }",
|
||||
"test.wgsl:1:14 error: unable to parse right side of assignment\n"
|
||||
|
||||
Reference in New Issue
Block a user