[compiler-rt] r183395 - [ASan] move all lit_tests under TestCases
Alexey Samsonov
samsonov at google.com
Thu Jun 6 02:23:35 PDT 2013
Author: samsonov
Date: Thu Jun 6 04:23:34 2013
New Revision: 183395
URL: http://llvm.org/viewvc/llvm-project?rev=183395&view=rev
Log:
[ASan] move all lit_tests under TestCases
Added:
compiler-rt/trunk/lib/asan/lit_tests/TestCases/
compiler-rt/trunk/lib/asan/lit_tests/TestCases/Darwin/
- copied from r183386, compiler-rt/trunk/lib/asan/lit_tests/Darwin/
compiler-rt/trunk/lib/asan/lit_tests/TestCases/Helpers/
- copied from r183386, compiler-rt/trunk/lib/asan/lit_tests/Helpers/
compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/
- copied from r183386, compiler-rt/trunk/lib/asan/lit_tests/Linux/
compiler-rt/trunk/lib/asan/lit_tests/TestCases/SharedLibs/
- copied from r183386, compiler-rt/trunk/lib/asan/lit_tests/SharedLibs/
compiler-rt/trunk/lib/asan/lit_tests/TestCases/allow_user_segv.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/allow_user_segv.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/blacklist.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/blacklist.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/deep_stack_uaf.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/deep_stack_uaf.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/deep_tail_call.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/deep_tail_call.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/deep_thread_stack.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/deep_thread_stack.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/default_blacklist.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/default_blacklist.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/default_options.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/default_options.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/dlclose-test.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/dlclose-test.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/double-free.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/double-free.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/force_inline_opt0.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/force_inline_opt0.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/free_hook_realloc.cc
- copied unchanged from r183387, compiler-rt/trunk/lib/asan/lit_tests/free_hook_realloc.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/global-demangle.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/global-demangle.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/global-overflow.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/global-overflow.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/heap-overflow.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/heap-overflow.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/huge_negative_hea_oob.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/huge_negative_hea_oob.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/init-order-atexit.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/init-order-atexit.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/init-order-dlopen.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/init-order-dlopen.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/initialization-blacklist.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/initialization-bug.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/initialization-bug.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/initialization-constexpr.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/initialization-constexpr.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/initialization-nobug.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/initialization-nobug.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/interface_test.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/interface_test.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/invalid-free.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/invalid-free.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/large_func_test.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/large_func_test.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/log-path_test.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/log-path_test.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/log_path_fork_test.cc.disabled
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/log_path_fork_test.cc.disabled
compiler-rt/trunk/lib/asan/lit_tests/TestCases/malloc_fill.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/malloc_fill.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/malloc_hook.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/malloc_hook.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/memcmp_strict_test.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/memcmp_strict_test.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/memcmp_test.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/memcmp_test.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/null_deref.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/null_deref.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/on_error_callback.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/on_error_callback.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/partial_right.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/partial_right.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/sanity_check_pure_c.c
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/sanity_check_pure_c.c
compiler-rt/trunk/lib/asan/lit_tests/TestCases/shared-lib-test.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/shared-lib-test.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/sleep_before_dying.c
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/sleep_before_dying.c
compiler-rt/trunk/lib/asan/lit_tests/TestCases/stack-frame-demangle.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/stack-frame-demangle.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/stack-oob-frames.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/stack-oob-frames.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/stack-overflow.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/stack-use-after-return.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/stack-use-after-return.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/strip_path_prefix.c
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/strip_path_prefix.c
compiler-rt/trunk/lib/asan/lit_tests/TestCases/strncpy-overflow.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/strncpy-overflow.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/symbolize_callback.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/symbolize_callback.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/throw_call_test.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/throw_call_test.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/throw_invoke_test.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/throw_invoke_test.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/time_interceptor.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/time_interceptor.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/unaligned_loads_and_stores.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/unaligned_loads_and_stores.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free-right.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/use-after-free-right.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/use-after-free.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-poison.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/use-after-poison.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-scope-dtor-order.cc
- copied unchanged from r183391, compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-dtor-order.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-scope-inlined.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-inlined.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-scope-nobug.cc
- copied unchanged from r183391, compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-nobug.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-scope-temp.cc
- copied unchanged from r183391, compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-temp.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-scope.cc
- copied unchanged from r183391, compiler-rt/trunk/lib/asan/lit_tests/use-after-scope.cc
compiler-rt/trunk/lib/asan/lit_tests/TestCases/wait.cc
- copied unchanged from r183386, compiler-rt/trunk/lib/asan/lit_tests/wait.cc
Removed:
compiler-rt/trunk/lib/asan/lit_tests/Darwin/
compiler-rt/trunk/lib/asan/lit_tests/Helpers/
compiler-rt/trunk/lib/asan/lit_tests/Linux/
compiler-rt/trunk/lib/asan/lit_tests/SharedLibs/
compiler-rt/trunk/lib/asan/lit_tests/allow_user_segv.cc
compiler-rt/trunk/lib/asan/lit_tests/blacklist.cc
compiler-rt/trunk/lib/asan/lit_tests/deep_stack_uaf.cc
compiler-rt/trunk/lib/asan/lit_tests/deep_tail_call.cc
compiler-rt/trunk/lib/asan/lit_tests/deep_thread_stack.cc
compiler-rt/trunk/lib/asan/lit_tests/default_blacklist.cc
compiler-rt/trunk/lib/asan/lit_tests/default_options.cc
compiler-rt/trunk/lib/asan/lit_tests/dlclose-test.cc
compiler-rt/trunk/lib/asan/lit_tests/double-free.cc
compiler-rt/trunk/lib/asan/lit_tests/force_inline_opt0.cc
compiler-rt/trunk/lib/asan/lit_tests/free_hook_realloc.cc
compiler-rt/trunk/lib/asan/lit_tests/global-demangle.cc
compiler-rt/trunk/lib/asan/lit_tests/global-overflow.cc
compiler-rt/trunk/lib/asan/lit_tests/heap-overflow.cc
compiler-rt/trunk/lib/asan/lit_tests/huge_negative_hea_oob.cc
compiler-rt/trunk/lib/asan/lit_tests/init-order-atexit.cc
compiler-rt/trunk/lib/asan/lit_tests/init-order-dlopen.cc
compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc
compiler-rt/trunk/lib/asan/lit_tests/initialization-bug.cc
compiler-rt/trunk/lib/asan/lit_tests/initialization-constexpr.cc
compiler-rt/trunk/lib/asan/lit_tests/initialization-nobug.cc
compiler-rt/trunk/lib/asan/lit_tests/interface_test.cc
compiler-rt/trunk/lib/asan/lit_tests/invalid-free.cc
compiler-rt/trunk/lib/asan/lit_tests/large_func_test.cc
compiler-rt/trunk/lib/asan/lit_tests/log-path_test.cc
compiler-rt/trunk/lib/asan/lit_tests/log_path_fork_test.cc.disabled
compiler-rt/trunk/lib/asan/lit_tests/malloc_fill.cc
compiler-rt/trunk/lib/asan/lit_tests/malloc_hook.cc
compiler-rt/trunk/lib/asan/lit_tests/memcmp_strict_test.cc
compiler-rt/trunk/lib/asan/lit_tests/memcmp_test.cc
compiler-rt/trunk/lib/asan/lit_tests/null_deref.cc
compiler-rt/trunk/lib/asan/lit_tests/on_error_callback.cc
compiler-rt/trunk/lib/asan/lit_tests/partial_right.cc
compiler-rt/trunk/lib/asan/lit_tests/sanity_check_pure_c.c
compiler-rt/trunk/lib/asan/lit_tests/shared-lib-test.cc
compiler-rt/trunk/lib/asan/lit_tests/sleep_before_dying.c
compiler-rt/trunk/lib/asan/lit_tests/stack-frame-demangle.cc
compiler-rt/trunk/lib/asan/lit_tests/stack-oob-frames.cc
compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc
compiler-rt/trunk/lib/asan/lit_tests/stack-use-after-return.cc
compiler-rt/trunk/lib/asan/lit_tests/strip_path_prefix.c
compiler-rt/trunk/lib/asan/lit_tests/strncpy-overflow.cc
compiler-rt/trunk/lib/asan/lit_tests/symbolize_callback.cc
compiler-rt/trunk/lib/asan/lit_tests/throw_call_test.cc
compiler-rt/trunk/lib/asan/lit_tests/throw_invoke_test.cc
compiler-rt/trunk/lib/asan/lit_tests/time_interceptor.cc
compiler-rt/trunk/lib/asan/lit_tests/unaligned_loads_and_stores.cc
compiler-rt/trunk/lib/asan/lit_tests/use-after-free-right.cc
compiler-rt/trunk/lib/asan/lit_tests/use-after-free.cc
compiler-rt/trunk/lib/asan/lit_tests/use-after-poison.cc
compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-dtor-order.cc
compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-inlined.cc
compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-nobug.cc
compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-temp.cc
compiler-rt/trunk/lib/asan/lit_tests/use-after-scope.cc
compiler-rt/trunk/lib/asan/lit_tests/wait.cc
Modified:
compiler-rt/trunk/lib/asan/lit_tests/TestCases/Darwin/interface_symbols_darwin.c
compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/interface_symbols_linux.c
compiler-rt/trunk/lib/asan/lit_tests/lit.cfg
compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in
Modified: compiler-rt/trunk/lib/asan/lit_tests/TestCases/Darwin/interface_symbols_darwin.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/Darwin/interface_symbols_darwin.c?rev=183395&r1=183386&r2=183395&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/TestCases/Darwin/interface_symbols_darwin.c (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/Darwin/interface_symbols_darwin.c Thu Jun 6 04:23:34 2013
@@ -16,7 +16,7 @@
// RUN: | grep -v "__asan_default_options" \
// RUN: | grep -v "__asan_on_error" > %t.symbols
-// RUN: cat %p/../../asan_interface_internal.h \
+// RUN: cat %p/../../../asan_interface_internal.h \
// RUN: | sed "s/\/\/.*//" | sed "s/typedef.*//" \
// RUN: | grep -v "OPTIONAL" \
// RUN: | grep "__asan_.*(" | sed "s/.* __asan_/__asan_/;s/(.*//" \
Modified: compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/interface_symbols_linux.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/interface_symbols_linux.c?rev=183395&r1=183386&r2=183395&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/interface_symbols_linux.c (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/interface_symbols_linux.c Thu Jun 6 04:23:34 2013
@@ -8,7 +8,7 @@
// RUN: | grep -v "__asan_symbolize" \
// RUN: | grep -v "__asan_default_options" \
// RUN: | grep -v "__asan_on_error" > %t.symbols
-// RUN: cat %p/../../asan_interface_internal.h \
+// RUN: cat %p/../../../asan_interface_internal.h \
// RUN: | sed "s/\/\/.*//" | sed "s/typedef.*//" \
// RUN: | grep -v "OPTIONAL" \
// RUN: | grep "__asan_.*(" | sed "s/.* __asan_/__asan_/;s/(.*//" \
Removed: compiler-rt/trunk/lib/asan/lit_tests/allow_user_segv.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/allow_user_segv.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/allow_user_segv.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/allow_user_segv.cc (removed)
@@ -1,50 +0,0 @@
-// Regression test for
-// https://code.google.com/p/address-sanitizer/issues/detail?id=180
-
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && ASAN_OPTIONS=allow_user_segv_handler=true %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && ASAN_OPTIONS=allow_user_segv_handler=true %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && ASAN_OPTIONS=allow_user_segv_handler=true %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && ASAN_OPTIONS=allow_user_segv_handler=true %t 2>&1 | FileCheck %s
-
-#include <signal.h>
-#include <stdio.h>
-
-struct sigaction user_sigaction;
-struct sigaction original_sigaction;
-
-void User_OnSIGSEGV(int signum, siginfo_t *siginfo, void *context) {
- fprintf(stderr, "User sigaction called\n");
- if (original_sigaction.sa_flags | SA_SIGINFO)
- original_sigaction.sa_sigaction(signum, siginfo, context);
- else
- original_sigaction.sa_handler(signum);
-}
-
-int DoSEGV() {
- volatile int *x = 0;
- return *x;
-}
-
-int main() {
- user_sigaction.sa_sigaction = User_OnSIGSEGV;
- user_sigaction.sa_flags = SA_SIGINFO;
-#if defined(__APPLE__) && !defined(__LP64__)
- // On 32-bit Darwin KERN_PROTECTION_FAILURE (SIGBUS) is delivered.
- int signum = SIGBUS;
-#else
- // On 64-bit Darwin KERN_INVALID_ADDRESS (SIGSEGV) is delivered.
- // On Linux SIGSEGV is delivered as well.
- int signum = SIGSEGV;
-#endif
- if (sigaction(signum, &user_sigaction, &original_sigaction)) {
- perror("sigaction");
- return 1;
- }
- fprintf(stderr, "User sigaction installed\n");
- return DoSEGV();
-}
-
-// CHECK: User sigaction installed
-// CHECK-NEXT: User sigaction called
-// CHECK-NEXT: ASAN:SIGSEGV
-// CHECK: AddressSanitizer: SEGV on unknown address
Removed: compiler-rt/trunk/lib/asan/lit_tests/blacklist.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/blacklist.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/blacklist.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/blacklist.cc (removed)
@@ -1,44 +0,0 @@
-// Test the blacklist functionality of ASan
-
-// RUN: echo "fun:*brokenFunction*" > %tmp
-// RUN: echo "global:*badGlobal*" >> %tmp
-// RUN: echo "src:*blacklist-extra.cc" >> %tmp
-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m64 -O0 %s -o %t \
-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1
-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m64 -O1 %s -o %t \
-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1
-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m64 -O2 %s -o %t \
-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1
-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m64 -O3 %s -o %t \
-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1
-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m32 -O0 %s -o %t \
-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1
-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m32 -O1 %s -o %t \
-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1
-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m32 -O2 %s -o %t \
-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1
-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m32 -O3 %s -o %t \
-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1
-
-// badGlobal is accessed improperly, but we blacklisted it.
-int badGlobal;
-int readBadGlobal() {
- return (&badGlobal)[1];
-}
-
-// A function which is broken, but excluded in the blacklist.
-int brokenFunction(int argc) {
- char x[10] = {0};
- return x[argc * 10]; // BOOM
-}
-
-// This function is defined in Helpers/blacklist-extra.cc, a source file which
-// is blacklisted by name
-int externalBrokenFunction(int x);
-
-int main(int argc, char **argv) {
- brokenFunction(argc);
- int x = readBadGlobal();
- externalBrokenFunction(argc);
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/deep_stack_uaf.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/deep_stack_uaf.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/deep_stack_uaf.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/deep_stack_uaf.cc (removed)
@@ -1,36 +0,0 @@
-// Check that we can store lots of stack frames if asked to.
-
-// RUN: %clangxx_asan -m64 -O0 %s -o %t 2>&1
-// RUN: ASAN_OPTIONS=malloc_context_size=120:redzone=512 %t 2>&1 | \
-// RUN: %symbolize | FileCheck %s
-
-// RUN: %clangxx_asan -m32 -O0 %s -o %t 2>&1
-// RUN: ASAN_OPTIONS=malloc_context_size=120:redzone=512 %t 2>&1 | \
-// RUN: %symbolize | FileCheck %s
-#include <stdlib.h>
-#include <stdio.h>
-
-template <int depth>
-struct DeepFree {
- static void free(char *x) {
- DeepFree<depth - 1>::free(x);
- }
-};
-
-template<>
-struct DeepFree<0> {
- static void free(char *x) {
- ::free(x);
- }
-};
-
-int main() {
- char *x = (char*)malloc(10);
- // deep_free(x);
- DeepFree<200>::free(x);
- return x[5];
- // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
- // CHECK: DeepFree<36>
- // CHECK: DeepFree<98>
- // CHECK: DeepFree<115>
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/deep_tail_call.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/deep_tail_call.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/deep_tail_call.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/deep_tail_call.cc (removed)
@@ -1,24 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-// CHECK: AddressSanitizer: global-buffer-overflow
-int global[10];
-// CHECK: {{#0.*call4}}
-void __attribute__((noinline)) call4(int i) { global[i+10]++; }
-// CHECK: {{#1.*call3}}
-void __attribute__((noinline)) call3(int i) { call4(i); }
-// CHECK: {{#2.*call2}}
-void __attribute__((noinline)) call2(int i) { call3(i); }
-// CHECK: {{#3.*call1}}
-void __attribute__((noinline)) call1(int i) { call2(i); }
-// CHECK: {{#4.*main}}
-int main(int argc, char **argv) {
- call1(argc);
- return global[0];
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/deep_thread_stack.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/deep_thread_stack.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/deep_thread_stack.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/deep_thread_stack.cc (removed)
@@ -1,61 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-#include <pthread.h>
-
-int *x;
-
-void *AllocThread(void *arg) {
- x = new int;
- *x = 42;
- return NULL;
-}
-
-void *FreeThread(void *arg) {
- delete x;
- return NULL;
-}
-
-void *AccessThread(void *arg) {
- *x = 43; // BOOM
- return NULL;
-}
-
-typedef void* (*callback_type)(void* arg);
-
-void *RunnerThread(void *function) {
- pthread_t thread;
- pthread_create(&thread, NULL, (callback_type)function, NULL);
- pthread_join(thread, NULL);
- return NULL;
-}
-
-void RunThread(callback_type function) {
- pthread_t runner;
- pthread_create(&runner, NULL, RunnerThread, (void*)function);
- pthread_join(runner, NULL);
-}
-
-int main(int argc, char *argv[]) {
- RunThread(AllocThread);
- RunThread(FreeThread);
- RunThread(AccessThread);
- return (x != 0);
-}
-
-// CHECK: AddressSanitizer: heap-use-after-free
-// CHECK: WRITE of size 4 at 0x{{.*}} thread T[[ACCESS_THREAD:[0-9]+]]
-// CHECK: freed by thread T[[FREE_THREAD:[0-9]+]] here:
-// CHECK: previously allocated by thread T[[ALLOC_THREAD:[0-9]+]] here:
-// CHECK: Thread T[[ACCESS_THREAD]] created by T[[ACCESS_RUNNER:[0-9]+]] here:
-// CHECK: Thread T[[ACCESS_RUNNER]] created by T0 here:
-// CHECK: Thread T[[FREE_THREAD]] created by T[[FREE_RUNNER:[0-9]+]] here:
-// CHECK: Thread T[[FREE_RUNNER]] created by T0 here:
-// CHECK: Thread T[[ALLOC_THREAD]] created by T[[ALLOC_RUNNER:[0-9]+]] here:
-// CHECK: Thread T[[ALLOC_RUNNER]] created by T0 here:
Removed: compiler-rt/trunk/lib/asan/lit_tests/default_blacklist.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/default_blacklist.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/default_blacklist.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/default_blacklist.cc (removed)
@@ -1,3 +0,0 @@
-// Test that ASan uses the default blacklist from resource directory.
-// RUN: %clangxx_asan -### %s 2>&1 | FileCheck %s
-// CHECK: fsanitize-blacklist={{.*}}asan_blacklist.txt
Removed: compiler-rt/trunk/lib/asan/lit_tests/default_options.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/default_options.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/default_options.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/default_options.cc (removed)
@@ -1,15 +0,0 @@
-// RUN: %clangxx_asan -O2 %s -o %t
-// RUN: %t 2>&1 | FileCheck %s
-
-const char *kAsanDefaultOptions="verbosity=1 foo=bar";
-
-extern "C"
-__attribute__((no_sanitize_address))
-const char *__asan_default_options() {
- // CHECK: Using the defaults from __asan_default_options: {{.*}} foo=bar
- return kAsanDefaultOptions;
-}
-
-int main() {
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/dlclose-test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/dlclose-test.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/dlclose-test.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/dlclose-test.cc (removed)
@@ -1,93 +0,0 @@
-// Regression test for
-// http://code.google.com/p/address-sanitizer/issues/detail?id=19
-// Bug description:
-// 1. application dlopens foo.so
-// 2. asan registers all globals from foo.so
-// 3. application dlcloses foo.so
-// 4. application mmaps some memory to the location where foo.so was before
-// 5. application starts using this mmaped memory, but asan still thinks there
-// are globals.
-// 6. BOOM
-
-// This sublte test assumes that after a foo.so is dlclose-d
-// we can mmap the region of memory that has been occupied by the library.
-// It works on i368/x86_64 Linux, but not necessary anywhere else.
-// REQUIRES: x86_64-supported-target,i386-supported-target
-
-// RUN: %clangxx_asan -m64 -O0 %p/SharedLibs/dlclose-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -m64 -O1 %p/SharedLibs/dlclose-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -m64 -O2 %p/SharedLibs/dlclose-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -m64 -O3 %p/SharedLibs/dlclose-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -m32 -O0 %p/SharedLibs/dlclose-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -m32 -O1 %p/SharedLibs/dlclose-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -m32 -O2 %p/SharedLibs/dlclose-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -m32 -O3 %p/SharedLibs/dlclose-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | FileCheck %s
-
-#include <assert.h>
-#include <dlfcn.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <unistd.h>
-
-#include <string>
-
-using std::string;
-
-typedef int *(fun_t)();
-
-int main(int argc, char *argv[]) {
- string path = string(argv[0]) + "-so.so";
- size_t PageSize = sysconf(_SC_PAGESIZE);
- printf("opening %s ... \n", path.c_str());
- void *lib = dlopen(path.c_str(), RTLD_NOW);
- if (!lib) {
- printf("error in dlopen(): %s\n", dlerror());
- return 1;
- }
- fun_t *get = (fun_t*)dlsym(lib, "get_address_of_static_var");
- if (!get) {
- printf("failed dlsym\n");
- return 1;
- }
- int *addr = get();
- assert(((size_t)addr % 32) == 0); // should be 32-byte aligned.
- printf("addr: %p\n", addr);
- addr[0] = 1; // make sure we can write there.
-
- // Now dlclose the shared library.
- printf("attempting to dlclose\n");
- if (dlclose(lib)) {
- printf("failed to dlclose\n");
- return 1;
- }
- // Now, the page where 'addr' is unmapped. Map it.
- size_t page_beg = ((size_t)addr) & ~(PageSize - 1);
- void *res = mmap((void*)(page_beg), PageSize,
- PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON | MAP_FIXED | MAP_NORESERVE, 0, 0);
- if (res == (char*)-1L) {
- printf("failed to mmap\n");
- return 1;
- }
- addr[1] = 2; // BOOM (if the bug is not fixed).
- printf("PASS\n");
- // CHECK: PASS
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/double-free.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/double-free.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/double-free.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/double-free.cc (removed)
@@ -1,18 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-#include <stdlib.h>
-#include <string.h>
-int main(int argc, char **argv) {
- char *x = (char*)malloc(10 * sizeof(char));
- memset(x, 0, 10);
- int res = x[argc];
- free(x);
- free(x + argc - 1); // BOOM
- // CHECK: AddressSanitizer: attempting double-free{{.*}}in thread T0
- // CHECK: double-free.cc:[[@LINE-2]]
- // CHECK: freed by thread T0 here:
- // CHECK: double-free.cc:[[@LINE-5]]
- // CHECK: allocated by thread T0 here:
- // CHECK: double-free.cc:[[@LINE-10]]
- return res;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/force_inline_opt0.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/force_inline_opt0.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/force_inline_opt0.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/force_inline_opt0.cc (removed)
@@ -1,14 +0,0 @@
-// This test checks that we are no instrumenting a memory access twice
-// (before and after inlining)
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t
-__attribute__((always_inline))
-void foo(int *x) {
- *x = 0;
-}
-
-int main() {
- int x;
- foo(&x);
- return x;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/free_hook_realloc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/free_hook_realloc.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/free_hook_realloc.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/free_hook_realloc.cc (removed)
@@ -1,31 +0,0 @@
-// Check that free hook doesn't conflict with Realloc.
-// RUN: %clangxx_asan -O2 %s -o %t
-// RUN: %t 2>&1 | FileCheck %s
-#include <stdlib.h>
-#include <unistd.h>
-
-static void *glob_ptr;
-
-extern "C" {
-void __asan_free_hook(void *ptr) {
- if (ptr == glob_ptr) {
- *(int*)ptr = 0;
- write(1, "FreeHook\n", sizeof("FreeHook\n"));
- }
-}
-}
-
-int main() {
- int *x = (int*)malloc(100);
- x[0] = 42;
- glob_ptr = x;
- int *y = (int*)realloc(x, 200);
- // Verify that free hook was called and didn't spoil the memory.
- if (y[0] != 42) {
- _exit(1);
- }
- write(1, "Passed\n", sizeof("Passed\n"));
- // CHECK: FreeHook
- // CHECK: Passed
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/global-demangle.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/global-demangle.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/global-demangle.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/global-demangle.cc (removed)
@@ -1,18 +0,0 @@
-// Don't run through %symbolize to avoid c++filt demangling.
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | FileCheck %s
-
-namespace XXX {
-class YYY {
- public:
- static char ZZZ[];
-};
-char YYY::ZZZ[] = "abc";
-}
-
-int main(int argc, char **argv) {
- return (int)XXX::YYY::ZZZ[argc + 5]; // BOOM
- // CHECK: {{READ of size 1 at 0x.*}}
- // CHECK: {{0x.* is located 2 bytes to the right of global variable}}
- // CHECK: 'XXX::YYY::ZZZ' {{.*}} of size 4
- // CHECK: 'XXX::YYY::ZZZ' is ascii string 'abc'
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/global-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/global-overflow.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/global-overflow.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/global-overflow.cc (removed)
@@ -1,25 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-#include <string.h>
-int main(int argc, char **argv) {
- static char XXX[10];
- static char YYY[10];
- static char ZZZ[10];
- memset(XXX, 0, 10);
- memset(YYY, 0, 10);
- memset(ZZZ, 0, 10);
- int res = YYY[argc * 10]; // BOOOM
- // CHECK: {{READ of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in _?main .*global-overflow.cc:}}[[@LINE-2]]
- // CHECK: {{0x.* is located 0 bytes to the right of global variable}}
- // CHECK: {{.*YYY.* of size 10}}
- res += XXX[argc] + ZZZ[argc];
- return res;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/heap-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/heap-overflow.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/heap-overflow.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/heap-overflow.cc (removed)
@@ -1,36 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-
-#include <stdlib.h>
-#include <string.h>
-int main(int argc, char **argv) {
- char *x = (char*)malloc(10 * sizeof(char));
- memset(x, 0, 10);
- int res = x[argc * 10]; // BOOOM
- // CHECK: {{READ of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in _?main .*heap-overflow.cc:}}[[@LINE-2]]
- // CHECK: {{0x.* is located 0 bytes to the right of 10-byte region}}
- // CHECK: {{allocated by thread T0 here:}}
-
- // CHECK-Linux: {{ #0 0x.* in .*malloc}}
- // CHECK-Linux: {{ #1 0x.* in main .*heap-overflow.cc:21}}
-
- // CHECK-Darwin: {{ #0 0x.* in _?wrap_malloc.*}}
- // CHECK-Darwin: {{ #1 0x.* in _?main .*heap-overflow.cc:21}}
- free(x);
- return res;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/huge_negative_hea_oob.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/huge_negative_hea_oob.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/huge_negative_hea_oob.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/huge_negative_hea_oob.cc (removed)
@@ -1,13 +0,0 @@
-// RUN: %clangxx_asan -m64 %s -o %t && %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -m64 -O %s -o %t && %t 2>&1 | FileCheck %s
-// Check that we can find huge buffer overflows to the left.
-#include <stdlib.h>
-#include <string.h>
-int main(int argc, char **argv) {
- char *x = (char*)malloc(1 << 20);
- memset(x, 0, 10);
- int res = x[-argc * 4000]; // BOOOM
- // CHECK: is located 4000 bytes to the left of
- free(x);
- return res;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/init-order-atexit.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/init-order-atexit.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/init-order-atexit.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/init-order-atexit.cc (removed)
@@ -1,31 +0,0 @@
-// Test for the following situation:
-// (1) global A is constructed.
-// (2) exit() is called during construction of global B.
-// (3) destructor of A reads uninitialized global C from another module.
-// We do *not* want to report init-order bug in this case.
-
-// RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/init-order-atexit-extra.cc -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true:strict_init_order=true %t 2>&1 | FileCheck %s
-
-#include <stdio.h>
-#include <stdlib.h>
-
-void AccessC();
-
-class A {
- public:
- A() { }
- ~A() { AccessC(); printf("PASSED\n"); }
- // CHECK-NOT: AddressSanitizer
- // CHECK: PASSED
-};
-
-A a;
-
-class B {
- public:
- B() { exit(1); }
- ~B() { }
-};
-
-B b;
Removed: compiler-rt/trunk/lib/asan/lit_tests/init-order-dlopen.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/init-order-dlopen.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/init-order-dlopen.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/init-order-dlopen.cc (removed)
@@ -1,52 +0,0 @@
-// Regression test for
-// https://code.google.com/p/address-sanitizer/issues/detail?id=178
-
-// RUN: %clangxx_asan -m64 -O0 %p/SharedLibs/init-order-dlopen-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// If the linker doesn't support --export-dynamic (which is ELF-specific),
-// try to link without that option.
-// FIXME: find a better solution.
-// RUN: %clangxx_asan -m64 -O0 %s -o %t -Wl,--export-dynamic || \
-// RUN: %clangxx_asan -m64 -O0 %s -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true:strict_init_order=true %t 2>&1 | FileCheck %s
-#include <dlfcn.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include <string>
-
-using std::string;
-
-int foo() {
- return 42;
-}
-int global = foo();
-
-__attribute__((visibility("default")))
-void inc_global() {
- global++;
-}
-
-void *global_poller(void *arg) {
- while (true) {
- if (global != 42)
- break;
- usleep(100);
- }
- return 0;
-}
-
-int main(int argc, char *argv[]) {
- pthread_t p;
- pthread_create(&p, 0, global_poller, 0);
- string path = string(argv[0]) + "-so.so";
- if (0 == dlopen(path.c_str(), RTLD_NOW)) {
- fprintf(stderr, "dlerror: %s\n", dlerror());
- return 1;
- }
- pthread_join(p, 0);
- printf("PASSED\n");
- // CHECK: PASSED
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/initialization-blacklist.cc (removed)
@@ -1,47 +0,0 @@
-// Test for blacklist functionality of initialization-order checker.
-
-// RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-blacklist-extra.cc\
-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
-// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
-// RUN: -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m64 -O1 %s %p/Helpers/initialization-blacklist-extra.cc\
-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
-// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
-// RUN: -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m64 -O2 %s %p/Helpers/initialization-blacklist-extra.cc\
-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
-// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
-// RUN: -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-blacklist-extra.cc\
-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
-// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
-// RUN: -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m32 -O1 %s %p/Helpers/initialization-blacklist-extra.cc\
-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
-// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
-// RUN: -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m32 -O2 %s %p/Helpers/initialization-blacklist-extra.cc\
-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
-// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
-// RUN: -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-
-// Function is defined in another TU.
-int readBadGlobal();
-int x = readBadGlobal(); // init-order bug.
-
-// Function is defined in another TU.
-int accessBadObject();
-int y = accessBadObject(); // init-order bug.
-
-int readBadSrcGlobal();
-int z = readBadSrcGlobal(); // init-order bug.
-
-int main(int argc, char **argv) {
- return argc + x + y + z - 1;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/initialization-bug.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/initialization-bug.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/initialization-bug.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/initialization-bug.cc (removed)
@@ -1,49 +0,0 @@
-// Test to make sure basic initialization order errors are caught.
-
-// RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-bug-extra2.cc -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 \
-// RUN: | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-bug-extra2.cc -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 \
-// RUN: | %symbolize | FileCheck %s
-
-// Do not test with optimization -- the error may be optimized away.
-
-// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=186
-// XFAIL: darwin
-
-#include <cstdio>
-
-// The structure of the test is:
-// "x", "y", "z" are dynamically initialized globals.
-// Value of "x" depends on "y", value of "y" depends on "z".
-// "x" and "z" are defined in this TU, "y" is defined in another one.
-// Thus we shoud stably report initialization order fiasco independently of
-// the translation unit order.
-
-int initZ() {
- return 5;
-}
-int z = initZ();
-
-// 'y' is a dynamically initialized global residing in a different TU. This
-// dynamic initializer will read the value of 'y' before main starts. The
-// result is undefined behavior, which should be caught by initialization order
-// checking.
-extern int y;
-int __attribute__((noinline)) initX() {
- return y + 1;
- // CHECK: {{AddressSanitizer: initialization-order-fiasco}}
- // CHECK: {{READ of size .* at 0x.* thread T0}}
- // CHECK: {{0x.* is located 0 bytes inside of global variable .*(y|z).*}}
-}
-
-// This initializer begins our initialization order problems.
-static int x = initX();
-
-int main() {
- // ASan should have caused an exit before main runs.
- printf("PASS\n");
- // CHECK-NOT: PASS
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/initialization-constexpr.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/initialization-constexpr.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/initialization-constexpr.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/initialization-constexpr.cc (removed)
@@ -1,43 +0,0 @@
-// Constexpr:
-// We need to check that a global variable initialized with a constexpr
-// constructor can be accessed during dynamic initialization (as a constexpr
-// constructor implies that it was initialized during constant initialization,
-// not dynamic initialization).
-
-// RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-constexpr-extra.cc\
-// RUN: --std=c++11 -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m64 -O1 %s %p/Helpers/initialization-constexpr-extra.cc\
-// RUN: --std=c++11 -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m64 -O2 %s %p/Helpers/initialization-constexpr-extra.cc\
-// RUN: --std=c++11 -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m64 -O3 %s %p/Helpers/initialization-constexpr-extra.cc\
-// RUN: --std=c++11 -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-constexpr-extra.cc\
-// RUN: --std=c++11 -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m32 -O1 %s %p/Helpers/initialization-constexpr-extra.cc\
-// RUN: --std=c++11 -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m32 -O2 %s %p/Helpers/initialization-constexpr-extra.cc\
-// RUN: --std=c++11 -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m32 -O3 %s %p/Helpers/initialization-constexpr-extra.cc\
-// RUN: --std=c++11 -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-
-class Integer {
- private:
- int value;
-
- public:
- constexpr Integer(int x = 0) : value(x) {}
- int getValue() {return value;}
-};
-Integer coolestInteger(42);
-int getCoolestInteger() { return coolestInteger.getValue(); }
-
-int main() { return 0; }
Removed: compiler-rt/trunk/lib/asan/lit_tests/initialization-nobug.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/initialization-nobug.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/initialization-nobug.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/initialization-nobug.cc (removed)
@@ -1,56 +0,0 @@
-// A collection of various initializers which shouldn't trip up initialization
-// order checking. If successful, this will just return 0.
-
-// RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m64 -O1 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m64 -O2 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m64 -O3 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m32 -O1 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m32 -O2 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-// RUN: %clangxx_asan -m32 -O3 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t
-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
-
-// Simple access:
-// Make sure that accessing a global in the same TU is safe
-
-bool condition = true;
-int initializeSameTU() {
- return condition ? 0x2a : 052;
-}
-int sameTU = initializeSameTU();
-
-// Linker initialized:
-// Check that access to linker initialized globals originating from a different
-// TU's initializer is safe.
-
-int A = (1 << 1) + (1 << 3) + (1 << 5), B;
-int getAB() {
- return A * B;
-}
-
-// Function local statics:
-// Check that access to function local statics originating from a different
-// TU's initializer is safe.
-
-int countCalls() {
- static int calls;
- return ++calls;
-}
-
-// Trivial constructor, non-trivial destructor.
-struct StructWithDtor {
- ~StructWithDtor() { }
- int value;
-};
-StructWithDtor struct_with_dtor;
-int getStructWithDtorValue() { return struct_with_dtor.value; }
-
-int main() { return 0; }
Removed: compiler-rt/trunk/lib/asan/lit_tests/interface_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/interface_test.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/interface_test.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/interface_test.cc (removed)
@@ -1,8 +0,0 @@
-// Check that user may include ASan interface header.
-// RUN: %clang -fsanitize=address -I %p/../../../include %s -o %t && %t
-// RUN: %clang -I %p/../../../include %s -o %t && %t
-#include <sanitizer/asan_interface.h>
-
-int main() {
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/invalid-free.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/invalid-free.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/invalid-free.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/invalid-free.cc (removed)
@@ -1,16 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-#include <stdlib.h>
-#include <string.h>
-int main(int argc, char **argv) {
- char *x = (char*)malloc(10 * sizeof(char));
- memset(x, 0, 10);
- int res = x[argc];
- free(x + 5); // BOOM
- // CHECK: AddressSanitizer: attempting free on address{{.*}}in thread T0
- // CHECK: invalid-free.cc:[[@LINE-2]]
- // CHECK: is located 5 bytes inside of 10-byte region
- // CHECK: allocated by thread T0 here:
- // CHECK: invalid-free.cc:[[@LINE-8]]
- return res;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/large_func_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/large_func_test.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/large_func_test.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/large_func_test.cc (removed)
@@ -1,63 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-
-#include <stdlib.h>
-__attribute__((noinline))
-static void LargeFunction(int *x, int zero) {
- x[0]++;
- x[1]++;
- x[2]++;
- x[3]++;
- x[4]++;
- x[5]++;
- x[6]++;
- x[7]++;
- x[8]++;
- x[9]++;
-
- // CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}}
- // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
- // CHECK: {{READ of size 4 at 0x.* thread T0}}
- x[zero + 103]++; // we should report this exact line
- // atos incorrectly extracts the symbol name for the static functions on
- // Darwin.
- // CHECK-Linux: {{#0 0x.* in LargeFunction.*large_func_test.cc:}}[[@LINE-3]]
- // CHECK-Darwin: {{#0 0x.* in .*LargeFunction.*large_func_test.cc}}:[[@LINE-4]]
-
- x[10]++;
- x[11]++;
- x[12]++;
- x[13]++;
- x[14]++;
- x[15]++;
- x[16]++;
- x[17]++;
- x[18]++;
- x[19]++;
-}
-
-int main(int argc, char **argv) {
- int *x = new int[100];
- LargeFunction(x, argc - 1);
- // CHECK: {{ #1 0x.* in _?main .*large_func_test.cc:}}[[@LINE-1]]
- // CHECK: {{0x.* is located 12 bytes to the right of 400-byte region}}
- // CHECK: {{allocated by thread T0 here:}}
- // CHECK-Linux: {{ #0 0x.* in operator new.*}}
- // CHECK-Darwin: {{ #0 0x.* in .*_Zna.*}}
- // CHECK: {{ #1 0x.* in _?main .*large_func_test.cc:}}[[@LINE-7]]
- delete x;
-}
Modified: compiler-rt/trunk/lib/asan/lit_tests/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/lit.cfg?rev=183395&r1=183394&r2=183395&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/lit.cfg (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/lit.cfg Thu Jun 6 04:23:34 2013
@@ -77,7 +77,7 @@ if llvm_tools_dir:
# Setup path to symbolizer script.
# FIXME: Instead we should copy this script to the build tree and point
# at it there.
-asan_source_dir = os.path.join(config.test_source_root, "..")
+asan_source_dir = get_required_attr(config, "asan_source_dir")
symbolizer = os.path.join(asan_source_dir,
'scripts', 'asan_symbolize.py')
if not os.path.exists(symbolizer):
Modified: compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in?rev=183395&r1=183394&r2=183395&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in Thu Jun 6 04:23:34 2013
@@ -9,6 +9,7 @@ config.compiler_rt_src_root = "@COMPILER
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.clang = "@LLVM_BINARY_DIR@/bin/clang"
config.compiler_rt_arch = "@COMPILER_RT_SUPPORTED_ARCH@"
+config.asan_source_dir = "@ASAN_SOURCE_DIR@"
# LLVM tools dir can be passed in lit parameters, so try to
# apply substitution.
Removed: compiler-rt/trunk/lib/asan/lit_tests/log-path_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/log-path_test.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/log-path_test.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/log-path_test.cc (removed)
@@ -1,39 +0,0 @@
-// RUN: %clangxx_asan %s -o %t
-
-// Regular run.
-// RUN: not %t 2> %t.out
-// RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.out
-
-// Good log_path.
-// RUN: rm -f %t.log.*
-// RUN: ASAN_OPTIONS=log_path=%t.log not %t 2> %t.out
-// RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.log.*
-
-// Invalid log_path.
-// RUN: ASAN_OPTIONS=log_path=/INVALID not %t 2> %t.out
-// RUN: FileCheck %s --check-prefix=CHECK-INVALID < %t.out
-
-// Too long log_path.
-// RUN: ASAN_OPTIONS=log_path=`for((i=0;i<10000;i++)); do echo -n $i; done` \
-// RUN: not %t 2> %t.out
-// RUN: FileCheck %s --check-prefix=CHECK-LONG < %t.out
-
-// Run w/o errors should not produce any log.
-// RUN: rm -f %t.log.*
-// RUN: ASAN_OPTIONS=log_path=%t.log %t ARG ARG ARG
-// RUN: not cat %t.log.*
-
-
-#include <stdlib.h>
-#include <string.h>
-int main(int argc, char **argv) {
- if (argc > 2) return 0;
- char *x = (char*)malloc(10);
- memset(x, 0, 10);
- int res = x[argc * 10]; // BOOOM
- free(x);
- return res;
-}
-// CHECK-ERROR: ERROR: AddressSanitizer
-// CHECK-INVALID: ERROR: Can't open file: /INVALID
-// CHECK-LONG: ERROR: Path is too long: 01234
Removed: compiler-rt/trunk/lib/asan/lit_tests/log_path_fork_test.cc.disabled
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/log_path_fork_test.cc.disabled?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/log_path_fork_test.cc.disabled (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/log_path_fork_test.cc.disabled (removed)
@@ -1,22 +0,0 @@
-// RUN: %clangxx_asan %s -o %t
-// RUN: rm -f %t.log.*
-// Set verbosity to 1 so that the log files are opened prior to fork().
-// RUN: ASAN_OPTIONS="log_path=%t.log verbosity=1" not %t 2> %t.out
-// RUN: for f in %t.log.* ; do FileCheck %s < $f; done
-// RUN: [ `ls %t.log.* | wc -l` == 2 ]
-
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-int main(int argc, char **argv) {
- void *x = malloc(10);
- free(x);
- if (fork() == -1) return 1;
- // There are two processes at this point, thus there should be two distinct
- // error logs.
- free(x);
- return 0;
-}
-
-// CHECK: ERROR: AddressSanitizer
Removed: compiler-rt/trunk/lib/asan/lit_tests/malloc_fill.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/malloc_fill.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/malloc_fill.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/malloc_fill.cc (removed)
@@ -1,22 +0,0 @@
-// Check that we fill malloc-ed memory correctly.
-// RUN: %clangxx_asan -m64 %s -o %t
-// RUN: %t | FileCheck %s
-// RUN: ASAN_OPTIONS=max_malloc_fill_size=10:malloc_fill_byte=8 %t | FileCheck %s --check-prefix=CHECK-10-8
-// RUN: ASAN_OPTIONS=max_malloc_fill_size=20:malloc_fill_byte=171 %t | FileCheck %s --check-prefix=CHECK-20-ab
-
-#include <stdio.h>
-int main(int argc, char **argv) {
- // With asan allocator this makes sure we get memory from mmap.
- static const int kSize = 1 << 25;
- unsigned char *x = new unsigned char[kSize];
- printf("-");
- for (int i = 0; i <= 32; i++) {
- printf("%02x", x[i]);
- }
- printf("-\n");
- delete [] x;
-}
-
-// CHECK: -bebebebebebebebebebebebebebebebebebebebebebebebebebebebebebebebebe-
-// CHECK-10-8: -080808080808080808080000000000000000000000000000000000000000000000-
-// CHECK-20-ab: -abababababababababababababababababababab00000000000000000000000000-
Removed: compiler-rt/trunk/lib/asan/lit_tests/malloc_hook.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/malloc_hook.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/malloc_hook.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/malloc_hook.cc (removed)
@@ -1,36 +0,0 @@
-// RUN: %clangxx_asan -O2 %s -o %t
-// RUN: %t 2>&1 | FileCheck %s
-#include <stdlib.h>
-#include <unistd.h>
-
-extern "C" {
-bool __asan_get_ownership(const void *p);
-
-void *global_ptr;
-
-// Note: avoid calling functions that allocate memory in malloc/free
-// to avoid infinite recursion.
-void __asan_malloc_hook(void *ptr, size_t sz) {
- if (__asan_get_ownership(ptr)) {
- write(1, "MallocHook\n", sizeof("MallocHook\n"));
- global_ptr = ptr;
- }
-}
-void __asan_free_hook(void *ptr) {
- if (__asan_get_ownership(ptr) && ptr == global_ptr)
- write(1, "FreeHook\n", sizeof("FreeHook\n"));
-}
-} // extern "C"
-
-int main() {
- volatile int *x = new int;
- // CHECK: MallocHook
- // Check that malloc hook was called with correct argument.
- if (global_ptr != (void*)x) {
- _exit(1);
- }
- *x = 0;
- delete x;
- // CHECK: FreeHook
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/memcmp_strict_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/memcmp_strict_test.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/memcmp_strict_test.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/memcmp_strict_test.cc (removed)
@@ -1,16 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && ASAN_OPTIONS=strict_memcmp=0 %t 2>&1 | %symbolize | FileCheck %s --check-prefix=CHECK-nonstrict
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && ASAN_OPTIONS=strict_memcmp=1 %t 2>&1 | %symbolize | FileCheck %s --check-prefix=CHECK-strict
-// Default to strict_memcmp=1.
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s --check-prefix=CHECK-strict
-
-#include <stdio.h>
-#include <string.h>
-int main() {
- char kFoo[] = "foo";
- char kFubar[] = "fubar";
- int res = memcmp(kFoo, kFubar, strlen(kFubar));
- printf("res: %d\n", res);
- // CHECK-nonstrict: {{res: -1}}
- // CHECK-strict: AddressSanitizer: stack-buffer-overflow
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/memcmp_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/memcmp_test.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/memcmp_test.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/memcmp_test.cc (removed)
@@ -1,19 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-#include <string.h>
-int main(int argc, char **argv) {
- char a1[] = {argc, 2, 3, 4};
- char a2[] = {1, 2*argc, 3, 4};
- int res = memcmp(a1, a2, 4 + argc); // BOOM
- // CHECK: AddressSanitizer: stack-buffer-overflow
- // CHECK: {{#0.*memcmp}}
- // CHECK: {{#1.*main}}
- return res;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/null_deref.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/null_deref.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/null_deref.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/null_deref.cc (removed)
@@ -1,31 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-
-__attribute__((noinline))
-static void NullDeref(int *ptr) {
- // CHECK: ERROR: AddressSanitizer: SEGV on unknown address
- // CHECK: {{0x0*00028 .*pc 0x.*}}
- // CHECK: {{AddressSanitizer can not provide additional info.}}
- ptr[10]++; // BOOM
- // atos on Mac cannot extract the symbol name correctly.
- // CHECK-Linux: {{ #0 0x.* in NullDeref.*null_deref.cc:}}[[@LINE-2]]
- // CHECK-Darwin: {{ #0 0x.* in .*NullDeref.*null_deref.cc:}}[[@LINE-3]]
-}
-int main() {
- NullDeref((int*)0);
- // CHECK: {{ #1 0x.* in _?main.*null_deref.cc:}}[[@LINE-1]]
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/on_error_callback.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/on_error_callback.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/on_error_callback.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/on_error_callback.cc (removed)
@@ -1,16 +0,0 @@
-// RUN: %clangxx_asan -O2 %s -o %t && %t 2>&1 | FileCheck %s
-
-#include <stdio.h>
-#include <stdlib.h>
-
-extern "C"
-void __asan_on_error() {
- fprintf(stderr, "__asan_on_error called");
-}
-
-int main() {
- char *x = (char*)malloc(10 * sizeof(char));
- free(x);
- return x[5];
- // CHECK: __asan_on_error called
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/partial_right.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/partial_right.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/partial_right.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/partial_right.cc (removed)
@@ -1,17 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-#include <stdlib.h>
-int main(int argc, char **argv) {
- volatile int *x = (int*)malloc(2*sizeof(int) + 2);
- int res = x[2]; // BOOOM
- // CHECK: {{READ of size 4 at 0x.* thread T0}}
- // CHECK: [[ADDR:0x[01-9a-fa-f]+]] is located 0 bytes to the right of {{.*}}-byte region [{{.*}},{{.*}}[[ADDR]])
- return res;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/sanity_check_pure_c.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/sanity_check_pure_c.c?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/sanity_check_pure_c.c (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/sanity_check_pure_c.c (removed)
@@ -1,19 +0,0 @@
-// Sanity checking a test in pure C.
-// RUN: %clang -g -fsanitize=address -O2 %s -o %t
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-
-// Sanity checking a test in pure C with -pie.
-// RUN: %clang -g -fsanitize=address -O2 %s -pie -o %t
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-
-#include <stdlib.h>
-int main() {
- char *x = (char*)malloc(10 * sizeof(char));
- free(x);
- return x[5];
- // CHECK: heap-use-after-free
- // CHECK: free
- // CHECK: main{{.*}}sanity_check_pure_c.c:[[@LINE-4]]
- // CHECK: malloc
- // CHECK: main{{.*}}sanity_check_pure_c.c:[[@LINE-7]]
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/shared-lib-test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/shared-lib-test.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/shared-lib-test.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/shared-lib-test.cc (removed)
@@ -1,54 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %p/SharedLibs/shared-lib-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O1 %p/SharedLibs/shared-lib-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O2 %p/SharedLibs/shared-lib-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O3 %p/SharedLibs/shared-lib-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O0 %p/SharedLibs/shared-lib-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O1 %p/SharedLibs/shared-lib-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O2 %p/SharedLibs/shared-lib-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O3 %p/SharedLibs/shared-lib-test-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-#include <dlfcn.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <string>
-
-using std::string;
-
-typedef void (fun_t)(int x);
-
-int main(int argc, char *argv[]) {
- string path = string(argv[0]) + "-so.so";
- printf("opening %s ... \n", path.c_str());
- void *lib = dlopen(path.c_str(), RTLD_NOW);
- if (!lib) {
- printf("error in dlopen(): %s\n", dlerror());
- return 1;
- }
- fun_t *inc = (fun_t*)dlsym(lib, "inc");
- if (!inc) return 1;
- printf("ok\n");
- inc(1);
- inc(-1); // BOOM
- // CHECK: {{.*ERROR: AddressSanitizer: global-buffer-overflow}}
- // CHECK: {{READ of size 4 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.*}}
- // CHECK: {{ #1 0x.* in _?main .*shared-lib-test.cc:}}[[@LINE-4]]
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/sleep_before_dying.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/sleep_before_dying.c?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/sleep_before_dying.c (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/sleep_before_dying.c (removed)
@@ -1,10 +0,0 @@
-// RUN: %clang -g -fsanitize=address -O2 %s -o %t
-// RUN: ASAN_OPTIONS="sleep_before_dying=1" %t 2>&1 | FileCheck %s
-
-#include <stdlib.h>
-int main() {
- char *x = (char*)malloc(10 * sizeof(char));
- free(x);
- return x[5];
- // CHECK: Sleeping for 1 second
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/stack-frame-demangle.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/stack-frame-demangle.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/stack-frame-demangle.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/stack-frame-demangle.cc (removed)
@@ -1,22 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-#include <string.h>
-
-namespace XXX {
-struct YYY {
- static int ZZZ(int x) {
- char array[10];
- memset(array, 0, 10);
- return array[x]; // BOOOM
- // CHECK: ERROR: AddressSanitizer: stack-buffer-overflow
- // CHECK: READ of size 1 at
- // CHECK: is located in stack of thread T0 at offset
- // CHECK: XXX::YYY::ZZZ
- }
-};
-} // namespace XXX
-
-int main(int argc, char **argv) {
- int res = XXX::YYY::ZZZ(argc + 10);
- return res;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/stack-oob-frames.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/stack-oob-frames.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/stack-oob-frames.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/stack-oob-frames.cc (removed)
@@ -1,59 +0,0 @@
-// RUN: %clangxx_asan -m64 -O1 %s -o %t
-// RUN: %t 0 2>&1 | %symbolize | FileCheck %s --check-prefix=CHECK0
-// RUN: %t 1 2>&1 | %symbolize | FileCheck %s --check-prefix=CHECK1
-// RUN: %t 2 2>&1 | %symbolize | FileCheck %s --check-prefix=CHECK2
-// RUN: %t 3 2>&1 | %symbolize | FileCheck %s --check-prefix=CHECK3
-
-#define NOINLINE __attribute__((noinline))
-inline void break_optimization(void *arg) {
- __asm__ __volatile__("" : : "r" (arg) : "memory");
-}
-
-NOINLINE static void Frame0(int frame, char *a, char *b, char *c) {
- char s[4] = {0};
- char *d = s;
- break_optimization(&d);
- switch (frame) {
- case 3: a[5]++; break;
- case 2: b[5]++; break;
- case 1: c[5]++; break;
- case 0: d[5]++; break;
- }
-}
-NOINLINE static void Frame1(int frame, char *a, char *b) {
- char c[4] = {0}; Frame0(frame, a, b, c);
- break_optimization(0);
-}
-NOINLINE static void Frame2(int frame, char *a) {
- char b[4] = {0}; Frame1(frame, a, b);
- break_optimization(0);
-}
-NOINLINE static void Frame3(int frame) {
- char a[4] = {0}; Frame2(frame, a);
- break_optimization(0);
-}
-
-int main(int argc, char **argv) {
- if (argc != 2) return 1;
- Frame3(argv[1][0] - '0');
-}
-
-// CHECK0: AddressSanitizer: stack-buffer-overflow
-// CHECK0: #0{{.*}}Frame0
-// CHECK0: #1{{.*}}Frame1
-// CHECK0: #2{{.*}}Frame2
-// CHECK0: #3{{.*}}Frame3
-// CHECK0: is located in stack of thread T0 at offset
-// CHECK0-NEXT: #0{{.*}}Frame0
-//
-// CHECK1: AddressSanitizer: stack-buffer-overflow
-// CHECK1: is located in stack of thread T0 at offset
-// CHECK1-NEXT: #0{{.*}}Frame1
-//
-// CHECK2: AddressSanitizer: stack-buffer-overflow
-// CHECK2: is located in stack of thread T0 at offset
-// CHECK2-NEXT: #0{{.*}}Frame2
-//
-// CHECK3: AddressSanitizer: stack-buffer-overflow
-// CHECK3: is located in stack of thread T0 at offset
-// CHECK3-NEXT: #0{{.*}}Frame3
Removed: compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc (removed)
@@ -1,20 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-#include <string.h>
-int main(int argc, char **argv) {
- char x[10];
- memset(x, 0, 10);
- int res = x[argc * 10]; // BOOOM
- // CHECK: {{READ of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in _?main .*stack-overflow.cc:}}[[@LINE-2]]
- // CHECK: {{Address 0x.* is located in stack of thread T0 at offset}}
- // CHECK-NEXT: in{{.*}}main{{.*}}stack-overflow.cc
- return res;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/stack-use-after-return.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/stack-use-after-return.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/stack-use-after-return.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/stack-use-after-return.cc (removed)
@@ -1,45 +0,0 @@
-// XFAIL: *
-// RUN: %clangxx_asan -fsanitize=use-after-return -m64 -O0 %s -o %t && \
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -fsanitize=use-after-return -m64 -O1 %s -o %t && \
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -fsanitize=use-after-return -m64 -O2 %s -o %t && \
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -fsanitize=use-after-return -m64 -O3 %s -o %t && \
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -fsanitize=use-after-return -m32 -O0 %s -o %t && \
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -fsanitize=use-after-return -m32 -O1 %s -o %t && \
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -fsanitize=use-after-return -m32 -O2 %s -o %t && \
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -fsanitize=use-after-return -m32 -O3 %s -o %t && \
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-
-#include <stdio.h>
-
-__attribute__((noinline))
-char *Ident(char *x) {
- fprintf(stderr, "1: %p\n", x);
- return x;
-}
-
-__attribute__((noinline))
-char *Func1() {
- char local;
- return Ident(&local);
-}
-
-__attribute__((noinline))
-void Func2(char *x) {
- fprintf(stderr, "2: %p\n", x);
- *x = 1;
- // CHECK: WRITE of size 1 {{.*}} thread T0
- // CHECK: #0{{.*}}Func2{{.*}}stack-use-after-return.cc:[[@LINE-2]]
- // CHECK: is located {{.*}} in frame <{{.*}}Func1{{.*}}> of T0's stack
-}
-
-int main(int argc, char **argv) {
- Func2(Func1());
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/strip_path_prefix.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/strip_path_prefix.c?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/strip_path_prefix.c (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/strip_path_prefix.c (removed)
@@ -1,12 +0,0 @@
-// RUN: %clang -g -fsanitize=address -O2 %s -o %t
-// RUN: ASAN_OPTIONS="strip_path_prefix='/'" %t 2>&1 | FileCheck %s
-
-#include <stdlib.h>
-int main() {
- char *x = (char*)malloc(10 * sizeof(char));
- free(x);
- return x[5];
- // Check that paths in error report don't start with slash.
- // CHECK: heap-use-after-free
- // CHECK-NOT: #0 0x{{.*}} ({{[/].*}})
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/strncpy-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/strncpy-overflow.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/strncpy-overflow.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/strncpy-overflow.cc (removed)
@@ -1,38 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-
-#include <string.h>
-#include <stdlib.h>
-int main(int argc, char **argv) {
- char *hello = (char*)malloc(6);
- strcpy(hello, "hello");
- char *short_buffer = (char*)malloc(9);
- strncpy(short_buffer, hello, 10); // BOOM
- // CHECK: {{WRITE of size 10 at 0x.* thread T0}}
- // CHECK-Linux: {{ #0 0x.* in .*strncpy}}
- // CHECK-Darwin: {{ #0 0x.* in _?wrap_strncpy}}
- // CHECK: {{ #1 0x.* in _?main .*strncpy-overflow.cc:}}[[@LINE-4]]
- // CHECK: {{0x.* is located 0 bytes to the right of 9-byte region}}
- // CHECK: {{allocated by thread T0 here:}}
-
- // CHECK-Linux: {{ #0 0x.* in .*malloc}}
- // CHECK-Linux: {{ #1 0x.* in main .*strncpy-overflow.cc:}}[[@LINE-10]]
-
- // CHECK-Darwin: {{ #0 0x.* in _?wrap_malloc.*}}
- // CHECK-Darwin: {{ #1 0x.* in _?main .*strncpy-overflow.cc:}}[[@LINE-13]]
- return short_buffer[8];
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/symbolize_callback.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/symbolize_callback.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/symbolize_callback.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/symbolize_callback.cc (removed)
@@ -1,17 +0,0 @@
-// RUN: %clangxx_asan -O2 %s -o %t && %t 2>&1 | FileCheck %s
-
-#include <stdio.h>
-#include <stdlib.h>
-
-extern "C"
-bool __asan_symbolize(const void *pc, char *out_buffer, int out_size) {
- snprintf(out_buffer, out_size, "MySymbolizer");
- return true;
-}
-
-int main() {
- char *x = (char*)malloc(10 * sizeof(char));
- free(x);
- return x[5];
- // CHECK: MySymbolizer
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/throw_call_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/throw_call_test.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/throw_call_test.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/throw_call_test.cc (removed)
@@ -1,45 +0,0 @@
-// RUN: %clangxx_asan %s -o %t && %t
-// http://code.google.com/p/address-sanitizer/issues/detail?id=147 (not fixed).
-// BROKEN: %clangxx_asan %s -o %t -static-libstdc++ && %t
-#include <stdio.h>
-static volatile int zero = 0;
-inline void pretend_to_do_something(void *x) {
- __asm__ __volatile__("" : : "r" (x) : "memory");
-}
-
-__attribute__((noinline, no_sanitize_address))
-void ReallyThrow() {
- fprintf(stderr, "ReallyThrow\n");
- if (zero == 0)
- throw 42;
-}
-
-__attribute__((noinline))
-void Throw() {
- int a, b, c, d, e;
- pretend_to_do_something(&a);
- pretend_to_do_something(&b);
- pretend_to_do_something(&c);
- pretend_to_do_something(&d);
- pretend_to_do_something(&e);
- fprintf(stderr, "Throw stack = %p\n", &a);
- ReallyThrow();
-}
-
-__attribute__((noinline))
-void CheckStack() {
- int ar[100];
- pretend_to_do_something(ar);
- for (int i = 0; i < 100; i++)
- ar[i] = i;
- fprintf(stderr, "CheckStack stack = %p, %p\n", ar, ar + 100);
-}
-
-int main(int argc, char** argv) {
- try {
- Throw();
- } catch(int a) {
- fprintf(stderr, "a = %d\n", a);
- }
- CheckStack();
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/throw_invoke_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/throw_invoke_test.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/throw_invoke_test.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/throw_invoke_test.cc (removed)
@@ -1,50 +0,0 @@
-// RUN: %clangxx_asan %s -o %t && %t
-// RUN: %clangxx_asan %s -o %t -static-libstdc++ && %t
-#include <stdio.h>
-static volatile int zero = 0;
-inline void pretend_to_do_something(void *x) {
- __asm__ __volatile__("" : : "r" (x) : "memory");
-}
-
-__attribute__((noinline))
-void ReallyThrow() {
- fprintf(stderr, "ReallyThrow\n");
- try {
- if (zero == 0)
- throw 42;
- else if (zero == 1)
- throw 1.;
- } catch(double x) {
- }
-}
-
-__attribute__((noinline))
-void Throw() {
- int a, b, c, d, e;
- pretend_to_do_something(&a);
- pretend_to_do_something(&b);
- pretend_to_do_something(&c);
- pretend_to_do_something(&d);
- pretend_to_do_something(&e);
- fprintf(stderr, "Throw stack = %p\n", &a);
- ReallyThrow();
-}
-
-__attribute__((noinline))
-void CheckStack() {
- int ar[100];
- pretend_to_do_something(ar);
- for (int i = 0; i < 100; i++)
- ar[i] = i;
- fprintf(stderr, "CheckStack stack = %p, %p\n", ar, ar + 100);
-}
-
-int main(int argc, char** argv) {
- try {
- Throw();
- } catch(int a) {
- fprintf(stderr, "a = %d\n", a);
- }
- CheckStack();
-}
-
Removed: compiler-rt/trunk/lib/asan/lit_tests/time_interceptor.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/time_interceptor.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/time_interceptor.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/time_interceptor.cc (removed)
@@ -1,16 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-// Test the time() interceptor.
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-
-int main() {
- time_t *tm = (time_t*)malloc(sizeof(time_t));
- free(tm);
- time_t t = time(tm);
- printf("Time: %s\n", ctime(&t)); // NOLINT
- // CHECK: use-after-free
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/unaligned_loads_and_stores.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/unaligned_loads_and_stores.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/unaligned_loads_and_stores.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/unaligned_loads_and_stores.cc (removed)
@@ -1,52 +0,0 @@
-// RUN: %clangxx_asan -O0 -I %p/../../../include %s -o %t
-// RUN: %t A 2>&1 | %symbolize | FileCheck --check-prefix=CHECK-A %s
-// RUN: %t B 2>&1 | %symbolize | FileCheck --check-prefix=CHECK-B %s
-// RUN: %t C 2>&1 | %symbolize | FileCheck --check-prefix=CHECK-C %s
-// RUN: %t D 2>&1 | %symbolize | FileCheck --check-prefix=CHECK-D %s
-// RUN: %t E 2>&1 | %symbolize | FileCheck --check-prefix=CHECK-E %s
-
-// RUN: %t K 2>&1 | %symbolize | FileCheck --check-prefix=CHECK-K %s
-// RUN: %t L 2>&1 | %symbolize | FileCheck --check-prefix=CHECK-L %s
-// RUN: %t M 2>&1 | %symbolize | FileCheck --check-prefix=CHECK-M %s
-// RUN: %t N 2>&1 | %symbolize | FileCheck --check-prefix=CHECK-N %s
-// RUN: %t O 2>&1 | %symbolize | FileCheck --check-prefix=CHECK-O %s
-
-#include <sanitizer/asan_interface.h>
-
-#include <stdlib.h>
-#include <string.h>
-int main(int argc, char **argv) {
- if (argc != 2) return 1;
- char *x = new char[16];
- memset(x, 0xab, 16);
- int res = 1;
- switch (argv[1][0]) {
- case 'A': res = __sanitizer_unaligned_load16(x + 15); break;
-// CHECK-A ERROR: AddressSanitizer: heap-buffer-overflow on address
-// CHECK-A: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-2]]
-// CHECK-A: is located 0 bytes to the right of 16-byte region
- case 'B': res = __sanitizer_unaligned_load32(x + 14); break;
-// CHECK-B: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
- case 'C': res = __sanitizer_unaligned_load32(x + 13); break;
-// CHECK-C: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
- case 'D': res = __sanitizer_unaligned_load64(x + 15); break;
-// CHECK-D: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
- case 'E': res = __sanitizer_unaligned_load64(x + 9); break;
-// CHECK-E: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
-
- case 'K': __sanitizer_unaligned_store16(x + 15, 0); break;
-// CHECK-K ERROR: AddressSanitizer: heap-buffer-overflow on address
-// CHECK-K: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-2]]
-// CHECK-K: is located 0 bytes to the right of 16-byte region
- case 'L': __sanitizer_unaligned_store32(x + 15, 0); break;
-// CHECK-L: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
- case 'M': __sanitizer_unaligned_store32(x + 13, 0); break;
-// CHECK-M: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
- case 'N': __sanitizer_unaligned_store64(x + 10, 0); break;
-// CHECK-N: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
- case 'O': __sanitizer_unaligned_store64(x + 14, 0); break;
-// CHECK-O: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
- }
- delete x;
- return res;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/use-after-free-right.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/use-after-free-right.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/use-after-free-right.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/use-after-free-right.cc (removed)
@@ -1,46 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-
-// Test use-after-free report in the case when access is at the right border of
-// the allocation.
-
-#include <stdlib.h>
-int main() {
- volatile char *x = (char*)malloc(sizeof(char));
- free((void*)x);
- *x = 42;
- // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
- // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
- // CHECK: {{WRITE of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in _?main .*use-after-free-right.cc:25}}
- // CHECK: {{0x.* is located 0 bytes inside of 1-byte region .0x.*,0x.*}}
- // CHECK: {{freed by thread T0 here:}}
-
- // CHECK-Linux: {{ #0 0x.* in .*free}}
- // CHECK-Linux: {{ #1 0x.* in main .*use-after-free-right.cc:24}}
-
- // CHECK-Darwin: {{ #0 0x.* in _?wrap_free}}
- // CHECK-Darwin: {{ #1 0x.* in _?main .*use-after-free-right.cc:24}}
-
- // CHECK: {{previously allocated by thread T0 here:}}
-
- // CHECK-Linux: {{ #0 0x.* in .*malloc}}
- // CHECK-Linux: {{ #1 0x.* in main .*use-after-free-right.cc:23}}
-
- // CHECK-Darwin: {{ #0 0x.* in _?wrap_malloc.*}}
- // CHECK-Darwin: {{ #1 0x.* in _?main .*use-after-free-right.cc:23}}
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/use-after-free.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/use-after-free.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/use-after-free.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/use-after-free.cc (removed)
@@ -1,43 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out
-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
-
-#include <stdlib.h>
-int main() {
- char *x = (char*)malloc(10 * sizeof(char));
- free(x);
- return x[5];
- // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
- // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
- // CHECK: {{READ of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in _?main .*use-after-free.cc:22}}
- // CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}}
- // CHECK: {{freed by thread T0 here:}}
-
- // CHECK-Linux: {{ #0 0x.* in .*free}}
- // CHECK-Linux: {{ #1 0x.* in main .*use-after-free.cc:21}}
-
- // CHECK-Darwin: {{ #0 0x.* in _?wrap_free}}
- // CHECK-Darwin: {{ #1 0x.* in _?main .*use-after-free.cc:21}}
-
- // CHECK: {{previously allocated by thread T0 here:}}
-
- // CHECK-Linux: {{ #0 0x.* in .*malloc}}
- // CHECK-Linux: {{ #1 0x.* in main .*use-after-free.cc:20}}
-
- // CHECK-Darwin: {{ #0 0x.* in _?wrap_malloc.*}}
- // CHECK-Darwin: {{ #1 0x.* in _?main .*use-after-free.cc:20}}
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/use-after-poison.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/use-after-poison.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/use-after-poison.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/use-after-poison.cc (removed)
@@ -1,20 +0,0 @@
-// Check that __asan_poison_memory_region works.
-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-//
-// Check that we can disable it
-// RUN: ASAN_OPTIONS=allow_user_poisoning=0 %t
-
-#include <stdlib.h>
-
-extern "C" void __asan_poison_memory_region(void *, size_t);
-
-int main(int argc, char **argv) {
- char *x = new char[16];
- x[10] = 0;
- __asan_poison_memory_region(x, 16);
- int res = x[argc * 10]; // BOOOM
- // CHECK: ERROR: AddressSanitizer: use-after-poison
- // CHECK: main{{.*}}use-after-poison.cc:[[@LINE-2]]
- delete [] x;
- return res;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-dtor-order.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-dtor-order.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-dtor-order.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-dtor-order.cc (removed)
@@ -1,25 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 -fsanitize=use-after-scope %s -o %t && \
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-#include <stdio.h>
-
-struct IntHolder {
- explicit IntHolder(int *val = 0) : val_(val) { }
- ~IntHolder() {
- printf("Value: %d\n", *val_); // BOOM
- // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
- // CHECK: #0 0x{{.*}} in IntHolder::~IntHolder{{.*}}use-after-scope-dtor-order.cc:[[@LINE-2]]
- }
- void set(int *val) { val_ = val; }
- int *get() { return val_; }
-
- int *val_;
-};
-
-int main(int argc, char *argv[]) {
- // It is incorrect to use "x" int IntHolder destructor, because "x" is
- // "destroyed" earlier as it's declared later.
- IntHolder holder;
- int x = argc;
- holder.set(&x);
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-inlined.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-inlined.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-inlined.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-inlined.cc (removed)
@@ -1,30 +0,0 @@
-// Test with "-O2" only to make sure inlining (leading to use-after-scope)
-// happens. "always_inline" is not enough, as Clang doesn't emit
-// llvm.lifetime intrinsics at -O0.
-//
-// RUN: %clangxx_asan -m64 -O2 -fsanitize=use-after-scope %s -o %t && \
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -m32 -O2 -fsanitize=use-after-scope %s -o %t && \
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-
-int *arr;
-
-__attribute__((always_inline))
-void inlined(int arg) {
- int x[5];
- for (int i = 0; i < arg; i++) x[i] = i;
- arr = x;
-}
-
-int main(int argc, char *argv[]) {
- inlined(argc);
- return arr[argc - 1]; // BOOM
- // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
- // CHECK: READ of size 4 at 0x{{.*}} thread T0
- // CHECK: #0 0x{{.*}} in {{_?}}main
- // CHECK: {{.*}}use-after-scope-inlined.cc:[[@LINE-4]]
- // CHECK: Address 0x{{.*}} is located in stack of thread T0 at offset
- // CHECK: [[OFFSET:[^ ]*]] in frame
- // CHECK: main
- // CHECK: {{\[}}[[OFFSET]], {{.*}}) 'x.i'
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-nobug.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-nobug.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-nobug.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-nobug.cc (removed)
@@ -1,16 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 -fsanitize=use-after-scope %s -o %t && \
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-
-#include <stdio.h>
-
-int main() {
- int *p = 0;
- // Variable goes in and out of scope.
- for (int i = 0; i < 3; i++) {
- int x = 0;
- p = &x;
- }
- printf("PASSED\n");
- // CHECK: PASSED
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-temp.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-temp.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-temp.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/use-after-scope-temp.cc (removed)
@@ -1,29 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 -fsanitize=use-after-scope %s -o %t && \
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-//
-// Lifetime for temporaries is not emitted yet.
-// XFAIL: *
-
-#include <stdio.h>
-
-struct IntHolder {
- explicit IntHolder(int val) : val(val) {
- printf("IntHolder: %d\n", val);
- }
- int val;
-};
-
-const IntHolder *saved;
-
-void save(const IntHolder &holder) {
- saved = &holder;
-}
-
-int main(int argc, char *argv[]) {
- save(IntHolder(10));
- int x = saved->val; // BOOM
- // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
- // CHECK: #0 0x{{.*}} in {{_?}}main {{.*}}use-after-scope-temp.cc:[[@LINE-2]]
- printf("saved value: %d\n", x);
- return 0;
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/use-after-scope.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/use-after-scope.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/use-after-scope.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/use-after-scope.cc (removed)
@@ -1,15 +0,0 @@
-// RUN: %clangxx_asan -m64 -O0 -fsanitize=use-after-scope %s -o %t && \
-// RUN: %t 2>&1 | %symbolize | FileCheck %s
-
-int main() {
- int *p = 0;
- {
- int x = 0;
- p = &x;
- }
- return *p; // BOOM
- // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
- // CHECK: #0 0x{{.*}} in {{_?}}main {{.*}}use-after-scope.cc:[[@LINE-2]]
- // CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame
- // {{\[}}[[OFFSET]], {{[0-9]+}}) 'x'
-}
Removed: compiler-rt/trunk/lib/asan/lit_tests/wait.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/wait.cc?rev=183394&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/wait.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/wait.cc (removed)
@@ -1,77 +0,0 @@
-// RUN: %clangxx_asan -DWAIT -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-// RUN: %clangxx_asan -DWAITPID -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAITPID -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAITPID -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAITPID -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-// RUN: %clangxx_asan -DWAITID -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAITID -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAITID -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAITID -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-// RUN: %clangxx_asan -DWAIT3 -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT3 -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT3 -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT3 -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-// RUN: %clangxx_asan -DWAIT4 -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT4 -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT4 -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT4 -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-// RUN: %clangxx_asan -DWAIT3_RUSAGE -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT3_RUSAGE -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT3_RUSAGE -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT3_RUSAGE -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-// RUN: %clangxx_asan -DWAIT4_RUSAGE -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT4_RUSAGE -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT4_RUSAGE -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-// RUN: %clangxx_asan -DWAIT4_RUSAGE -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
-
-
-#include <assert.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-int main(int argc, char **argv) {
- pid_t pid = fork();
- if (pid) { // parent
- int x[3];
- int *status = x + argc * 3;
- int res;
-#if defined(WAIT)
- res = wait(status);
-#elif defined(WAITPID)
- res = waitpid(pid, status, WNOHANG);
-#elif defined(WAITID)
- siginfo_t *si = (siginfo_t*)(x + argc * 3);
- res = waitid(P_ALL, 0, si, WEXITED | WNOHANG);
-#elif defined(WAIT3)
- res = wait3(status, WNOHANG, NULL);
-#elif defined(WAIT4)
- res = wait4(pid, status, WNOHANG, NULL);
-#elif defined(WAIT3_RUSAGE) || defined(WAIT4_RUSAGE)
- struct rusage *ru = (struct rusage*)(x + argc * 3);
- int good_status;
-# if defined(WAIT3_RUSAGE)
- res = wait3(&good_status, WNOHANG, ru);
-# elif defined(WAIT4_RUSAGE)
- res = wait4(pid, &good_status, WNOHANG, ru);
-# endif
-#endif
- // CHECK: stack-buffer-overflow
- // CHECK: {{WRITE of size .* at 0x.* thread T0}}
- // CHECK: {{in .*wait}}
- // CHECK: {{in _?main .*wait.cc:}}
- // CHECK: is located in stack of thread T0 at offset
- // CHECK: {{in _?main}}
- return res != -1;
- }
- // child
- return 0;
-}
More information about the llvm-commits
mailing list