[NFC][Coroutines] Use structured binding with llvm::enumerate in CoroSplit (#116879)
[llvm-project.git] / lldb / unittests / Target / ABITest.cpp
blob6ac34c872f27c0cd671eea42f69d3a17997d0736
1 //===-- 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 //===----------------------------------------------------------------------===//
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");
17 return name;
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"));