16 lines · cpp
1// RUN: %clangxx -fsanitize=integer -fsanitize-recover=integer %s -o %t2// RUN: not %run %t 2>&1 | FileCheck %s3 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 overflow13 return 0;14}15 16