Files
clang-p2996/compiler-rt/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc
Sumanth Gundapaneni b32a22eab7 Fix the RUN on UBSAN unit tests
For the build set up which runs the unit tests using an emulator like QEMU,
the unit tests must be run using %run.

Differential Revision: http://reviews.llvm.org/D15081

llvm-svn: 254467
2015-12-01 23:03:08 +00:00

19 lines
481 B
C++

// RUN: %clangxx -fsanitize=integer -fsanitize-recover=integer %s -o %t
// RUN: not %run %t 2>&1 | FileCheck %s
// __ubsan_default_options() doesn't work on Darwin.
// XFAIL: darwin
#include <stdint.h>
extern "C" const char *__ubsan_default_options() {
return "halt_on_error=1";
}
int main() {
(void)(uint64_t(10000000000000000000ull) + uint64_t(9000000000000000000ull));
// CHECK: ubsan_options.cc:[[@LINE-1]]:44: runtime error: unsigned integer overflow
return 0;
}