forked from OSchip/llvm-project
[ASan tests] Use ASAN_OPTIONS in a portable way
llvm-svn: 209629
This commit is contained in:
parent
acef6c776b
commit
d67df369cf
|
@ -4,16 +4,16 @@
|
|||
//
|
||||
// RUN: %clangxx_asan -O0 %s -o %t
|
||||
// RUN: not %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH
|
||||
// RUN: ASAN_OPTIONS=allocator_may_return_null=0 not %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH
|
||||
// RUN: ASAN_OPTIONS=allocator_may_return_null=1 %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mNULL
|
||||
// RUN: ASAN_OPTIONS=allocator_may_return_null=0 not %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cCRASH
|
||||
// RUN: ASAN_OPTIONS=allocator_may_return_null=1 %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cNULL
|
||||
// RUN: ASAN_OPTIONS=allocator_may_return_null=0 not %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coCRASH
|
||||
// RUN: ASAN_OPTIONS=allocator_may_return_null=1 %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coNULL
|
||||
// RUN: ASAN_OPTIONS=allocator_may_return_null=0 not %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rCRASH
|
||||
// RUN: ASAN_OPTIONS=allocator_may_return_null=1 %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rNULL
|
||||
// RUN: ASAN_OPTIONS=allocator_may_return_null=0 not %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrCRASH
|
||||
// RUN: ASAN_OPTIONS=allocator_may_return_null=1 %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrNULL
|
||||
// RUN: env ASAN_OPTIONS=allocator_may_return_null=0 not %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH
|
||||
// RUN: env ASAN_OPTIONS=allocator_may_return_null=1 %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mNULL
|
||||
// RUN: env ASAN_OPTIONS=allocator_may_return_null=0 not %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cCRASH
|
||||
// RUN: env ASAN_OPTIONS=allocator_may_return_null=1 %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cNULL
|
||||
// RUN: env ASAN_OPTIONS=allocator_may_return_null=0 not %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coCRASH
|
||||
// RUN: env ASAN_OPTIONS=allocator_may_return_null=1 %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coNULL
|
||||
// RUN: env ASAN_OPTIONS=allocator_may_return_null=0 not %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rCRASH
|
||||
// RUN: env ASAN_OPTIONS=allocator_may_return_null=1 %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rNULL
|
||||
// RUN: env ASAN_OPTIONS=allocator_may_return_null=0 not %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrCRASH
|
||||
// RUN: env ASAN_OPTIONS=allocator_may_return_null=1 %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrNULL
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
// RUN: %clangxx_asan -O0 -DSHARED_LIB %s -fPIC -shared -o %t-so.so
|
||||
// RUN: %clangxx_asan -O0 %s -ldl -o %t
|
||||
// RUN: ASAN_OPTIONS=symbolize=0 not %run %t 2>&1 | %asan_symbolize | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=symbolize=0 not %run %t 2>&1 | %asan_symbolize | FileCheck %s
|
||||
|
||||
#if !defined(SHARED_LIB)
|
||||
#include <dlfcn.h>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Make sure we report atexit stats.
|
||||
// RUN: %clangxx_asan -O3 %s -o %t
|
||||
// RUN: ASAN_OPTIONS=atexit=1:print_stats=1 %run %t 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=atexit=1:print_stats=1 %run %t 2>&1 | FileCheck %s
|
||||
//
|
||||
// No atexit output on Android due to
|
||||
// https://code.google.com/p/address-sanitizer/issues/detail?id=263
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// RUN: %clangxx_asan -O %s -o %t
|
||||
// RUN: not %run %t crash 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
|
||||
// RUN: not %run %t bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-BAD %s
|
||||
// RUN: ASAN_OPTIONS=detect_container_overflow=0 %run %t crash
|
||||
// RUN: env ASAN_OPTIONS=detect_container_overflow=0 %run %t crash
|
||||
//
|
||||
// Test crash due to __sanitizer_annotate_contiguous_container.
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// RUN: %clangxx_asan -O2 %s -o %t && \
|
||||
// RUN: %run %t 2>&1 | FileCheck %s
|
||||
// Also check that use_sigaltstack+verbosity doesn't crash.
|
||||
// RUN: ASAN_OPTIONS=verbosity=1:use_sigaltstack=1 %run %t | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=verbosity=1:use_sigaltstack=1 %run %t | FileCheck %s
|
||||
#include <stdio.h>
|
||||
|
||||
__attribute__((noinline))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Check that we can store lots of stack frames if asked to.
|
||||
|
||||
// RUN: %clangxx_asan -O0 %s -o %t 2>&1
|
||||
// RUN: ASAN_OPTIONS=malloc_context_size=120:redzone=512 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=malloc_context_size=120:redzone=512 not %run %t 2>&1 | FileCheck %s
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=MALLOC-CTX
|
||||
|
||||
// Also works if no malloc context is available.
|
||||
// RUN: ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// RUN: %clangxx_asan %s -lpthread -o %t
|
||||
// RUN: ASAN_OPTIONS=detect_stack_use_after_return=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1
|
||||
// RUN: ASAN_OPTIONS=detect_stack_use_after_return=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0
|
||||
// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1
|
||||
// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: ASAN_OPTIONS=print_stats=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=print_stats=1 not %run %t 2>&1 | FileCheck %s
|
||||
|
||||
// FIXME: Fix this test under GCC.
|
||||
// REQUIRES: Clang
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// We do *not* want to report init-order bug in this case.
|
||||
|
||||
// RUN: %clangxx_asan -O0 %s %p/Helpers/init-order-atexit-extra.cc -o %t
|
||||
// RUN: ASAN_OPTIONS=strict_init_order=true not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=strict_init_order=true not %run %t 2>&1 | FileCheck %s
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// called.
|
||||
|
||||
// RUN: %clangxx_asan %s %p/Helpers/init-order-pthread-create-extra.cc -lpthread -o %t
|
||||
// RUN: ASAN_OPTIONS=strict_init_order=true %run %t
|
||||
// RUN: env ASAN_OPTIONS=strict_init_order=true %run %t
|
||||
|
||||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
// 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 %run %t 2>&1
|
||||
// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: %clangxx_asan -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 %run %t 2>&1
|
||||
// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: %clangxx_asan -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 %run %t 2>&1
|
||||
// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
|
||||
// Function is defined in another TU.
|
||||
int readBadGlobal();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Test to make sure basic initialization order errors are caught.
|
||||
|
||||
// RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-bug-extra2.cc -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=check_initialization_order=true not %run %t 2>&1 | FileCheck %s
|
||||
|
||||
// Do not test with optimization -- the error may be optimized away.
|
||||
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
|
||||
// RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-constexpr-extra.cc\
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-constexpr-extra.cc\
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-constexpr-extra.cc\
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: %clangxx_asan -O3 %s %p/Helpers/initialization-constexpr-extra.cc\
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
|
||||
class Integer {
|
||||
private:
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
// order checking. If successful, this will just return 0.
|
||||
|
||||
// RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: %clangxx_asan -O3 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
// RUN: env ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
|
||||
|
||||
// Simple access:
|
||||
// Make sure that accessing a global in the same TU is safe
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=MALLOC-CTX
|
||||
|
||||
// Also works if no malloc context is available.
|
||||
// RUN: ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -6,21 +6,21 @@
|
|||
|
||||
// Good log_path.
|
||||
// RUN: rm -f %t.log.*
|
||||
// RUN: ASAN_OPTIONS=log_path=%t.log not %run %t 2> %t.out
|
||||
// RUN: env ASAN_OPTIONS=log_path=%t.log not %run %t 2> %t.out
|
||||
// RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.log.*
|
||||
|
||||
// Invalid log_path.
|
||||
// RUN: ASAN_OPTIONS=log_path=/INVALID not %run %t 2> %t.out
|
||||
// RUN: env ASAN_OPTIONS=log_path=/INVALID not %run %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: env ASAN_OPTIONS=log_path=`for((i=0;i<10000;i++)); do echo -n $i; done` \
|
||||
// RUN: not %run %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 %run %t ARG ARG ARG
|
||||
// RUN: env ASAN_OPTIONS=log_path=%t.log %run %t ARG ARG ARG
|
||||
// RUN: not cat %t.log.*
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// 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 %run %t 2> %t.out
|
||||
// RUN: env ASAN_OPTIONS="log_path=%t.log verbosity=1" not %run %t 2> %t.out
|
||||
// RUN: for f in %t.log.* ; do FileCheck %s < $f; done
|
||||
// RUN: [ `ls %t.log.* | wc -l` == 2 ]
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// RUN: %clangxx_asan -O0 %s -o %t
|
||||
// RUN: ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os
|
||||
// RUN: ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os
|
||||
// RUN: ASAN_OPTIONS=malloc_context_size=1:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os
|
||||
// RUN: ASAN_OPTIONS=malloc_context_size=1:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os
|
||||
// RUN: ASAN_OPTIONS=malloc_context_size=2 not %run %t 2>&1 | FileCheck %s --check-prefix=TWO
|
||||
// RUN: env ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os
|
||||
// RUN: env ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os
|
||||
// RUN: env ASAN_OPTIONS=malloc_context_size=1:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os
|
||||
// RUN: env ASAN_OPTIONS=malloc_context_size=1:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os
|
||||
// RUN: env ASAN_OPTIONS=malloc_context_size=2 not %run %t 2>&1 | FileCheck %s --check-prefix=TWO
|
||||
|
||||
int main() {
|
||||
char *x = new char[20];
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Check that we fill malloc-ed memory correctly.
|
||||
// RUN: %clangxx_asan %s -o %t
|
||||
// RUN: %run %t | FileCheck %s
|
||||
// RUN: ASAN_OPTIONS=max_malloc_fill_size=10:malloc_fill_byte=8 %run %t | FileCheck %s --check-prefix=CHECK-10-8
|
||||
// RUN: ASAN_OPTIONS=max_malloc_fill_size=20:malloc_fill_byte=171 %run %t | FileCheck %s --check-prefix=CHECK-20-ab
|
||||
// RUN: env ASAN_OPTIONS=max_malloc_fill_size=10:malloc_fill_byte=8 %run %t | FileCheck %s --check-prefix=CHECK-10-8
|
||||
// RUN: env ASAN_OPTIONS=max_malloc_fill_size=20:malloc_fill_byte=171 %run %t | FileCheck %s --check-prefix=CHECK-20-ab
|
||||
|
||||
#include <stdio.h>
|
||||
int main(int argc, char **argv) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Test max_redzone runtime option.
|
||||
|
||||
// RUN: %clangxx_asan -O0 %s -o %t && ASAN_OPTIONS=max_redzone=16 %run %t 0 2>&1
|
||||
// RUN: %clangxx_asan -O0 %s -o %t && env ASAN_OPTIONS=max_redzone=16 %run %t 0 2>&1
|
||||
// RUN: %clangxx_asan -O0 %s -o %t && %run %t 1 2>&1
|
||||
// RUN: %clangxx_asan -O3 %s -o %t && ASAN_OPTIONS=max_redzone=16 %run %t 0 2>&1
|
||||
// RUN: %clangxx_asan -O3 %s -o %t && env ASAN_OPTIONS=max_redzone=16 %run %t 0 2>&1
|
||||
// RUN: %clangxx_asan -O3 %s -o %t && %run %t 1 2>&1
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// RUN: %clangxx_asan -O0 %s -o %t && ASAN_OPTIONS=strict_memcmp=0 %run %t
|
||||
// RUN: %clangxx_asan -O0 %s -o %t && ASAN_OPTIONS=strict_memcmp=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O0 %s -o %t && env ASAN_OPTIONS=strict_memcmp=0 %run %t
|
||||
// RUN: %clangxx_asan -O0 %s -o %t && env ASAN_OPTIONS=strict_memcmp=1 not %run %t 2>&1 | FileCheck %s
|
||||
// Default to strict_memcmp=1.
|
||||
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
// RUN: %clangxx_asan -O2 %s -o %t
|
||||
// RUN: %run %t 100 16
|
||||
// RUN: %run %t 100 1000000
|
||||
// RUN: ASAN_OPTIONS=mmap_limit_mb=500 %run %t 50 16
|
||||
// RUN: ASAN_OPTIONS=mmap_limit_mb=500 %run %t 50 1000000
|
||||
// RUN: ASAN_OPTIONS=mmap_limit_mb=500 not %run %t 500 16 2>&1 | FileCheck %s
|
||||
// RUN: ASAN_OPTIONS=mmap_limit_mb=500 not %run %t 500 1000000 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=mmap_limit_mb=500 %run %t 50 16
|
||||
// RUN: env ASAN_OPTIONS=mmap_limit_mb=500 %run %t 50 1000000
|
||||
// RUN: env ASAN_OPTIONS=mmap_limit_mb=500 not %run %t 500 16 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=mmap_limit_mb=500 not %run %t 500 1000000 2>&1 | FileCheck %s
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// RUN: %clangxx_asan -O0 %s -o %t
|
||||
// RUN: not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: not %run %t heap 2>&1 | FileCheck %s
|
||||
// RUN: ASAN_OPTIONS=poison_partial=0 %run %t
|
||||
// RUN: ASAN_OPTIONS=poison_partial=0 %run %t heap
|
||||
// RUN: env ASAN_OPTIONS=poison_partial=0 %run %t
|
||||
// RUN: env ASAN_OPTIONS=poison_partial=0 %run %t heap
|
||||
#include <string.h>
|
||||
char g[21];
|
||||
char *x;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// RUN: %clangxx_asan -O0 %s -o %t
|
||||
// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=YES
|
||||
// RUN: ASAN_OPTIONS=print_summary=false not %run %t 2>&1 | FileCheck %s --check-prefix=NO
|
||||
// RUN: env ASAN_OPTIONS=print_summary=false not %run %t 2>&1 | FileCheck %s --check-prefix=NO
|
||||
|
||||
int main() {
|
||||
char *x = new char[20];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// RUN: %clang_asan -O2 %s -o %t
|
||||
// RUN: ASAN_OPTIONS=check_printf=1 %run %t 2>&1 | FileCheck %s
|
||||
// RUN: ASAN_OPTIONS=check_printf=0 %run %t 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=check_printf=1 %run %t 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS=check_printf=0 %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %run %t 2>&1 | FileCheck %s
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// RUN: %clang_asan -O2 %s -o %t
|
||||
// We need replace_str=0 and replace_intrin=0 to avoid reporting errors in
|
||||
// strlen() and memcpy() called by printf().
|
||||
// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
|
||||
// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
// RUN: env ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
// RUN: env ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
|
||||
// RUN: env ASAN_OPTIONS=replace_str=0:replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// RUN: %clang_asan -O2 %s -o %t
|
||||
// RUN: ASAN_OPTIONS=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
// RUN: ASAN_OPTIONS=check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
|
||||
// RUN: env ASAN_OPTIONS=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
// RUN: env ASAN_OPTIONS=check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
|
||||
// RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// RUN: %clang_asan -O2 %s -o %t
|
||||
// We need replace_str=0 and replace_intrin=0 to avoid reporting errors in
|
||||
// strlen() and memcpy() called by puts().
|
||||
// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
// RUN: env ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
// RUN: env ASAN_OPTIONS=replace_str=0:replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// RUN: %clang_asan -O2 %s -o %t
|
||||
// We need replace_intrin=0 to avoid reporting errors in memcpy.
|
||||
// RUN: ASAN_OPTIONS=replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
// RUN: ASAN_OPTIONS=replace_intrin=0:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
|
||||
// RUN: ASAN_OPTIONS=replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
// RUN: env ASAN_OPTIONS=replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
// RUN: env ASAN_OPTIONS=replace_intrin=0:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
|
||||
// RUN: env ASAN_OPTIONS=replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// RUN: %clang_asan -O2 %s -o %t
|
||||
// RUN: ASAN_OPTIONS="sleep_before_dying=1" not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS="sleep_before_dying=1" not %run %t 2>&1 | FileCheck %s
|
||||
|
||||
#include <stdlib.h>
|
||||
int main() {
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
// Test ASan detection of stack-overflow condition.
|
||||
|
||||
// RUN: %clangxx_asan -O0 %s -DSMALL_FRAME -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O3 %s -DSMALL_FRAME -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O0 %s -DSAVE_ALL_THE_REGISTERS -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O3 %s -DSAVE_ALL_THE_REGISTERS -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O0 %s -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O3 %s -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O0 %s -DSMALL_FRAME -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O3 %s -DSMALL_FRAME -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O0 %s -DSAVE_ALL_THE_REGISTERS -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O3 %s -DSAVE_ALL_THE_REGISTERS -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O0 %s -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O3 %s -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
|
||||
// RUN: %clangxx_asan -O0 %s -DTHREAD -DSMALL_FRAME -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O3 %s -DTHREAD -DSMALL_FRAME -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O0 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O3 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O0 %s -DTHREAD -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O3 %s -DTHREAD -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O0 %s -DTHREAD -DSMALL_FRAME -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O3 %s -DTHREAD -DSMALL_FRAME -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O0 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O3 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O0 %s -DTHREAD -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O3 %s -DTHREAD -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: not %run %t 2>&1 | FileCheck %s
|
||||
|
||||
#include <assert.h>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// RUN: %clangxx_asan -O1 %s -lpthread -o %t && not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O2 %s -lpthread -o %t && not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx_asan -O3 %s -lpthread -o %t && not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: ASAN_OPTIONS=detect_stack_use_after_return=0 %run %t
|
||||
// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %run %t
|
||||
// Regression test for a CHECK failure with small stack size and large frame.
|
||||
// RUN: %clangxx_asan -O3 %s -lpthread -o %t -DkSize=10000 -DUseThread -DkStackSize=65536 && not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s
|
||||
//
|
||||
|
@ -12,8 +12,8 @@
|
|||
//
|
||||
// Test the max_uar_stack_size_log/min_uar_stack_size_log flag.
|
||||
//
|
||||
// RUN: ASAN_OPTIONS=$ASAN_OPTIONS:max_uar_stack_size_log=20:verbosity=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-20 %s
|
||||
// RUN: ASAN_OPTIONS=$ASAN_OPTIONS:min_uar_stack_size_log=24:max_uar_stack_size_log=24:verbosity=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-24 %s
|
||||
// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:max_uar_stack_size_log=20:verbosity=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-20 %s
|
||||
// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:min_uar_stack_size_log=24:max_uar_stack_size_log=24:verbosity=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-24 %s
|
||||
|
||||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// RUN: %clang_asan -O2 %s -o %t
|
||||
// RUN: ASAN_OPTIONS="strip_path_prefix='/'" not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS="strip_path_prefix='/'" not %run %t 2>&1 | FileCheck %s
|
||||
|
||||
#include <stdlib.h>
|
||||
int main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
|
||||
//
|
||||
// Check that we can disable it
|
||||
// RUN: ASAN_OPTIONS=allow_user_poisoning=0 %run %t
|
||||
// RUN: env ASAN_OPTIONS=allow_user_poisoning=0 %run %t
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// RUN: %clangxx_asan -O0 -fsanitize=use-after-scope %s -o %t && \
|
||||
// RUN: not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: ASAN_OPTIONS="detect_stack_use_after_return=1" not %run %t 2>&1 | FileCheck %s
|
||||
// RUN: env ASAN_OPTIONS="detect_stack_use_after_return=1" not %run %t 2>&1 | FileCheck %s
|
||||
|
||||
int main() {
|
||||
int *p = 0;
|
||||
|
|
Loading…
Reference in New Issue