xref: /llvm-project/compiler-rt/test/ubsan_minimal/TestCases/uadd-overflow.cpp (revision 84c4efbc6d61ec2bed9e9bc64b5829b4487b210c)
1 // RUN: %clangxx -fsanitize=unsigned-integer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s
2 // RUN: %clangxx -fsanitize=unsigned-integer-overflow -fno-sanitize-recover=all %s -o %t && not --crash %run %t 2>&1 | FileCheck %s
3 
4 #include <stdint.h>
5 
main()6 int main() {
7   uint32_t k = 0x87654321;
8   k += 0xedcba987;
9   // CHECK: add-overflow by 0x{{[[:xdigit:]]+$}}
10 }
11