From 6448fe632a7d3bb0f89b143d24ec37adc8aee3ab Mon Sep 17 00:00:00 2001 From: Filipe Cabecinhas Date: Fri, 4 Mar 2016 18:33:44 +0000 Subject: [PATCH] [ubsan/float-cast-overflow] Make the test also work with C++11 narrowing llvm-svn: 262733 --- compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp | 8 ++++---- 1 file 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 1551bf5..5f51553 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); -- 2.7.4