diff options
| author | Alexey Samsonov <vonosmas@gmail.com> | 2015-04-29 20:39:10 +0000 |
|---|---|---|
| committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-04-29 20:39:10 +0000 |
| commit | ff46ebe5a4b2066cd1bc25128fc8f9889284d9a7 (patch) | |
| tree | 563134ac1b73368f3c6aedde37065d84ab0143d3 | |
| parent | ee6678119d911fc88ef407a769f59fbfdf7f1553 (diff) | |
| download | bcm5719-llvm-ff46ebe5a4b2066cd1bc25128fc8f9889284d9a7.tar.gz bcm5719-llvm-ff46ebe5a4b2066cd1bc25128fc8f9889284d9a7.zip | |
[UBSan] Add a testcase for __ubsan_default_options() function.
llvm-svn: 236151
| -rw-r--r-- | compiler-rt/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/compiler-rt/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc b/compiler-rt/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc new file mode 100644 index 00000000000..2be8792cce9 --- /dev/null +++ b/compiler-rt/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc @@ -0,0 +1,18 @@ +// RUN: %clangxx -fsanitize=integer -fsanitize-recover=integer %s -o %t +// RUN: not %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; +} + |

