forked from OSchip/llvm-project
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). llvm-svn: 295174
This commit is contained in:
parent
4ab9a06f6a
commit
5c8e5f3722
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue