1 | // RUN: %clangxx -fsanitize=integer -fsanitize-recover=integer %s -o %t |
2 | // RUN: not %run %t 2>&1 | FileCheck %s |
3 | |
4 | // __ubsan_default_options() doesn't work on Darwin. |
5 | // XFAIL: darwin |
6 | |
7 | #include <stdint.h> |
8 | |
9 | extern "C" const char *__ubsan_default_options() { |
10 | return "halt_on_error=1" ; |
11 | } |
12 | |
13 | int main() { |
14 | (void)(uint64_t(10000000000000000000ull) + uint64_t(9000000000000000000ull)); |
15 | // CHECK: ubsan_options.cpp:[[@LINE-1]]:44: runtime error: unsigned integer overflow |
16 | return 0; |
17 | } |
18 | |
19 | |