summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
diff options
context:
space:
mode:
authorWill Dietz <wdietz2@illinois.edu>2013-01-07 22:25:54 +0000
committerWill Dietz <wdietz2@illinois.edu>2013-01-07 22:25:54 +0000
commit2b40b7ef8446ba79a2c14e6b8d4d391920870bbc (patch)
tree1088f25855a5f198b33f87741cae4a2a742b8dd3 /compiler-rt/lib
parentcefb44869af6cf398c3c0607848c5498a116e616 (diff)
downloadbcm5719-llvm-2b40b7ef8446ba79a2c14e6b8d4d391920870bbc.tar.gz
bcm5719-llvm-2b40b7ef8446ba79a2c14e6b8d4d391920870bbc.zip
[ubsan] Check for appropriate types on compound assignment overflow diagnostics.
llvm-svn: 171802
Diffstat (limited to 'compiler-rt/lib')
-rw-r--r--compiler-rt/lib/ubsan/lit_tests/Integer/add-overflow.cpp2
-rw-r--r--compiler-rt/lib/ubsan/lit_tests/Integer/no-recover.cpp4
-rw-r--r--compiler-rt/lib/ubsan/lit_tests/Integer/uadd-overflow.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/compiler-rt/lib/ubsan/lit_tests/Integer/add-overflow.cpp b/compiler-rt/lib/ubsan/lit_tests/Integer/add-overflow.cpp
index 4477638c3c3..80543524f51 100644
--- a/compiler-rt/lib/ubsan/lit_tests/Integer/add-overflow.cpp
+++ b/compiler-rt/lib/ubsan/lit_tests/Integer/add-overflow.cpp
@@ -13,7 +13,7 @@ int main() {
#ifdef ADD_I32
int32_t k = 0x12345678;
k += 0x789abcde;
- // CHECK-ADD_I32: add-overflow.cpp:[[@LINE-1]]:5: runtime error: signed integer overflow: 305419896 + 2023406814 cannot be represented in type 'int32_t' (aka 'int')
+ // CHECK-ADD_I32: add-overflow.cpp:[[@LINE-1]]:5: runtime error: signed integer overflow: 305419896 + 2023406814 cannot be represented in type 'int'
#endif
#ifdef ADD_I64
diff --git a/compiler-rt/lib/ubsan/lit_tests/Integer/no-recover.cpp b/compiler-rt/lib/ubsan/lit_tests/Integer/no-recover.cpp
index b25d440c0fd..e200feaa79a 100644
--- a/compiler-rt/lib/ubsan/lit_tests/Integer/no-recover.cpp
+++ b/compiler-rt/lib/ubsan/lit_tests/Integer/no-recover.cpp
@@ -13,8 +13,8 @@ int main() {
uint32_t k = 0x87654321;
k += 0xedcba987;
- // RECOVER: no-recover.cpp:[[@LINE-1]]:5: runtime error: unsigned integer overflow: 2271560481 + 3989547399 cannot be represented in type 'uint32_t' (aka 'unsigned int')
- // ABORT: no-recover.cpp:[[@LINE-2]]:5: runtime error: unsigned integer overflow: 2271560481 + 3989547399 cannot be represented in type 'uint32_t' (aka 'unsigned int')
+ // RECOVER: no-recover.cpp:[[@LINE-1]]:5: runtime error: unsigned integer overflow: 2271560481 + 3989547399 cannot be represented in type 'unsigned int'
+ // ABORT: no-recover.cpp:[[@LINE-2]]:5: runtime error: unsigned integer overflow: 2271560481 + 3989547399 cannot be represented in type 'unsigned int'
(void)(uint64_t(10000000000000000000ull) + uint64_t(9000000000000000000ull));
// RECOVER: 10000000000000000000 + 9000000000000000000 cannot be represented in type 'unsigned long'
diff --git a/compiler-rt/lib/ubsan/lit_tests/Integer/uadd-overflow.cpp b/compiler-rt/lib/ubsan/lit_tests/Integer/uadd-overflow.cpp
index d7b43d0fd2e..0edb10092e2 100644
--- a/compiler-rt/lib/ubsan/lit_tests/Integer/uadd-overflow.cpp
+++ b/compiler-rt/lib/ubsan/lit_tests/Integer/uadd-overflow.cpp
@@ -13,7 +13,7 @@ int main() {
#ifdef ADD_I32
uint32_t k = 0x87654321;
k += 0xedcba987;
- // CHECK-ADD_I32: uadd-overflow.cpp:[[@LINE-1]]:5: runtime error: unsigned integer overflow: 2271560481 + 3989547399 cannot be represented in type 'uint32_t' (aka 'unsigned int')
+ // CHECK-ADD_I32: uadd-overflow.cpp:[[@LINE-1]]:5: runtime error: unsigned integer overflow: 2271560481 + 3989547399 cannot be represented in type 'unsigned int'
#endif
#ifdef ADD_I64
OpenPOWER on IntegriCloud