diff options
Diffstat (limited to 'test/asan')
-rw-r--r-- | test/asan/TestCases/Linux/read_binary_name_regtest.c | 1 | ||||
-rw-r--r-- | test/asan/TestCases/Linux/textdomain.c | 10 | ||||
-rw-r--r-- | test/asan/TestCases/Posix/strchr.c | 4 | ||||
-rw-r--r-- | test/asan/TestCases/Windows/dll_global_dead_strip.c | 4 | ||||
-rw-r--r-- | test/asan/TestCases/Windows/fuse-lld.cc | 2 | ||||
-rw-r--r-- | test/asan/TestCases/Windows/global_dead_strip.c | 4 | ||||
-rwxr-xr-x | test/asan/android_commands/android_run.py | 5 |
7 files changed, 19 insertions, 11 deletions
diff --git a/test/asan/TestCases/Linux/read_binary_name_regtest.c b/test/asan/TestCases/Linux/read_binary_name_regtest.c index b09096c89cb7..41302567752c 100644 --- a/test/asan/TestCases/Linux/read_binary_name_regtest.c +++ b/test/asan/TestCases/Linux/read_binary_name_regtest.c @@ -3,6 +3,7 @@ // This test uses seccomp-BPF to restrict the readlink() system call and makes // sure ASan is still able to // RUN: not ls /usr/include/linux/seccomp.h || ( %clang_asan %s -o %t && not %run %t 2>&1 | FileCheck %s ) +// REQUIRES: shell // UNSUPPORTED: android #include <errno.h> diff --git a/test/asan/TestCases/Linux/textdomain.c b/test/asan/TestCases/Linux/textdomain.c new file mode 100644 index 000000000000..31e5139c9f7c --- /dev/null +++ b/test/asan/TestCases/Linux/textdomain.c @@ -0,0 +1,10 @@ +// RUN: %clang_asan -O0 -g %s -o %t +// RUN: %env_asan_opts=strict_string_checks=1 %run %t + +#include <stdlib.h> +#include <libintl.h> + +int main() { + textdomain(NULL); + return 0; +} diff --git a/test/asan/TestCases/Posix/strchr.c b/test/asan/TestCases/Posix/strchr.c index df854d79ec82..7086e1374523 100644 --- a/test/asan/TestCases/Posix/strchr.c +++ b/test/asan/TestCases/Posix/strchr.c @@ -27,9 +27,7 @@ int main(int argc, char **argv) { if (mprotect(p + 1, 1, PROT_NONE)) return 1; char *r = strchr(s, 'x'); - // CHECK: AddressSanitizer: SEGV on unknown address - // CHECK: The signal is caused by a READ memory access - // CHECK: strchr.c:[[@LINE-3]] + // CHECK: AddressSanitizer: {{SEGV|BUS}} on unknown address assert(r == p); return 0; diff --git a/test/asan/TestCases/Windows/dll_global_dead_strip.c b/test/asan/TestCases/Windows/dll_global_dead_strip.c index 2664f5baff6c..15cfd5a7ddbf 100644 --- a/test/asan/TestCases/Windows/dll_global_dead_strip.c +++ b/test/asan/TestCases/Windows/dll_global_dead_strip.c @@ -1,8 +1,8 @@ // RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // -// RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll +// RUN: %clang_cl_asan /Gw -LD -O0 %s -Fe%t.dll // RUN: %env_asan_opts=report_globals=2 %run %t %t.dll 2>&1 | FileCheck %s --check-prefix=NOSTRIP -// RUN: %clang_cl_asan -LD -O2 %s -Fe%t.dll -link -opt:ref +// RUN: %clang_cl_asan /Gw -LD -O2 %s -Fe%t.dll -link -opt:ref // RUN: %env_asan_opts=report_globals=2 %run %t %t.dll 2>&1 | FileCheck %s --check-prefix=STRIP #include <stdio.h> diff --git a/test/asan/TestCases/Windows/fuse-lld.cc b/test/asan/TestCases/Windows/fuse-lld.cc index 7fa5d4e8a80a..c20e5ff6c786 100644 --- a/test/asan/TestCases/Windows/fuse-lld.cc +++ b/test/asan/TestCases/Windows/fuse-lld.cc @@ -1,6 +1,6 @@ // If we have LLD, see that things more or less work. // -// REQUIRES: lld +// REQUIRES: lld-available // // FIXME: Use -fuse-ld=lld after the old COFF linker is removed. // FIXME: Test will fail until we add flags for requesting dwarf or cv. diff --git a/test/asan/TestCases/Windows/global_dead_strip.c b/test/asan/TestCases/Windows/global_dead_strip.c index e68549050be6..2121392d9268 100644 --- a/test/asan/TestCases/Windows/global_dead_strip.c +++ b/test/asan/TestCases/Windows/global_dead_strip.c @@ -1,6 +1,6 @@ -// RUN: %clang_cl_asan /O0 %s /Fe%t.exe +// RUN: %clang_cl_asan /Gw /O0 %s /Fe%t.exe // RUN: %env_asan_opts=report_globals=2 %t.exe 2>&1 | FileCheck %s --check-prefix=NOSTRIP -// RUN: %clang_cl_asan /O2 %s /Fe%t.exe -link -opt:ref +// RUN: %clang_cl_asan /Gw /O2 %s /Fe%t.exe -link -opt:ref // RUN: %env_asan_opts=report_globals=2 %t.exe 2>&1 | FileCheck %s --check-prefix=STRIP #include <stdio.h> diff --git a/test/asan/android_commands/android_run.py b/test/asan/android_commands/android_run.py index f4ea52bec588..7e599453d1c4 100755 --- a/test/asan/android_commands/android_run.py +++ b/test/asan/android_commands/android_run.py @@ -18,15 +18,14 @@ def build_env(): return ' '.join(args) is_64bit = (subprocess.check_output(['file', sys.argv[0] + '.real']).find('64-bit') != -1) -asanwrapper = "" if is_64bit else "asanwrapper " device_env = build_env() device_args = ' '.join(sys.argv[1:]) # FIXME: escape? device_stdout = device_binary + '.stdout' device_stderr = device_binary + '.stderr' device_exitcode = device_binary + '.exitcode' -ret = adb(['shell', 'cd %s && %s %s%s %s >%s 2>%s ; echo $? >%s' % - (ANDROID_TMPDIR, device_env, asanwrapper, device_binary, device_args, +ret = adb(['shell', 'cd %s && %s %s %s >%s 2>%s ; echo $? >%s' % + (ANDROID_TMPDIR, device_env, device_binary, device_args, device_stdout, device_stderr, device_exitcode)]) if ret != 0: sys.exit(ret) |