1*07355c1cSPavel Labath //===-- ABITest.cpp -------------------------------------------------------===//
2*07355c1cSPavel Labath //
3*07355c1cSPavel Labath // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*07355c1cSPavel Labath // See https://llvm.org/LICENSE.txt for license information.
5*07355c1cSPavel Labath // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*07355c1cSPavel Labath //
7*07355c1cSPavel Labath //===----------------------------------------------------------------------===//
8*07355c1cSPavel Labath 
9*07355c1cSPavel Labath #include "lldb/Target/ABI.h"
10*07355c1cSPavel Labath #include "gtest/gtest.h"
11*07355c1cSPavel Labath 
12*07355c1cSPavel Labath using namespace lldb_private;
13*07355c1cSPavel Labath 
TEST(MCBasedABI,MapRegisterName)14*07355c1cSPavel Labath TEST(MCBasedABI, MapRegisterName) {
15*07355c1cSPavel Labath   auto map = [](std::string name) {
16*07355c1cSPavel Labath     MCBasedABI::MapRegisterName(name, "foo", "bar");
17*07355c1cSPavel Labath     return name;
18*07355c1cSPavel Labath   };
19*07355c1cSPavel Labath   EXPECT_EQ("bar", map("foo"));
20*07355c1cSPavel Labath   EXPECT_EQ("bar0", map("foo0"));
21*07355c1cSPavel Labath   EXPECT_EQ("bar47", map("foo47"));
22*07355c1cSPavel Labath   EXPECT_EQ("foo47x", map("foo47x"));
23*07355c1cSPavel Labath   EXPECT_EQ("fooo47", map("fooo47"));
24*07355c1cSPavel Labath   EXPECT_EQ("bar47", map("bar47"));
25*07355c1cSPavel Labath }
26*07355c1cSPavel Labath 
27