blob: 6ac34c872f27c0cd671eea42f69d3a17997d0736 [file] [log] [blame]
Pavel Labath07355c12020-02-03 17:58:37 +01001//===-- ABITest.cpp -------------------------------------------------------===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9#include "lldb/Target/ABI.h"
10#include "gtest/gtest.h"
11
12using namespace lldb_private;
13
14TEST(MCBasedABI, MapRegisterName) {
15 auto map = [](std::string name) {
16 MCBasedABI::MapRegisterName(name, "foo", "bar");
17 return name;
18 };
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"));
25}
26