[llvm-commits] [compiler-rt] r171802 - in /compiler-rt/trunk/lib/ubsan/lit_tests/Integer: add-overflow.cpp no-recover.cpp uadd-overflow.cpp

Will Dietz wdietz2 at illinois.edu
Mon Jan 7 14:25:54 PST 2013


Author: wdietz2
Date: Mon Jan  7 16:25:54 2013
New Revision: 171802

URL: http://llvm.org/viewvc/llvm-project?rev=171802&view=rev
Log:
[ubsan] Check for appropriate types on compound assignment overflow diagnostics.

Modified:
    compiler-rt/trunk/lib/ubsan/lit_tests/Integer/add-overflow.cpp
    compiler-rt/trunk/lib/ubsan/lit_tests/Integer/no-recover.cpp
    compiler-rt/trunk/lib/ubsan/lit_tests/Integer/uadd-overflow.cpp

Modified: compiler-rt/trunk/lib/ubsan/lit_tests/Integer/add-overflow.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/lit_tests/Integer/add-overflow.cpp?rev=171802&r1=171801&r2=171802&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/lit_tests/Integer/add-overflow.cpp (original)
+++ compiler-rt/trunk/lib/ubsan/lit_tests/Integer/add-overflow.cpp Mon Jan  7 16:25:54 2013
@@ -13,7 +13,7 @@
 #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

Modified: compiler-rt/trunk/lib/ubsan/lit_tests/Integer/no-recover.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/lit_tests/Integer/no-recover.cpp?rev=171802&r1=171801&r2=171802&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/lit_tests/Integer/no-recover.cpp (original)
+++ compiler-rt/trunk/lib/ubsan/lit_tests/Integer/no-recover.cpp Mon Jan  7 16:25:54 2013
@@ -13,8 +13,8 @@
 
   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'

Modified: compiler-rt/trunk/lib/ubsan/lit_tests/Integer/uadd-overflow.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/lit_tests/Integer/uadd-overflow.cpp?rev=171802&r1=171801&r2=171802&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/lit_tests/Integer/uadd-overflow.cpp (original)
+++ compiler-rt/trunk/lib/ubsan/lit_tests/Integer/uadd-overflow.cpp Mon Jan  7 16:25:54 2013
@@ -13,7 +13,7 @@
 #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





More information about the llvm-commits mailing list