mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
ProgramBuilder: Remove storage parameter from [Global]Const()
Storage classes are unused for constants. Also trim extra arguments to these variable constructor functions that are already defaulted to the same value. Change-Id: Ia0b44364de000bfb8799de15827ce08fcce5f5be Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/41541 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: dan sinclair <dsinclair@chromium.org> Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
37571bc32d
commit
81a29fe555
@@ -73,8 +73,7 @@ TEST_F(VariableTest, IsValid) {
|
||||
}
|
||||
|
||||
TEST_F(VariableTest, IsValid_WithConstructor) {
|
||||
auto* v = Var("my_var", ty.i32(), StorageClass::kNone, Expr("ident"),
|
||||
ast::VariableDecorationList{});
|
||||
auto* v = Var("my_var", ty.i32(), StorageClass::kNone, Expr("ident"));
|
||||
EXPECT_TRUE(v->IsValid());
|
||||
}
|
||||
|
||||
@@ -94,14 +93,12 @@ TEST_F(VariableTest, IsValid_MissingBoth) {
|
||||
}
|
||||
|
||||
TEST_F(VariableTest, IsValid_InvalidConstructor) {
|
||||
auto* v = Var("my_var", ty.i32(), StorageClass::kNone, Expr(""),
|
||||
ast::VariableDecorationList{});
|
||||
auto* v = Var("my_var", ty.i32(), StorageClass::kNone, Expr(""));
|
||||
EXPECT_FALSE(v->IsValid());
|
||||
}
|
||||
|
||||
TEST_F(VariableTest, to_str) {
|
||||
auto* v = Var("my_var", ty.f32(), StorageClass::kFunction, nullptr,
|
||||
ast::VariableDecorationList{});
|
||||
auto* v = Var("my_var", ty.f32(), StorageClass::kFunction);
|
||||
EXPECT_EQ(str(v), R"(Variable{
|
||||
my_var
|
||||
function
|
||||
|
||||
Reference in New Issue
Block a user