summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Bozier <seifsta@gmail.com>2017-02-15 13:40:05 +0000
committerDavid Bozier <seifsta@gmail.com>2017-02-15 13:40:05 +0000
commit0a86c4c923b9604cb44f56d6f663bdb9fba345f9 (patch)
treebbc1d20d532d75b4c74c8173ad37393bacad33af
parent9bb9b311b27732c0c98300fd6faf5b2dd6accb6a (diff)
Attempt to fix buildbots after commit of r295173.
Unit tests needed to check on the endianness of the host platform. (Test was failing for big endian hosts). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295174 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--unittests/Object/SymbolicFileTest.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/unittests/Object/SymbolicFileTest.cpp b/unittests/Object/SymbolicFileTest.cpp
index 61859108ebd1..20f838caf3a0 100644
--- a/unittests/Object/SymbolicFileTest.cpp
+++ b/unittests/Object/SymbolicFileTest.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Object/SymbolicFile.h"
+#include "llvm/Support/Host.h"
#include "llvm/Support/raw_ostream.h"
#include "gtest/gtest.h"
#include <sstream>
@@ -23,9 +24,18 @@ TEST(Object, DataRefImplOstream) {
sizeof Data.p == sizeof(uint32_t),
"Test expected pointer type to be 32 or 64-bit.");
- char const *Expected = sizeof Data.p == sizeof(uint64_t)
+ char const *Expected;
+
+ if (llvm::sys::IsLittleEndianHost) {
+ Expected = sizeof Data.p == sizeof(uint64_t)
? "(0xffffeeee0000 (0xeeee0000, 0x0000ffff))"
: "(0xeeee0000 (0xeeee0000, 0x0000ffff))";
+ }
+ else {
+ Expected = sizeof Data.p == sizeof(uint64_t)
+ ? "(0xeeee00000000ffff (0xeeee0000, 0x0000ffff))"
+ : "(0x0000ffff (0xeeee0000, 0x0000ffff))";
+ }
OS << Data;
OS.flush();