mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 02:39:11 +00:00
tint: Move resolver/type_alias to type/short_name
'Short-name' is way less overloaded than 'alias' and 'builtin'. The package move allows transforms to use these enums. Change-Id: I61c6b3f7deee8e835990a948cd5427c07034fa5e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113440 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
04f792de9f
commit
d00663d882
@@ -66,10 +66,10 @@
|
||||
#include "src/tint/ast/void.h"
|
||||
#include "src/tint/ast/while_statement.h"
|
||||
#include "src/tint/ast/workgroup_attribute.h"
|
||||
#include "src/tint/resolver/type_alias.h"
|
||||
#include "src/tint/scope_stack.h"
|
||||
#include "src/tint/sem/builtin.h"
|
||||
#include "src/tint/symbol_table.h"
|
||||
#include "src/tint/type/short_name.h"
|
||||
#include "src/tint/utils/block_allocator.h"
|
||||
#include "src/tint/utils/defer.h"
|
||||
#include "src/tint/utils/map.h"
|
||||
@@ -486,7 +486,7 @@ class DependencyScanner {
|
||||
bool IsBuiltin(Symbol name) const {
|
||||
auto s = symbols_.NameFor(name);
|
||||
if (sem::ParseBuiltinType(s) != sem::BuiltinType::kNone ||
|
||||
ParseTypeAlias(s) != TypeAlias::kUndefined) {
|
||||
type::ParseShortName(s) != type::ShortName::kUndefined) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -51,7 +51,6 @@
|
||||
#include "src/tint/ast/vector.h"
|
||||
#include "src/tint/ast/while_statement.h"
|
||||
#include "src/tint/ast/workgroup_attribute.h"
|
||||
#include "src/tint/resolver/type_alias.h"
|
||||
#include "src/tint/resolver/uniformity.h"
|
||||
#include "src/tint/sem/array.h"
|
||||
#include "src/tint/sem/atomic.h"
|
||||
@@ -81,6 +80,7 @@
|
||||
#include "src/tint/type/reference.h"
|
||||
#include "src/tint/type/sampled_texture.h"
|
||||
#include "src/tint/type/sampler.h"
|
||||
#include "src/tint/type/short_name.h"
|
||||
#include "src/tint/type/storage_texture.h"
|
||||
#include "src/tint/utils/defer.h"
|
||||
#include "src/tint/utils/math.h"
|
||||
@@ -2349,32 +2349,32 @@ sem::Call* Resolver::BuiltinCall(const ast::CallExpression* expr,
|
||||
type::Type* Resolver::BuiltinTypeAlias(Symbol sym) const {
|
||||
auto name = builder_->Symbols().NameFor(sym);
|
||||
auto& b = *builder_;
|
||||
switch (ParseTypeAlias(name)) {
|
||||
case TypeAlias::kVec2F:
|
||||
switch (type::ParseShortName(name)) {
|
||||
case type::ShortName::kVec2F:
|
||||
return b.create<sem::Vector>(b.create<type::F32>(), 2u);
|
||||
case TypeAlias::kVec3F:
|
||||
case type::ShortName::kVec3F:
|
||||
return b.create<sem::Vector>(b.create<type::F32>(), 3u);
|
||||
case TypeAlias::kVec4F:
|
||||
case type::ShortName::kVec4F:
|
||||
return b.create<sem::Vector>(b.create<type::F32>(), 4u);
|
||||
case TypeAlias::kVec2H:
|
||||
case type::ShortName::kVec2H:
|
||||
return b.create<sem::Vector>(b.create<type::F16>(), 2u);
|
||||
case TypeAlias::kVec3H:
|
||||
case type::ShortName::kVec3H:
|
||||
return b.create<sem::Vector>(b.create<type::F16>(), 3u);
|
||||
case TypeAlias::kVec4H:
|
||||
case type::ShortName::kVec4H:
|
||||
return b.create<sem::Vector>(b.create<type::F16>(), 4u);
|
||||
case TypeAlias::kVec2I:
|
||||
case type::ShortName::kVec2I:
|
||||
return b.create<sem::Vector>(b.create<type::I32>(), 2u);
|
||||
case TypeAlias::kVec3I:
|
||||
case type::ShortName::kVec3I:
|
||||
return b.create<sem::Vector>(b.create<type::I32>(), 3u);
|
||||
case TypeAlias::kVec4I:
|
||||
case type::ShortName::kVec4I:
|
||||
return b.create<sem::Vector>(b.create<type::I32>(), 4u);
|
||||
case TypeAlias::kVec2U:
|
||||
case type::ShortName::kVec2U:
|
||||
return b.create<sem::Vector>(b.create<type::U32>(), 2u);
|
||||
case TypeAlias::kVec3U:
|
||||
case type::ShortName::kVec3U:
|
||||
return b.create<sem::Vector>(b.create<type::U32>(), 3u);
|
||||
case TypeAlias::kVec4U:
|
||||
case type::ShortName::kVec4U:
|
||||
return b.create<sem::Vector>(b.create<type::U32>(), 4u);
|
||||
case TypeAlias::kUndefined:
|
||||
case type::ShortName::kUndefined:
|
||||
break;
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
// Copyright 2022 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/src/cmd/gen
|
||||
// using the template:
|
||||
// src/tint/resolver/type_alias.cc.tmpl
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "src/tint/resolver/type_alias.h"
|
||||
|
||||
namespace tint::resolver {
|
||||
|
||||
/// ParseTypeAlias parses a TypeAlias from a string.
|
||||
/// @param str the string to parse
|
||||
/// @returns the parsed enum, or TypeAlias::kUndefined if the string could not be parsed.
|
||||
TypeAlias ParseTypeAlias(std::string_view str) {
|
||||
if (str == "vec2f") {
|
||||
return TypeAlias::kVec2F;
|
||||
}
|
||||
if (str == "vec2h") {
|
||||
return TypeAlias::kVec2H;
|
||||
}
|
||||
if (str == "vec2i") {
|
||||
return TypeAlias::kVec2I;
|
||||
}
|
||||
if (str == "vec2u") {
|
||||
return TypeAlias::kVec2U;
|
||||
}
|
||||
if (str == "vec3f") {
|
||||
return TypeAlias::kVec3F;
|
||||
}
|
||||
if (str == "vec3h") {
|
||||
return TypeAlias::kVec3H;
|
||||
}
|
||||
if (str == "vec3i") {
|
||||
return TypeAlias::kVec3I;
|
||||
}
|
||||
if (str == "vec3u") {
|
||||
return TypeAlias::kVec3U;
|
||||
}
|
||||
if (str == "vec4f") {
|
||||
return TypeAlias::kVec4F;
|
||||
}
|
||||
if (str == "vec4h") {
|
||||
return TypeAlias::kVec4H;
|
||||
}
|
||||
if (str == "vec4i") {
|
||||
return TypeAlias::kVec4I;
|
||||
}
|
||||
if (str == "vec4u") {
|
||||
return TypeAlias::kVec4U;
|
||||
}
|
||||
return TypeAlias::kUndefined;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, TypeAlias value) {
|
||||
switch (value) {
|
||||
case TypeAlias::kUndefined:
|
||||
return out << "undefined";
|
||||
case TypeAlias::kVec2F:
|
||||
return out << "vec2f";
|
||||
case TypeAlias::kVec2H:
|
||||
return out << "vec2h";
|
||||
case TypeAlias::kVec2I:
|
||||
return out << "vec2i";
|
||||
case TypeAlias::kVec2U:
|
||||
return out << "vec2u";
|
||||
case TypeAlias::kVec3F:
|
||||
return out << "vec3f";
|
||||
case TypeAlias::kVec3H:
|
||||
return out << "vec3h";
|
||||
case TypeAlias::kVec3I:
|
||||
return out << "vec3i";
|
||||
case TypeAlias::kVec3U:
|
||||
return out << "vec3u";
|
||||
case TypeAlias::kVec4F:
|
||||
return out << "vec4f";
|
||||
case TypeAlias::kVec4H:
|
||||
return out << "vec4h";
|
||||
case TypeAlias::kVec4I:
|
||||
return out << "vec4i";
|
||||
case TypeAlias::kVec4U:
|
||||
return out << "vec4u";
|
||||
}
|
||||
return out << "<unknown>";
|
||||
}
|
||||
|
||||
} // namespace tint::resolver
|
||||
@@ -1,25 +0,0 @@
|
||||
{{- /*
|
||||
--------------------------------------------------------------------------------
|
||||
Template file for use with tools/src/cmd/gen to generate type_alias.cc
|
||||
|
||||
To update the generated file, run:
|
||||
./tools/run gen
|
||||
|
||||
See:
|
||||
* tools/src/cmd/gen for structures used by this template
|
||||
* https://golang.org/pkg/text/template/ for documentation on the template syntax
|
||||
--------------------------------------------------------------------------------
|
||||
*/ -}}
|
||||
|
||||
{{- Import "src/tint/templates/enums.tmpl.inc" -}}
|
||||
{{- $enum := (Sem.Enum "type_alias") -}}
|
||||
|
||||
#include "src/tint/resolver/type_alias.h"
|
||||
|
||||
namespace tint::resolver {
|
||||
|
||||
{{ Eval "ParseEnum" $enum}}
|
||||
|
||||
{{ Eval "EnumOStream" $enum}}
|
||||
|
||||
} // namespace tint::resolver
|
||||
@@ -1,64 +0,0 @@
|
||||
// Copyright 2022 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/src/cmd/gen
|
||||
// using the template:
|
||||
// src/tint/resolver/type_alias.h.tmpl
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef SRC_TINT_RESOLVER_TYPE_ALIAS_H_
|
||||
#define SRC_TINT_RESOLVER_TYPE_ALIAS_H_
|
||||
|
||||
#include <ostream>
|
||||
|
||||
namespace tint::resolver {
|
||||
|
||||
/// An enumerator of builtin type aliases.
|
||||
enum class TypeAlias {
|
||||
kUndefined,
|
||||
kVec2F,
|
||||
kVec2H,
|
||||
kVec2I,
|
||||
kVec2U,
|
||||
kVec3F,
|
||||
kVec3H,
|
||||
kVec3I,
|
||||
kVec3U,
|
||||
kVec4F,
|
||||
kVec4H,
|
||||
kVec4I,
|
||||
kVec4U,
|
||||
};
|
||||
|
||||
/// @param out the std::ostream to write to
|
||||
/// @param value the TypeAlias
|
||||
/// @returns `out` so calls can be chained
|
||||
std::ostream& operator<<(std::ostream& out, TypeAlias value);
|
||||
|
||||
/// ParseTypeAlias parses a TypeAlias from a string.
|
||||
/// @param str the string to parse
|
||||
/// @returns the parsed enum, or TypeAlias::kUndefined if the string could not be parsed.
|
||||
TypeAlias ParseTypeAlias(std::string_view str);
|
||||
|
||||
constexpr const char* kTypeAliasStrings[] = {
|
||||
"vec2f", "vec2h", "vec2i", "vec2u", "vec3f", "vec3h",
|
||||
"vec3i", "vec3u", "vec4f", "vec4h", "vec4i", "vec4u",
|
||||
};
|
||||
|
||||
} // namespace tint::resolver
|
||||
|
||||
#endif // SRC_TINT_RESOLVER_TYPE_ALIAS_H_
|
||||
@@ -1,29 +0,0 @@
|
||||
{{- /*
|
||||
--------------------------------------------------------------------------------
|
||||
Template file for use with tools/src/cmd/gen to generate type_alias.h
|
||||
|
||||
To update the generated file, run:
|
||||
./tools/run gen
|
||||
|
||||
See:
|
||||
* tools/src/cmd/gen for structures used by this template
|
||||
* https://golang.org/pkg/text/template/ for documentation on the template syntax
|
||||
--------------------------------------------------------------------------------
|
||||
*/ -}}
|
||||
|
||||
{{- Import "src/tint/templates/enums.tmpl.inc" -}}
|
||||
{{- $enum := (Sem.Enum "type_alias") -}}
|
||||
|
||||
#ifndef SRC_TINT_RESOLVER_TYPE_ALIAS_H_
|
||||
#define SRC_TINT_RESOLVER_TYPE_ALIAS_H_
|
||||
|
||||
#include <ostream>
|
||||
|
||||
namespace tint::resolver {
|
||||
|
||||
/// An enumerator of builtin type aliases.
|
||||
{{ Eval "DeclareEnum" $enum}}
|
||||
|
||||
} // namespace tint::resolver
|
||||
|
||||
#endif // SRC_TINT_RESOLVER_TYPE_ALIAS_H_
|
||||
@@ -1,57 +0,0 @@
|
||||
// Copyright 2022 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/src/cmd/gen
|
||||
// using the template:
|
||||
// src/tint/resolver/type_alias_bench.cc.tmpl
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "src/tint/resolver/type_alias.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
#include "benchmark/benchmark.h"
|
||||
|
||||
namespace tint::resolver {
|
||||
namespace {
|
||||
|
||||
void TypeAliasParser(::benchmark::State& state) {
|
||||
std::array kStrings{
|
||||
"veccf", "32", "vVc2f", "vec2f", "vec21", "qqeJf", "vecll7f", "veqH2pp",
|
||||
"vh", "Gebh", "vec2h", "vevi2h", "ve8WWh", "Mxxc2", "vgg2i", "V2X",
|
||||
"vec23", "vec2i", "vec2E", "TTeP2i", "vxxcdd", "v44c2u", "veVVSSu", "22RRu",
|
||||
"vec2u", "vF2u", "vecu", "ROOHVu", "ecyf", "n77rrlcGf", "vec340", "vec3f",
|
||||
"oof", "vezz", "1ipp3f", "XXec3h", "ve9IInn5h", "HHreSSaYh", "vec3h", "kk3",
|
||||
"jgRR", "veb", "vjc3i", "vc3i", "vcq", "vec3i", "Nec3i", "vcvv",
|
||||
"ve3QQ", "vrcf", "vecju", "NNew23", "vec3u", "ve3u", "vrrc3u", "Gec3u",
|
||||
"veFF4f", "vE", "verrf", "vec4f", "vef", "veJJD", "v4", "e4k",
|
||||
"vech", "Jech", "vec4h", "ec4h", "_KKttcH", "vexxh", "__qcF", "vc4qq",
|
||||
"33e64i", "vec4i", "6QQott4i", "v6c4i", "zzc4O6", "vyyc4u", "vcZZ", "ecWq4u",
|
||||
"vec4u", "vOO4u", "oYe4", "v4",
|
||||
};
|
||||
for (auto _ : state) {
|
||||
for (auto& str : kStrings) {
|
||||
auto result = ParseTypeAlias(str);
|
||||
benchmark::DoNotOptimize(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(TypeAliasParser);
|
||||
|
||||
} // namespace
|
||||
} // namespace tint::resolver
|
||||
@@ -1,29 +0,0 @@
|
||||
{{- /*
|
||||
--------------------------------------------------------------------------------
|
||||
Template file for use with tools/src/cmd/gen to generate type_alias_bench.cc
|
||||
|
||||
To update the generated file, run:
|
||||
./tools/run gen
|
||||
|
||||
See:
|
||||
* tools/src/cmd/gen for structures used by this template
|
||||
* https://golang.org/pkg/text/template/ for documentation on the template syntax
|
||||
--------------------------------------------------------------------------------
|
||||
*/ -}}
|
||||
|
||||
{{- Import "src/tint/templates/enums.tmpl.inc" -}}
|
||||
{{- $enum := (Sem.Enum "type_alias") -}}
|
||||
|
||||
#include "src/tint/resolver/type_alias.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
#include "benchmark/benchmark.h"
|
||||
|
||||
namespace tint::resolver {
|
||||
namespace {
|
||||
|
||||
{{ Eval "BenchmarkParseEnum" $enum }}
|
||||
|
||||
} // namespace
|
||||
} // namespace tint::resolver
|
||||
@@ -1,97 +0,0 @@
|
||||
// Copyright 2022 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/src/cmd/gen
|
||||
// using the template:
|
||||
// src/tint/resolver/type_alias_test.cc.tmpl
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "src/tint/resolver/type_alias.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "src/tint/utils/string.h"
|
||||
|
||||
namespace tint::resolver {
|
||||
namespace {
|
||||
|
||||
namespace parse_print_tests {
|
||||
|
||||
struct Case {
|
||||
const char* string;
|
||||
TypeAlias value;
|
||||
};
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& out, Case c) {
|
||||
return out << "'" << std::string(c.string) << "'";
|
||||
}
|
||||
|
||||
static constexpr Case kValidCases[] = {
|
||||
{"vec2f", TypeAlias::kVec2F}, {"vec2h", TypeAlias::kVec2H}, {"vec2i", TypeAlias::kVec2I},
|
||||
{"vec2u", TypeAlias::kVec2U}, {"vec3f", TypeAlias::kVec3F}, {"vec3h", TypeAlias::kVec3H},
|
||||
{"vec3i", TypeAlias::kVec3I}, {"vec3u", TypeAlias::kVec3U}, {"vec4f", TypeAlias::kVec4F},
|
||||
{"vec4h", TypeAlias::kVec4H}, {"vec4i", TypeAlias::kVec4I}, {"vec4u", TypeAlias::kVec4U},
|
||||
};
|
||||
|
||||
static constexpr Case kInvalidCases[] = {
|
||||
{"veccf", TypeAlias::kUndefined}, {"32", TypeAlias::kUndefined},
|
||||
{"vVc2f", TypeAlias::kUndefined}, {"vec21", TypeAlias::kUndefined},
|
||||
{"qqeJh", TypeAlias::kUndefined}, {"vecll7h", TypeAlias::kUndefined},
|
||||
{"veqH2pp", TypeAlias::kUndefined}, {"vi", TypeAlias::kUndefined},
|
||||
{"Gebi", TypeAlias::kUndefined}, {"vevi2u", TypeAlias::kUndefined},
|
||||
{"ve8WWu", TypeAlias::kUndefined}, {"Mxxc2", TypeAlias::kUndefined},
|
||||
{"vgg3f", TypeAlias::kUndefined}, {"V3X", TypeAlias::kUndefined},
|
||||
{"vec33", TypeAlias::kUndefined}, {"vec3E", TypeAlias::kUndefined},
|
||||
{"TTeP3h", TypeAlias::kUndefined}, {"vxxcdd", TypeAlias::kUndefined},
|
||||
{"v44c3i", TypeAlias::kUndefined}, {"veVVSSi", TypeAlias::kUndefined},
|
||||
{"22RRi", TypeAlias::kUndefined}, {"vF3u", TypeAlias::kUndefined},
|
||||
{"vecu", TypeAlias::kUndefined}, {"ROOHVu", TypeAlias::kUndefined},
|
||||
{"ecyf", TypeAlias::kUndefined}, {"n77rrlcGf", TypeAlias::kUndefined},
|
||||
{"vec440", TypeAlias::kUndefined}, {"ooh", TypeAlias::kUndefined},
|
||||
{"vezz", TypeAlias::kUndefined}, {"1ipp4h", TypeAlias::kUndefined},
|
||||
{"XXec4i", TypeAlias::kUndefined}, {"ve9IInn5i", TypeAlias::kUndefined},
|
||||
{"HHreSSaYi", TypeAlias::kUndefined}, {"kk4", TypeAlias::kUndefined},
|
||||
{"jgRR", TypeAlias::kUndefined}, {"veb", TypeAlias::kUndefined},
|
||||
};
|
||||
|
||||
using TypeAliasParseTest = testing::TestWithParam<Case>;
|
||||
|
||||
TEST_P(TypeAliasParseTest, Parse) {
|
||||
const char* string = GetParam().string;
|
||||
TypeAlias expect = GetParam().value;
|
||||
EXPECT_EQ(expect, ParseTypeAlias(string));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(ValidCases, TypeAliasParseTest, testing::ValuesIn(kValidCases));
|
||||
INSTANTIATE_TEST_SUITE_P(InvalidCases, TypeAliasParseTest, testing::ValuesIn(kInvalidCases));
|
||||
|
||||
using TypeAliasPrintTest = testing::TestWithParam<Case>;
|
||||
|
||||
TEST_P(TypeAliasPrintTest, Print) {
|
||||
TypeAlias value = GetParam().value;
|
||||
const char* expect = GetParam().string;
|
||||
EXPECT_EQ(expect, utils::ToString(value));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(ValidCases, TypeAliasPrintTest, testing::ValuesIn(kValidCases));
|
||||
|
||||
} // namespace parse_print_tests
|
||||
|
||||
} // namespace
|
||||
} // namespace tint::resolver
|
||||
@@ -1,31 +0,0 @@
|
||||
{{- /*
|
||||
--------------------------------------------------------------------------------
|
||||
Template file for use with tools/src/cmd/gen to generate type_alias_test.cc
|
||||
|
||||
To update the generated file, run:
|
||||
./tools/run gen
|
||||
|
||||
See:
|
||||
* tools/src/cmd/gen for structures used by this template
|
||||
* https://golang.org/pkg/text/template/ for documentation on the template syntax
|
||||
--------------------------------------------------------------------------------
|
||||
*/ -}}
|
||||
|
||||
{{- Import "src/tint/templates/enums.tmpl.inc" -}}
|
||||
{{- $enum := (Sem.Enum "type_alias") -}}
|
||||
|
||||
#include "src/tint/resolver/type_alias.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "src/tint/utils/string.h"
|
||||
|
||||
namespace tint::resolver {
|
||||
namespace {
|
||||
|
||||
{{ Eval "TestParsePrintEnum" $enum}}
|
||||
|
||||
} // namespace
|
||||
} // namespace tint::resolver
|
||||
Reference in New Issue
Block a user