1 // RUN: %clangxx -fsanitize=signed-integer-overflow -fsanitize-recover=all %s -o %t && %run %t 2>&1 | FileCheck %s 2 3 #include <stdint.h> 4 5 #define OVERFLOW \ 6 x = 0x7FFFFFFE; \ 7 x += __LINE__ 8 main()9int main() { 10 int32_t x; 11 OVERFLOW; // CHECK: add-overflow 12 OVERFLOW; // CHECK: add-overflow 13 OVERFLOW; // CHECK: add-overflow 14 OVERFLOW; // CHECK: add-overflow 15 OVERFLOW; // CHECK: add-overflow 16 17 OVERFLOW; // CHECK: add-overflow 18 OVERFLOW; // CHECK: add-overflow 19 OVERFLOW; // CHECK: add-overflow 20 OVERFLOW; // CHECK: add-overflow 21 OVERFLOW; // CHECK: add-overflow 22 23 OVERFLOW; // CHECK: add-overflow 24 OVERFLOW; // CHECK: add-overflow 25 OVERFLOW; // CHECK: add-overflow 26 OVERFLOW; // CHECK: add-overflow 27 OVERFLOW; // CHECK: add-overflow 28 29 OVERFLOW; // CHECK: add-overflow 30 OVERFLOW; // CHECK: add-overflow 31 OVERFLOW; // CHECK: add-overflow 32 OVERFLOW; // CHECK: add-overflow 33 OVERFLOW; // CHECK: add-overflow 34 35 // CHECK-NOT: add-overflow 36 OVERFLOW; // CHECK: too many errors 37 // CHECK-NOT: add-overflow 38 OVERFLOW; 39 OVERFLOW; 40 OVERFLOW; 41 } 42