summaryrefslogtreecommitdiff
path: root/unittests/Utility/ArchSpecTest.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:09:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:09:23 +0000
commitf73363f1dd94996356cefbf24388f561891acf0b (patch)
treee3c31248bdb36eaec5fd833490d4278162dba2a0 /unittests/Utility/ArchSpecTest.cpp
parent160ee69dd7ae18978f4068116777639ea98dc951 (diff)
Notes
Diffstat (limited to 'unittests/Utility/ArchSpecTest.cpp')
-rw-r--r--unittests/Utility/ArchSpecTest.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/unittests/Utility/ArchSpecTest.cpp b/unittests/Utility/ArchSpecTest.cpp
index a45e28e658b8..d7397cbec531 100644
--- a/unittests/Utility/ArchSpecTest.cpp
+++ b/unittests/Utility/ArchSpecTest.cpp
@@ -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);
+}