From 0a86c4c923b9604cb44f56d6f663bdb9fba345f9 Mon Sep 17 00:00:00 2001 From: David Bozier Date: Wed, 15 Feb 2017 13:40:05 +0000 Subject: [PATCH] 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 --- unittests/Object/SymbolicFileTest.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/unittests/Object/SymbolicFileTest.cpp b/unittests/Object/SymbolicFileTest.cpp index 61859108ebd..20f838caf3a 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 @@ -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(); -- 2.50.1