mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-15 16:16:08 +00:00
validation: validate function call pointer parameter
Each argument of a function call of pointer type must be one of: - An address-of expression of a variable identifier expression - A function parameter Also added source location to duplicate struct member name unittest Bug: tint:983 Change-Id: Ic5ab010b2ed76207a1d8d3ef9f66140ea95f7e72 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58480 Auto-Submit: Sarah Mashayekhi <sarahmashay@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@chromium.org> Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
This commit is contained in:
@@ -79,35 +79,6 @@ fn f() {
|
||||
EXPECT_EQ(expect, str(got));
|
||||
}
|
||||
|
||||
TEST_F(InlinePointerLetsTest, Param) {
|
||||
auto* src = R"(
|
||||
fn x(p : ptr<function, i32>) -> i32 {
|
||||
return *p;
|
||||
}
|
||||
|
||||
fn f() {
|
||||
var v : i32;
|
||||
let p : ptr<function, i32> = &v;
|
||||
var r : i32 = x(p);
|
||||
}
|
||||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
fn x(p : ptr<function, i32>) -> i32 {
|
||||
return *(p);
|
||||
}
|
||||
|
||||
fn f() {
|
||||
var v : i32;
|
||||
var r : i32 = x(&(v));
|
||||
}
|
||||
)";
|
||||
|
||||
auto got = Run<InlinePointerLets>(src);
|
||||
|
||||
EXPECT_EQ(expect, str(got));
|
||||
}
|
||||
|
||||
TEST_F(InlinePointerLetsTest, SavedVars) {
|
||||
auto* src = R"(
|
||||
struct S {
|
||||
|
||||
Reference in New Issue
Block a user