1 //===-- RegisterValueTest.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/Utility/RegisterValue.h" 10 #include "gtest/gtest.h" 11 12 using namespace lldb_private; 13 14 TEST(RegisterValueTest, GetSet8) { 15 RegisterValue R8(uint8_t(47)); 16 EXPECT_EQ(47u, R8.GetAsUInt8()); 17 R8 = uint8_t(42); 18 EXPECT_EQ(42u, R8.GetAsUInt8()); 19 EXPECT_EQ(42u, R8.GetAsUInt16()); 20 EXPECT_EQ(42u, R8.GetAsUInt32()); 21 EXPECT_EQ(42u, R8.GetAsUInt64()); 22 } 23