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