From: Filipe Cabecinhas Date: Fri, 4 Mar 2016 18:33:44 +0000 (+0000) Subject: [ubsan/float-cast-overflow] Make the test also work with C++11 narrowing X-Git-Tag: llvmorg-3.9.0-rc1~12455 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6448fe632a7d3bb0f89b143d24ec37adc8aee3ab;p=platform%2Fupstream%2Fllvm.git [ubsan/float-cast-overflow] Make the test also work with C++11 narrowing llvm-svn: 262733 --- 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);