[llvm] r295174 - Attempt to fix buildbots after commit of r295173.
David Bozier via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 15 05:40:06 PST 2017
Author: davidb
Date: Wed Feb 15 07:40:05 2017
New Revision: 295174
URL: http://llvm.org/viewvc/llvm-project?rev=295174&view=rev
Log:
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).
Modified:
llvm/trunk/unittests/Object/SymbolicFileTest.cpp
Modified: llvm/trunk/unittests/Object/SymbolicFileTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Object/SymbolicFileTest.cpp?rev=295174&r1=295173&r2=295174&view=diff
==============================================================================
--- llvm/trunk/unittests/Object/SymbolicFileTest.cpp (original)
+++ llvm/trunk/unittests/Object/SymbolicFileTest.cpp Wed Feb 15 07:40:05 2017
@@ -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();
More information about the llvm-commits
mailing list