diff options
author | Filipe Cabecinhas <me@filcab.net> | 2016-03-04 18:33:44 +0000 |
---|---|---|
committer | Filipe Cabecinhas <me@filcab.net> | 2016-03-04 18:33:44 +0000 |
commit | 4bc6f1f20d83bdfca5ec891e65d5a8897f9d526c (patch) | |
tree | 019f4890b137695949a01c0f3c8f809c2cbeea81 /test/ubsan/TestCases/Float | |
parent | 0fa2119172749af01eb2d3e66ede43ebe583a34d (diff) |
[ubsan/float-cast-overflow] Make the test also work with C++11 narrowing
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262733 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ubsan/TestCases/Float')
-rw-r--r-- | test/ubsan/TestCases/Float/cast-overflow.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/ubsan/TestCases/Float/cast-overflow.cpp b/test/ubsan/TestCases/Float/cast-overflow.cpp index 1551bf593..5f51553f4 100644 --- a/test/ubsan/TestCases/Float/cast-overflow.cpp +++ b/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); |