Peter Collingbourne | 49d29ed | 2013-10-20 21:29:32 +0000 | [diff] [blame^] | 1 | // RUN: %clangxx -fsanitize=signed-integer-overflow %s -o %t && %t 2>&1 | FileCheck %s |
Richard Smith | 6ebe451 | 2012-10-09 19:34:32 +0000 | [diff] [blame] | 2 | |
| 3 | #include <stdint.h> |
| 4 | |
| 5 | int main() { |
| 6 | unsigned(0x80000000) / -1; |
| 7 | |
Will Dietz | 7cbd7e5 | 2012-12-02 18:43:33 +0000 | [diff] [blame] | 8 | // CHECK: div-overflow.cpp:9:23: runtime error: division of -2147483648 by -1 cannot be represented in type 'int' |
Richard Smith | 6ebe451 | 2012-10-09 19:34:32 +0000 | [diff] [blame] | 9 | int32_t(0x80000000) / -1; |
| 10 | } |