chromium/third_party/dawn/src/tint/lang/wgsl/ast/transform/renamer_test.cc

// Copyright 2021 The Dawn & Tint Authors
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
//    list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its
//    contributors may be used to endorse or promote products derived from
//    this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "src/tint/lang/wgsl/ast/transform/renamer.h"

#include <memory>
#include <unordered_set>
#include <vector>

#include "gmock/gmock.h"
#include "src/tint/lang/core/builtin_type.h"
#include "src/tint/lang/core/texel_format.h"
#include "src/tint/lang/wgsl/ast/transform/helper_test.h"
#include "src/tint/utils/text/string.h"

namespace tint::ast::transform {
namespace {

constexpr const char kUnicodeIdentifier[] =// "𝖎𝖉𝖊𝖓𝖙𝖎𝖋𝖎𝖊𝖗123"
    "\xf0\x9d\x96\x8e\xf0\x9d\x96\x89\xf0\x9d\x96\x8a\xf0\x9d\x96\x93"
    "\xf0\x9d\x96\x99\xf0\x9d\x96\x8e\xf0\x9d\x96\x8b\xf0\x9d\x96\x8e"
    "\xf0\x9d\x96\x8a\xf0\x9d\x96\x97\x31\x32\x33";

ContainerEq;

RenamerTest;

TEST_F(RenamerTest, EmptyModule) {}

TEST_F(RenamerTest, BasicModuleVertexIndex) {}

TEST_F(RenamerTest, RequestedNames) {}

TEST_F(RenamerTest, PreserveSwizzles) {}

TEST_F(RenamerTest, PreserveSwizzles_ThroughMaterialize) {}

TEST_F(RenamerTest, PreserveBuiltins) {}

TEST_F(RenamerTest, PreserveBuiltinTypes) {}

TEST_F(RenamerTest, PreserveBuiltinTypes_ViaPointerDot) {}

TEST_F(RenamerTest, PreserveCoreDiagnosticRuleName) {}

TEST_F(RenamerTest, PreserveUnicode) {}

TEST_F(RenamerTest, PreserveUnicodeRenameAll) {}

TEST_F(RenamerTest, AttemptSymbolCollision) {}

TEST_F(RenamerTest, PreserveTexelFormatAndAccess) {}

TEST_F(RenamerTest, PreserveAddressSpace) {}
RenamerTestGlsl;
RenamerTestHlsl;
RenamerTestMsl;

TEST_P(RenamerTestGlsl, Keywords) {}

TEST_P(RenamerTestHlsl, Keywords) {}

TEST_P(RenamerTestMsl, Keywords) {}

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

std::string ExpandBuiltinType(std::string_view name) {}

std::vector<std::string_view> ConstructableTypes() {}

RenamerBuiltinTypeTest;

TEST_P(RenamerBuiltinTypeTest, PreserveTypeUsage) {}
TEST_P(RenamerBuiltinTypeTest, PreserveTypeInitializer) {}

TEST_P(RenamerBuiltinTypeTest, PreserveTypeConversion) {}

TEST_F(RenamerBuiltinTypeTest, PreserveTypeExpression) {}

TEST_P(RenamerBuiltinTypeTest, RenameShadowedByAlias) {}

TEST_P(RenamerBuiltinTypeTest, RenameShadowedByStruct) {}

INSTANTIATE_TEST_SUITE_P();

/// @return WGSL builtin identifier keywords
std::vector<std::string_view> Identifiers() {}

RenamerBuiltinIdentifierTest;

TEST_P(RenamerBuiltinIdentifierTest, GlobalConstName) {}

TEST_P(RenamerBuiltinIdentifierTest, LocalVarName) {}

TEST_P(RenamerBuiltinIdentifierTest, FunctionName) {}

TEST_P(RenamerBuiltinIdentifierTest, StructName) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace
}  // namespace tint::ast::transform