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