summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2016-03-12 01:57:31 +0000
committerNico Weber <nicolasweber@gmx.de>2016-03-12 01:57:31 +0000
commit39a02a7beddbb720c3e9eda82e5e007b5c6738a0 (patch)
treea599d2023b834d1bf20c9af1183f600ee43cd35c
parent64d24578d8e199a5f0de8849179ab58807747afb (diff)
downloadbcm5719-llvm-39a02a7beddbb720c3e9eda82e5e007b5c6738a0.tar.gz
bcm5719-llvm-39a02a7beddbb720c3e9eda82e5e007b5c6738a0.zip
Fix bad regression from r263077 when building with MSVC.
That change did: -#if defined(__BIG_ENDIAN__) +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ If __BYTE_ORDER__ and __ORDER_BIG_ENDIAN__ aren't defined, like they are with MSVC, this condition is true (0 == 0). Fixes PR26919. llvm-svn: 263324
-rw-r--r--compiler-rt/lib/ubsan/ubsan_value.cc4
-rw-r--r--compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp3
2 files changed, 2 insertions, 5 deletions
diff --git a/compiler-rt/lib/ubsan/ubsan_value.cc b/compiler-rt/lib/ubsan/ubsan_value.cc
index 72faf2ee14b..466834c09ed 100644
--- a/compiler-rt/lib/ubsan/ubsan_value.cc
+++ b/compiler-rt/lib/ubsan/ubsan_value.cc
@@ -83,12 +83,12 @@ FloatMax Value::getFloatValue() const {
#endif
case 32: {
float Value;
-#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
// For big endian the float value is in the last 4 bytes.
// On some targets we may only have 4 bytes so we count backwards from
// the end of Val to account for both the 32-bit and 64-bit cases.
internal_memcpy(&Value, ((const char*)(&Val + 1)) - 4, 4);
-#else
+#else
internal_memcpy(&Value, &Val, 4);
#endif
return Value;
diff --git a/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp b/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp
index e833d9fc948..5f51553f4e4 100644
--- a/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp
@@ -11,9 +11,6 @@
// FIXME: not %run %t 8 2>&1 | FileCheck %s --check-prefix=CHECK-8
// RUN: not %run %t 9 2>&1 | FileCheck %s --check-prefix=CHECK-9
-// FIXME: http://llvm.org/PR26919
-// XFAIL: win32
-
// This test assumes float and double are IEEE-754 single- and double-precision.
#if defined(__APPLE__)
OpenPOWER on IntegriCloud