[Lldb-commits] [lldb] r321879 - [ArchSpec] Add a unittest to complement the change in r321856.
Davide Italiano via lldb-commits
lldb-commits at lists.llvm.org
Fri Jan 5 10:00:44 PST 2018
Author: davide
Date: Fri Jan 5 10:00:44 2018
New Revision: 321879
URL: http://llvm.org/viewvc/llvm-project?rev=321879&view=rev
Log:
[ArchSpec] Add a unittest to complement the change in r321856.
<rdar://problem/35778442>
Modified:
lldb/trunk/unittests/Utility/ArchSpecTest.cpp
Modified: lldb/trunk/unittests/Utility/ArchSpecTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Utility/ArchSpecTest.cpp?rev=321879&r1=321878&r2=321879&view=diff
==============================================================================
--- lldb/trunk/unittests/Utility/ArchSpecTest.cpp (original)
+++ lldb/trunk/unittests/Utility/ArchSpecTest.cpp Fri Jan 5 10:00:44 2018
@@ -152,3 +152,22 @@ TEST(ArchSpecTest, MergeFrom) {
EXPECT_EQ(llvm::Triple::OSType::Linux, A.GetTriple().getOS());
EXPECT_EQ(ArchSpec::eCore_x86_64_x86_64, A.GetCore());
}
+
+TEST(ArchSpecTest, MergeFromMachOUnknown) {
+ class MyArchSpec : public ArchSpec {
+ public:
+ MyArchSpec() {
+ this->SetTriple("unknown-mach-64");
+ this->m_core = ArchSpec::eCore_uknownMach64;
+ this->m_byte_order = eByteOrderLittle;
+ this->m_flags = 0;
+ }
+ };
+
+ MyArchSpec A;
+ ASSERT_TRUE(A.IsValid());
+ MyArchSpec B;
+ ASSERT_TRUE(B.IsValid());
+ A.MergeFrom(B);
+ ASSERT_EQ(A.GetCore(), ArchSpec::eCore_uknownMach64);
+}
More information about the lldb-commits
mailing list