summaryrefslogtreecommitdiff
path: root/test/ubsan
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
commit4bc6f1f20d83bdfca5ec891e65d5a8897f9d526c (patch)
tree019f4890b137695949a01c0f3c8f809c2cbeea81 /test/ubsan
parent0fa2119172749af01eb2d3e66ede43ebe583a34d (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')
-rw-r--r--test/ubsan/TestCases/Float/cast-overflow.cpp8
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);