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

source code of compiler-rt/test/ubsan/TestCases/Misc/Posix/ubsan_options.cpp