mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 18:59:21 +00:00
Add Symbol to Variable.
This CL adds a Symbol to the Variable AST node along side the name. The name will be removed in a future CL. Change-Id: I1c05e5595392b1c4a0afa82387d97b2b4472bade Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/35881 Commit-Queue: dan sinclair <dsinclair@chromium.org> Auto-Submit: dan sinclair <dsinclair@chromium.org> Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
b5839939e1
commit
a57f842be9
@@ -14,13 +14,14 @@
|
||||
#include "src/scope_stack.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/builder.h"
|
||||
#include "src/ast/type/f32_type.h"
|
||||
#include "src/ast/variable.h"
|
||||
|
||||
namespace tint {
|
||||
namespace {
|
||||
|
||||
using ScopeStackTest = testing::Test;
|
||||
class ScopeStackTest : public ast::BuilderWithModule, public testing::Test {};
|
||||
|
||||
TEST_F(ScopeStackTest, Global) {
|
||||
ScopeStack<uint32_t> s;
|
||||
@@ -32,12 +33,9 @@ TEST_F(ScopeStackTest, Global) {
|
||||
}
|
||||
|
||||
TEST_F(ScopeStackTest, Global_SetWithPointer) {
|
||||
ast::type::F32 f32;
|
||||
ast::Variable v(Source{}, "my_var", ast::StorageClass::kNone, &f32, false,
|
||||
nullptr, ast::VariableDecorationList{});
|
||||
|
||||
auto* v = Var("my_var", ast::StorageClass::kNone, ty.f32);
|
||||
ScopeStack<ast::Variable*> s;
|
||||
s.set_global("var", &v);
|
||||
s.set_global("var", v);
|
||||
|
||||
ast::Variable* v2 = nullptr;
|
||||
EXPECT_TRUE(s.get("var", &v2));
|
||||
|
||||
Reference in New Issue
Block a user