summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2016-03-04 18:33:44 +0000
committerFilipe Cabecinhas <me@filcab.net>2016-03-04 18:33:44 +0000
commit6448fe632a7d3bb0f89b143d24ec37adc8aee3ab (patch)
treebac3d0a2cd258db3a5601537c09ad51e13c396ed
parent649b5db557d5c7005e2f2ca9d893377bd733dc2e (diff)
downloadbcm5719-llvm-6448fe632a7d3bb0f89b143d24ec37adc8aee3ab.tar.gz
bcm5719-llvm-6448fe632a7d3bb0f89b143d24ec37adc8aee3ab.zip
[ubsan/float-cast-overflow] Make the test also work with C++11 narrowing
llvm-svn: 262733
-rw-r--r--compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp b/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp
index 1551bf593df..5f51553f4e4 100644
--- a/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp
@@ -61,18 +61,18 @@ int main(int argc, char **argv) {
// Build a '+Inf'.
#if BYTE_ORDER == LITTLE_ENDIAN
- char InfVal[] = { 0x00, 0x00, 0x80, 0x7f };
+ unsigned char InfVal[] = { 0x00, 0x00, 0x80, 0x7f };
#else
- char InfVal[] = { 0x7f, 0x80, 0x00, 0x00 };
+ unsigned char InfVal[] = { 0x7f, 0x80, 0x00, 0x00 };
#endif
float Inf;
memcpy(&Inf, InfVal, 4);
// Build a 'NaN'.
#if BYTE_ORDER == LITTLE_ENDIAN
- char NaNVal[] = { 0x01, 0x00, 0x80, 0x7f };
+ unsigned char NaNVal[] = { 0x01, 0x00, 0x80, 0x7f };
#else
- char NaNVal[] = { 0x7f, 0x80, 0x00, 0x01 };
+ unsigned char NaNVal[] = { 0x7f, 0x80, 0x00, 0x01 };
#endif
float NaN;
memcpy(&NaN, NaNVal, 4);
OpenPOWER on IntegriCloud