diff options
Diffstat (limited to 'test/ubsan/TestCases/Misc/no-interception.cpp')
-rw-r--r-- | test/ubsan/TestCases/Misc/no-interception.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ubsan/TestCases/Misc/no-interception.cpp b/test/ubsan/TestCases/Misc/no-interception.cpp new file mode 100644 index 000000000..c82fed3bf --- /dev/null +++ b/test/ubsan/TestCases/Misc/no-interception.cpp @@ -0,0 +1,20 @@ +// REQUIRES: android + +// Tests that ubsan can detect errors on Android if libc appears before the +// runtime in the library search order, which means that we cannot intercept +// symbols. + +// RUN: %clangxx %p/Inputs/no-interception-dso.c -fsanitize=undefined -fPIC -shared -o %dynamiclib %ld_flags_rpath_so + +// Make sure that libc is first in DT_NEEDED. +// RUN: %clangxx %s -lc -o %t %ld_flags_rpath_exe +// RUN: %run %t 2>&1 | FileCheck %s + +#include <limits.h> + +int dso_function(int); + +int main(int argc, char **argv) { + // CHECK: signed integer overflow + dso_function(INT_MAX); +} |