Add %run to all lit tests

llvm-svn: 207709
This commit is contained in:
Greg Fitzgerald 2014-04-30 21:34:17 +00:00
parent 414b6fb170
commit b8aae5405b
422 changed files with 938 additions and 938 deletions

View File

@ -2,7 +2,7 @@
// https://code.google.com/p/address-sanitizer/issues/detail?id=274.
// RUN: %clang_asan %s -framework Foundation -o %t
// RUN: %t 2>&1 | FileCheck %s
// RUN: %run %t 2>&1 | FileCheck %s
#import <Foundation/Foundation.h>
#include <stdio.h>

View File

@ -8,7 +8,7 @@
// TODO(glider): figure out how to set rpath in a more portable way and unite
// this test with ../Linux/interception-in-shared-lib-test.cc.
// RUN: %clangxx_asan -O0 %s -o %t -Wl,-rpath,@executable-path -L%T -linterception-in-shared-lib-test && \
// RUN: not %t 2>&1 | FileCheck %s
// RUN: not %run %t 2>&1 | FileCheck %s
#include <stdio.h>
#include <string.h>

View File

@ -4,7 +4,7 @@
// page-aligned address, so we can only test on a best-effort basis.
// RUN: %clangxx_asan %s -o %t
// RUN: %t 2>&1
// RUN: %run %t 2>&1
#include <malloc/malloc.h>
#include <stdlib.h>

View File

@ -3,7 +3,7 @@
#include <stdio.h>
// RUN: %clangxx_asan %s -o %t
// RUN: not %t 2>&1 | FileCheck %s
// RUN: not %run %t 2>&1 | FileCheck %s
void *pwn(malloc_zone_t *unused_zone, size_t unused_size) {

View File

@ -8,7 +8,7 @@
// FIXME: the following command line may hang in the case of a regression.
// RUN: DYLD_INSERT_LIBRARIES=darwin-dummy-shared-lib-so.dylib \
// RUN: %t 2>&1 | FileCheck %s || exit 1
// RUN: %run %t 2>&1 | FileCheck %s || exit 1
#include <stdio.h>
#include <stdlib.h>

View File

@ -9,9 +9,9 @@
// Make sure DYLD_INSERT_LIBRARIES doesn't contain the runtime library before
// execl().
// RUN: %t %T/echo-env >/dev/null 2>&1
// RUN: %run %t %T/echo-env >/dev/null 2>&1
// RUN: DYLD_INSERT_LIBRARIES=%t-darwin-dummy-shared-lib-so.dylib \
// RUN: %t %T/echo-env 2>&1 | FileCheck %s || exit 1
// RUN: %run %t %T/echo-env 2>&1 | FileCheck %s || exit 1
#include <unistd.h>
int main(int argc, char *argv[]) {
execl(argv[1], argv[1], "DYLD_INSERT_LIBRARIES", NULL);

View File

@ -1,7 +1,7 @@
// Test that dlopen of dynamic runtime is prohibited.
//
// RUN: %clangxx %s -DRT=\"%shared_libasan\" -o %t -ldl
// RUN: not %t 2>&1 | FileCheck %s
// RUN: not %run %t 2>&1 | FileCheck %s
// REQUIRES: asan-dynamic-runtime
#include <dlfcn.h>

View File

@ -7,7 +7,7 @@
// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so -Wl,-Ttext-segment=0x3600000000 ||\
// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so -Wl,-Ttext=0x3600000000
// RUN: %clangxx_asan %t.o %t.so -Wl,-R. -o %t
// RUN: ASAN_OPTIONS=verbosity=1 %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=verbosity=1 %run %t 2>&1 | FileCheck %s
// REQUIRES: x86_64-supported-target, asan-64-bits
#if BUILD_SO

View File

@ -5,7 +5,7 @@
// RUN: %clangxx %s %t.so -o %t
//
// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so
// RUN: LD_PRELOAD=%shared_libasan not %t 2>&1 | FileCheck %s
// RUN: LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s
// REQUIRES: asan-dynamic-runtime

View File

@ -1,7 +1,7 @@
// Test that preloaded runtime works with unsanitized executables.
//
// RUN: %clangxx %s -o %t
// RUN: LD_PRELOAD=%shared_libasan not %t 2>&1 | FileCheck %s
// RUN: LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s
// REQUIRES: asan-dynamic-runtime

View File

@ -2,7 +2,7 @@
// executable is prohibited.
//
// RUN: %clangxx_asan_static %s -o %t
// RUN: LD_PRELOAD=%shared_libasan not %t 2>&1 | FileCheck %s
// RUN: LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s
// REQUIRES: asan-dynamic-runtime

View File

@ -3,7 +3,7 @@
//
// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so
// RUN: %clangxx_asan_static %s %t.so -o %t
// RUN: not %t 2>&1 | FileCheck %s
// RUN: not %run %t 2>&1 | FileCheck %s
// REQUIRES: asan-dynamic-runtime

View File

@ -1,10 +1,10 @@
// Regression test for:
// http://code.google.com/p/address-sanitizer/issues/detail?id=37
// RUN: %clangxx_asan -O0 %s -o %t && %t | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && %t | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && %t | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && %t | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && %run %t | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && %run %t | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && %run %t | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && %run %t | FileCheck %s
#include <stdio.h>
#include <sched.h>

View File

@ -1,11 +1,11 @@
// RUN: %clangxx_asan -mllvm -asan-coverage=1 -DSHARED %s -shared -o %T/libcoverage_test.so -fPIC
// RUN: %clangxx_asan -mllvm -asan-coverage=1 %s -o %t -Wl,-R,\$ORIGIN -L%T -lcoverage_test
// RUN: export ASAN_OPTIONS=coverage=1:verbosity=1
// RUN: %t 2>&1 | FileCheck %s --check-prefix=CHECK-main
// RUN: %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-foo
// RUN: %t bar 2>&1 | FileCheck %s --check-prefix=CHECK-bar
// RUN: %t foo bar 2>&1 | FileCheck %s --check-prefix=CHECK-foo-bar
// RUN: not %t foo bar 1 2 2>&1 | FileCheck %s --check-prefix=CHECK-report
// RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-main
// RUN: %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-foo
// RUN: %run %t bar 2>&1 | FileCheck %s --check-prefix=CHECK-bar
// RUN: %run %t foo bar 2>&1 | FileCheck %s --check-prefix=CHECK-foo-bar
// RUN: not %run %t foo bar 1 2 2>&1 | FileCheck %s --check-prefix=CHECK-report
//
// https://code.google.com/p/address-sanitizer/issues/detail?id=263
// XFAIL: android

View File

@ -2,7 +2,7 @@
// interface.
// RUN: %clang_asan %s -Wl,--gc-sections -ldl -o %t
// RUN: %clang_asan %s -DBUILD_SO -fPIC -o %t-so.so -shared
// RUN: %t 2>&1
// RUN: %run %t 2>&1
// REQUIRES: asan-64-bits

View File

@ -1,5 +1,5 @@
// RUN: %clangxx_asan -O0 %s -o %t && %t %p 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && %t %p 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && %run %t %p 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && %run %t %p 2>&1 | FileCheck %s
#include <assert.h>
#include <glob.h>

View File

@ -2,9 +2,9 @@
// https://code.google.com/p/address-sanitizer/issues/detail?id=183
// RUN: %clangxx_asan -O2 %s -o %t
// RUN: not %t 12 2>&1 | FileCheck %s
// RUN: not %t 100 2>&1 | FileCheck %s
// RUN: not %t 10000 2>&1 | FileCheck %s
// RUN: not %run %t 12 2>&1 | FileCheck %s
// RUN: not %run %t 100 2>&1 | FileCheck %s
// RUN: not %run %t 10000 2>&1 | FileCheck %s
#include <stdlib.h>
#include <string.h>

View File

@ -1,8 +1,8 @@
// RUN: export ASAN_OPTIONS=detect_stack_use_after_return=1
// RUN: %clangxx_asan -O0 %s -o %t && \
// RUN: not %t 2>&1 | FileCheck %s
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && \
// RUN: not %t 2>&1 | FileCheck %s
// RUN: not %run %t 2>&1 | FileCheck %s
#include <stdio.h>
#include <string.h>

View File

@ -4,9 +4,9 @@
// strict init-order checking).
// RUN: %clangxx_asan -O0 %s %p/../Helpers/initialization-bug-extra.cc -o %t
// RUN: ASAN_OPTIONS=strict_init_order=true not %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=strict_init_order=true not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %p/../Helpers/initialization-bug-extra.cc %s -o %t
// RUN: ASAN_OPTIONS=strict_init_order=true not %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=strict_init_order=true not %run %t 2>&1 | FileCheck %s
// Do not test with optimization -- the error may be optimized away.

View File

@ -8,7 +8,7 @@
// TODO(glider): figure out how to set rpath in a more portable way and unite
// this test with ../Darwin/interception-in-shared-lib-test.cc.
// RUN: %clangxx_asan -O0 %s -o %t -Wl,-R,\$ORIGIN -L%T -linterception-in-shared-lib-test && \
// RUN: not %t 2>&1 | FileCheck %s
// RUN: not %run %t 2>&1 | FileCheck %s
#include <stdio.h>
#include <string.h>

View File

@ -1,10 +1,10 @@
// If user provides his own libc functions, ASan doesn't
// intercept these functions.
// RUN: %clangxx_asan -O0 %s -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && %run %t 2>&1 | FileCheck %s
#include <stdlib.h>
#include <stdio.h>

View File

@ -1,9 +1,9 @@
// ASan interceptor can be accessed with __interceptor_ prefix.
// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
// 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
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

View File

@ -1,12 +1,12 @@
// RUN: %clangxx_asan -O0 %s -DTEMP_DIR='"'"%T"'"' -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -DTEMP_DIR='"'"%T"'"' -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -DTEMP_DIR='"'"%T"'"' -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -DTEMP_DIR='"'"%T"'"' -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s
//
// RUN: %clangxx_asan -O0 %s -D_FILE_OFFSET_BITS=64 -DTEMP_DIR='"'"%T"'"' -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -D_FILE_OFFSET_BITS=64 -DTEMP_DIR='"'"%T"'"' -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -D_FILE_OFFSET_BITS=64 -DTEMP_DIR='"'"%T"'"' -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -D_FILE_OFFSET_BITS=64 -DTEMP_DIR='"'"%T"'"' -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -D_FILE_OFFSET_BITS=64 -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -D_FILE_OFFSET_BITS=64 -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -D_FILE_OFFSET_BITS=64 -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -D_FILE_OFFSET_BITS=64 -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s
#include <dirent.h>
#include <memory.h>

View File

@ -1,9 +1,9 @@
// ASan interceptor can be accessed with __interceptor_ prefix.
// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
// 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
#include <stdlib.h>
#include <stdio.h>

View File

@ -1,7 +1,7 @@
// Test that kernel area is not sanitized on 32-bit machines.
//
// RUN: %clangxx_asan %s -o %t
// RUN: ASAN_OPTIONS=verbosity=1 %t 2>&1 | FileCheck %s --check-prefix=CHECK-%kernel_bits
// RUN: ASAN_OPTIONS=verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%kernel_bits
//
// CHECK-kernel-32-bits: || `[0x38000000, 0xbfffffff]` || HighMem ||
// CHECK-kernel-32-bits: || `[0x27000000, 0x37ffffff]` || HighShadow ||

View File

@ -2,9 +2,9 @@
// REQUIRES: asan-64-bits
//
// RUN: %clangxx_asan %s -o %t
// RUN: ASAN_OPTIONS=detect_leaks=1 not %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS="" %t
// RUN: ASAN_OPTIONS=detect_leaks=0 %t
// RUN: ASAN_OPTIONS=detect_leaks=1 not %run %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS="" %run %t
// RUN: ASAN_OPTIONS=detect_leaks=0 %run %t
#include <stdio.h>
int *t;

View File

@ -1,6 +1,6 @@
// RUN: %clangxx_asan -O2 %s -o %t
// RUN: ASAN_OPTIONS=fast_unwind_on_malloc=1 not %t 2>&1 | FileCheck %s --check-prefix=CHECK-FAST
// RUN: ASAN_OPTIONS=fast_unwind_on_malloc=0 not %t 2>&1 | FileCheck %s --check-prefix=CHECK-SLOW
// RUN: ASAN_OPTIONS=fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-FAST
// RUN: ASAN_OPTIONS=fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SLOW
// Test how well we unwind in presence of qsort in the stack
// (i.e. if we can unwind through a function compiled w/o frame pointers).

View File

@ -4,14 +4,14 @@
// RUN: %clangxx_asan -g %s -o %t 2>&1
// Find error and provide malloc context.
// RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=1 not %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=ALLOC-STACK
// RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=ALLOC-STACK
// No error here.
// RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=0 %t
// RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=0 %run %t
// Also works if no malloc context is available.
// RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=1:malloc_context_size=0:fast_unwind_on_malloc=0 not %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=1:malloc_context_size=0:fast_unwind_on_malloc=1 not %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=1:malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=1:malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s
#include <stdlib.h>
static volatile char *x;

View File

@ -1,15 +1,15 @@
// Different size: detect a bug if detect_odr_violation>=1
// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so
// RUN: %clangxx_asan %s %t.so -Wl,-R. -o %t
// RUN: ASAN_OPTIONS=detect_odr_violation=1 not %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=detect_odr_violation=2 not %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=detect_odr_violation=0 %t 2>&1 | FileCheck %s --check-prefix=DISABLED
// RUN: %t 2>&1 | FileCheck %s --check-prefix=DISABLED
// RUN: ASAN_OPTIONS=detect_odr_violation=1 not %run %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=detect_odr_violation=2 not %run %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=detect_odr_violation=0 %run %t 2>&1 | FileCheck %s --check-prefix=DISABLED
// RUN: %run %t 2>&1 | FileCheck %s --check-prefix=DISABLED
//
// Same size: report a bug only if detect_odr_violation>=2.
// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so -DSZ=100
// RUN: ASAN_OPTIONS=detect_odr_violation=1 %t 2>&1 | FileCheck %s --check-prefix=DISABLED
// RUN: ASAN_OPTIONS=detect_odr_violation=2 not %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=detect_odr_violation=1 %run %t 2>&1 | FileCheck %s --check-prefix=DISABLED
// RUN: ASAN_OPTIONS=detect_odr_violation=2 not %run %t 2>&1 | FileCheck %s
#ifndef SZ
# define SZ 4

View File

@ -1,6 +1,6 @@
// RUN: %clangxx_asan -O2 %s -o %t
// RUN: ASAN_OPTIONS=fast_unwind_on_fatal=1 not %t 2>&1 | FileCheck %s --check-prefix=CHECK-FAST
// RUN: ASAN_OPTIONS=fast_unwind_on_fatal=0 not %t 2>&1 | FileCheck %s --check-prefix=CHECK-SLOW
// RUN: ASAN_OPTIONS=fast_unwind_on_fatal=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-FAST
// RUN: ASAN_OPTIONS=fast_unwind_on_fatal=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SLOW
// Test how well we unwind in presence of qsort in the stack
// (i.e. if we can unwind through a function compiled w/o frame pointers).

View File

@ -1,6 +1,6 @@
// RUN: %clangxx -DFUNC=zzzz %s -shared -o %t.so -fPIC
// RUN: %clangxx_asan -DFUNC=main %s -o %t -Wl,-R. %t.so
// RUN: %t
// RUN: %run %t
// This test ensures that we call __asan_init early enough.
// We build a shared library w/o asan instrumentation

View File

@ -1,5 +1,5 @@
// RUN: %clangxx_asan -O0 %s -o %t && %t
// RUN: %clangxx_asan -DPOSITIVE -O0 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && %run %t
// RUN: %clangxx_asan -DPOSITIVE -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
#include <assert.h>
#include <stdio.h>

View File

@ -1,5 +1,5 @@
// Check that we properly report mmap failure.
// RUN: %clangxx_asan %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan %s -o %t && not %run %t 2>&1 | FileCheck %s
#include <stdlib.h>
#include <assert.h>
#include <sys/time.h>

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_asan -O1 %s -o %t && %t 2>&1
// RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1
// Regression test for
// https://code.google.com/p/address-sanitizer/issues/detail?id=250
#include <stdio.h>

View File

@ -10,11 +10,11 @@
// RUN: %clangxx_asan -x c -DSO_NAME=f1 %s -shared -o %t-f1.so -fPIC
// RUN: %clangxx_asan -x c -DSO_NAME=f2 %s -shared -o %t-f2.so -fPIC
// RUN: %clangxx_asan %s -ldl -lpthread -o %t
// RUN: %t 0 3
// RUN: %t 2 3
// RUN: ASAN_OPTIONS=verbosity=2 %t 10 2 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=verbosity=2:intercept_tls_get_addr=1 %t 10 2 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=verbosity=2:intercept_tls_get_addr=0 %t 10 2 2>&1 | FileCheck %s --check-prefix=CHECK0
// RUN: %run %t 0 3
// RUN: %run %t 2 3
// RUN: ASAN_OPTIONS=verbosity=2 %run %t 10 2 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=verbosity=2:intercept_tls_get_addr=1 %run %t 10 2 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=verbosity=2:intercept_tls_get_addr=0 %run %t 10 2 2>&1 | FileCheck %s --check-prefix=CHECK0
// CHECK: __tls_get_addr
// CHECK: Creating thread 0
// CHECK: __tls_get_addr

View File

@ -1,9 +1,9 @@
// Check that ASan plays well with easy cases of makecontext/swapcontext.
// RUN: %clangxx_asan -O0 %s -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && %run %t 2>&1 | FileCheck %s
//
// This test is too sublte to try on non-x86 arch for now.
// REQUIRES: x86_64-supported-target,i386-supported-target

View File

@ -1,5 +1,5 @@
// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
#include <assert.h>
#include <errno.h>

View File

@ -1,7 +1,7 @@
// Regression test for a leak in tsd:
// https://code.google.com/p/address-sanitizer/issues/detail?id=233
// RUN: %clangxx_asan -O1 %s -lpthread -o %t
// RUN: ASAN_OPTIONS=quarantine_size=1 %t
// RUN: ASAN_OPTIONS=quarantine_size=1 %run %t
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -1,6 +1,6 @@
// This test checks that the implementation of use-after-return
// is async-signal-safe.
// RUN: %clangxx_asan -O1 %s -o %t -lpthread && %t
// RUN: %clangxx_asan -O1 %s -o %t -lpthread && %run %t
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>

View File

@ -1,7 +1,7 @@
// Test that TLS is unpoisoned on thread death.
// REQUIRES: x86_64-supported-target,i386-supported-target
// RUN: %clangxx_asan -O1 %s -lpthread -o %t && %t 2>&1
// RUN: %clangxx_asan -O1 %s -lpthread -o %t && %run %t 2>&1
#include <assert.h>
#include <pthread.h>

View File

@ -3,17 +3,17 @@
// With allocator_may_return_null=1 the allocator should return 0.
//
// RUN: %clangxx_asan -O0 %s -o %t
// RUN: not %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH
// RUN: ASAN_OPTIONS=allocator_may_return_null=0 not %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH
// RUN: ASAN_OPTIONS=allocator_may_return_null=1 %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mNULL
// RUN: ASAN_OPTIONS=allocator_may_return_null=0 not %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cCRASH
// RUN: ASAN_OPTIONS=allocator_may_return_null=1 %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cNULL
// RUN: ASAN_OPTIONS=allocator_may_return_null=0 not %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coCRASH
// RUN: ASAN_OPTIONS=allocator_may_return_null=1 %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coNULL
// RUN: ASAN_OPTIONS=allocator_may_return_null=0 not %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rCRASH
// RUN: ASAN_OPTIONS=allocator_may_return_null=1 %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rNULL
// RUN: ASAN_OPTIONS=allocator_may_return_null=0 not %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrCRASH
// RUN: ASAN_OPTIONS=allocator_may_return_null=1 %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrNULL
// 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
#include <limits.h>
#include <stdlib.h>

View File

@ -1,8 +1,8 @@
// Regression test for
// https://code.google.com/p/address-sanitizer/issues/detail?id=180
// RUN: %clangxx_asan -O0 %s -o %t && ASAN_OPTIONS=allow_user_segv_handler=true not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && ASAN_OPTIONS=allow_user_segv_handler=true not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && ASAN_OPTIONS=allow_user_segv_handler=true not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && ASAN_OPTIONS=allow_user_segv_handler=true not %run %t 2>&1 | FileCheck %s
#include <signal.h>
#include <stdio.h>

View File

@ -3,7 +3,7 @@
// RUN: %clangxx_asan -O0 %p/SharedLibs/shared-lib-test-so.cc -fPIC -shared -o %t-so.so
// RUN: %clangxx_asan -O0 %s -ldl -o %t
// RUN: ASAN_OPTIONS=symbolize=0 not %t 2>&1 | %asan_symbolize | FileCheck %s
// RUN: ASAN_OPTIONS=symbolize=0 not %run %t 2>&1 | %asan_symbolize | FileCheck %s
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -1,5 +1,5 @@
// Make sure we don't report a leak nor hang.
// RUN: %clangxx_asan -O3 %s -o %t && %t
// RUN: %clangxx_asan -O3 %s -o %t && %run %t
#include <stdlib.h>
#ifndef __APPLE__
#include <malloc.h>

View File

@ -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 %t 2>&1 | FileCheck %s
// RUN: 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

View File

@ -4,13 +4,13 @@
// RUN: echo "global:*badGlobal*" >> %tmp
// RUN: echo "src:*blacklist-extra.cc" >> %tmp
// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -O0 %s -o %t \
// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1
// RUN: %p/Helpers/blacklist-extra.cc && %run %t 2>&1
// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -O1 %s -o %t \
// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1
// RUN: %p/Helpers/blacklist-extra.cc && %run %t 2>&1
// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -O2 %s -o %t \
// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1
// RUN: %p/Helpers/blacklist-extra.cc && %run %t 2>&1
// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -O3 %s -o %t \
// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1
// RUN: %p/Helpers/blacklist-extra.cc && %run %t 2>&1
// badGlobal is accessed improperly, but we blacklisted it. Align
// it to make sure memory past the end of badGlobal will be in

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_asan -O %s -o %t && %t
// RUN: %clangxx_asan -O %s -o %t && %run %t
//
// Test __sanitizer_annotate_contiguous_container.

View File

@ -1,7 +1,7 @@
// RUN: %clangxx_asan -O %s -o %t
// RUN: not %t crash 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
// RUN: not %t bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-BAD %s
// RUN: ASAN_OPTIONS=detect_container_overflow=0 %t crash
// 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
//
// Test crash due to __sanitizer_annotate_contiguous_container.

View File

@ -1,5 +1,5 @@
// RUN: %clangxx_asan -O0 %s -lpthread -o %t && %t
// RUN: %clangxx_asan -O2 %s -lpthread -o %t && %t
// RUN: %clangxx_asan -O0 %s -lpthread -o %t && %run %t
// RUN: %clangxx_asan -O2 %s -lpthread -o %t && %run %t
#include <assert.h>
#include <pthread.h>

View File

@ -1,9 +1,9 @@
// Check that UAR mode can handle very deep recusrion.
// export ASAN_OPTIONS=detect_stack_use_after_return=1
// RUN: %clangxx_asan -O2 %s -o %t && \
// RUN: %t 2>&1 | FileCheck %s
// RUN: %run %t 2>&1 | FileCheck %s
// Also check that use_sigaltstack+verbosity doesn't crash.
// RUN: ASAN_OPTIONS=verbosity=1:use_sigaltstack=1 %t | FileCheck %s
// RUN: ASAN_OPTIONS=verbosity=1:use_sigaltstack=1 %run %t | FileCheck %s
#include <stdio.h>
__attribute__((noinline))

View File

@ -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 %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=malloc_context_size=120:redzone=512 not %run %t 2>&1 | FileCheck %s
#include <stdlib.h>
#include <stdio.h>

View File

@ -1,7 +1,7 @@
// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
// 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
// CHECK: AddressSanitizer: global-buffer-overflow
int global[10];

View File

@ -1,7 +1,7 @@
// RUN: %clangxx_asan -O0 %s -lpthread -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -lpthread -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -lpthread -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -lpthread -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -lpthread -o %t && not %run %t 2>&1 | FileCheck %s
// 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
#include <pthread.h>

View File

@ -1,5 +1,5 @@
// RUN: %clangxx_asan -O2 %s -o %t
// RUN: %t 2>&1 | FileCheck %s
// RUN: %run %t 2>&1 | FileCheck %s
const char *kAsanDefaultOptions="verbosity=1 foo=bar";

View File

@ -15,13 +15,13 @@
// REQUIRES: x86_64-supported-target,i386-supported-target
// RUN: %clangxx_asan -O0 %p/SharedLibs/dlclose-test-so.cc -fPIC -shared -o %t-so.so
// RUN: %clangxx_asan -O0 %s -ldl -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -ldl -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %p/SharedLibs/dlclose-test-so.cc -fPIC -shared -o %t-so.so
// RUN: %clangxx_asan -O1 %s -ldl -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -ldl -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %p/SharedLibs/dlclose-test-so.cc -fPIC -shared -o %t-so.so
// RUN: %clangxx_asan -O2 %s -ldl -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -ldl -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %p/SharedLibs/dlclose-test-so.cc -fPIC -shared -o %t-so.so
// RUN: %clangxx_asan -O3 %s -ldl -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -ldl -o %t && %run %t 2>&1 | FileCheck %s
#include <assert.h>
#include <dlfcn.h>

View File

@ -1,9 +1,9 @@
// RUN: %clangxx_asan -O0 %s -o %t 2>&1
// RUN: not %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=MALLOC-CTX
// 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 %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=1 not %t 2>&1 | FileCheck %s
// 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
#include <stdlib.h>
#include <string.h>

View File

@ -1,7 +1,7 @@
// This test checks that we are no instrumenting a memory access twice
// (before and after inlining)
// RUN: %clangxx_asan -O1 %s -o %t && %t
// RUN: %clangxx_asan -O0 %s -o %t && %t
// RUN: %clangxx_asan -O1 %s -o %t && %run %t
// RUN: %clangxx_asan -O0 %s -o %t && %run %t
__attribute__((always_inline))
void foo(int *x) {
*x = 0;

View File

@ -1,6 +1,6 @@
// Check that free hook doesn't conflict with Realloc.
// RUN: %clangxx_asan -O2 %s -o %t
// RUN: %t 2>&1 | FileCheck %s
// RUN: %run %t 2>&1 | FileCheck %s
#include <stdlib.h>
#include <unistd.h>

View File

@ -1,6 +1,6 @@
// RUN: %clangxx_asan %s -lpthread -o %t
// RUN: ASAN_OPTIONS=detect_stack_use_after_return=1 %t 2>&1 | FileCheck %s --check-prefix=CHECK1
// RUN: ASAN_OPTIONS=detect_stack_use_after_return=0 %t 2>&1 | FileCheck %s --check-prefix=CHECK0
// 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
#include <assert.h>
#include <stdio.h>

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
namespace XXX {
class YYY {

View File

@ -1,7 +1,7 @@
// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
// 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
#include <string.h>
int main(int argc, char **argv) {

View File

@ -1,7 +1,7 @@
// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
#include <stdlib.h>
#include <string.h>

View File

@ -1,5 +1,5 @@
// RUN: %clangxx_asan %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan %s -o %t && not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O %s -o %t && not %run %t 2>&1 | FileCheck %s
// Check that we can find huge buffer overflows to the left.
#include <stdlib.h>
#include <string.h>

View File

@ -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 %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=strict_init_order=true not %run %t 2>&1 | FileCheck %s
#include <stdio.h>
#include <stdlib.h>

View File

@ -12,7 +12,7 @@
// FIXME: find a better solution.
// RUN: %clangxx_asan -O0 %s -lpthread -ldl -o %t -Wl,--export-dynamic || \
// RUN: %clangxx_asan -O0 %s -lpthread -ldl -o %t
// RUN: ASAN_OPTIONS=strict_init_order=true %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=strict_init_order=true %run %t 2>&1 | FileCheck %s
#include <dlfcn.h>
#include <pthread.h>
#include <stdio.h>

View File

@ -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 %t
// RUN: ASAN_OPTIONS=strict_init_order=true %run %t
#include <stdio.h>
#include <pthread.h>

View File

@ -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 %t 2>&1
// RUN: 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 %t 2>&1
// RUN: 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 %t 2>&1
// RUN: ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
// Function is defined in another TU.
int readBadGlobal();

View File

@ -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 %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=check_initialization_order=true not %run %t 2>&1 | FileCheck %s
// Do not test with optimization -- the error may be optimized away.

View File

@ -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 %t 2>&1
// RUN: 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 %t 2>&1
// RUN: 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 %t 2>&1
// RUN: 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 %t 2>&1
// RUN: ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
class Integer {
private:

View File

@ -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 %t 2>&1
// RUN: 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 %t 2>&1
// RUN: 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 %t 2>&1
// RUN: 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 %t 2>&1
// RUN: ASAN_OPTIONS=check_initialization_order=true %run %t 2>&1
// Simple access:
// Make sure that accessing a global in the same TU is safe

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_asan -O3 %s -o %t && %t
// RUN: %clangxx_asan -O3 %s -o %t && %run %t
// Test that no_sanitize_address attribute applies even when the function would
// be normally inlined.

View File

@ -1,8 +1,8 @@
// Check that user may include ASan interface header.
// RUN: %clang_asan %s -o %t && %t
// RUN: %clang_asan -x c %s -o %t && %t
// RUN: %clang %s -o %t && %t
// RUN: %clang -x c %s -o %t && %t
// RUN: %clang_asan %s -o %t && %run %t
// RUN: %clang_asan -x c %s -o %t && %run %t
// RUN: %clang %s -o %t && %run %t
// RUN: %clang -x c %s -o %t && %run %t
#include <sanitizer/asan_interface.h>
int main() {

View File

@ -1,9 +1,9 @@
// RUN: %clangxx_asan -O0 %s -o %t
// RUN: not %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=MALLOC-CTX
// 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 %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=1 not %t 2>&1 | FileCheck %s
// 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
#include <stdlib.h>
#include <string.h>

View File

@ -1,8 +1,8 @@
// RUN: %clangxx_asan -O0 -g %s -o %t && ASAN_OPTIONS=handle_ioctl=1 not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 -g %s -o %t && ASAN_OPTIONS=handle_ioctl=1 not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 -g %s -o %t && ASAN_OPTIONS=handle_ioctl=1 not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 -g %s -o %t && ASAN_OPTIONS=handle_ioctl=1 not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 -g %s -o %t && %t
// RUN: %clangxx_asan -O3 -g %s -o %t && %t
// RUN: %clangxx_asan -O0 -g %s -o %t && %run %t
// RUN: %clangxx_asan -O3 -g %s -o %t && %run %t
#include <assert.h>
#include <stdlib.h>

View File

@ -2,7 +2,7 @@
// RUN: %clangxx_asan %s -o %t
// The memory is released only when the deallocated chunk leaves the quarantine,
// otherwise the mmap(p, ...) call overwrites the malloc header.
// RUN: ASAN_OPTIONS=quarantine_size=1 %t
// RUN: ASAN_OPTIONS=quarantine_size=1 %run %t
#include <assert.h>
#include <string.h>

View File

@ -1,7 +1,7 @@
// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
#include <stdlib.h>
__attribute__((noinline))

View File

@ -1,26 +1,26 @@
// RUN: %clangxx_asan %s -o %t
// Regular run.
// RUN: not %t 2> %t.out
// RUN: not %run %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: 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 %t 2> %t.out
// RUN: 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: not %t 2> %t.out
// 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 %t ARG ARG ARG
// RUN: ASAN_OPTIONS=log_path=%t.log %run %t ARG ARG ARG
// RUN: not cat %t.log.*

View File

@ -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 %t 2> %t.out
// RUN: 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 ]

View File

@ -1,6 +1,6 @@
// Check that LSan annotations work fine.
// RUN: %clangxx_asan -O0 %s -o %t && %t
// RUN: %clangxx_asan -O3 %s -o %t && %t
// RUN: %clangxx_asan -O0 %s -o %t && %run %t
// RUN: %clangxx_asan -O3 %s -o %t && %run %t
#include <sanitizer/lsan_interface.h>
#include <stdlib.h>

View File

@ -1,9 +1,9 @@
// RUN: %clangxx_asan -O0 %s -o %t
// RUN: ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=0 not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os
// RUN: ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=1 not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os
// RUN: ASAN_OPTIONS=malloc_context_size=1:fast_unwind_on_malloc=0 not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os
// RUN: ASAN_OPTIONS=malloc_context_size=1:fast_unwind_on_malloc=1 not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os
// RUN: ASAN_OPTIONS=malloc_context_size=2 not %t 2>&1 | FileCheck %s --check-prefix=TWO
// 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
int main() {
char *x = new char[20];

View File

@ -1,8 +1,8 @@
// Check that we fill malloc-ed memory correctly.
// RUN: %clangxx_asan %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
// 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
#include <stdio.h>
int main(int argc, char **argv) {

View File

@ -1,5 +1,5 @@
// RUN: %clangxx_asan -O2 %s -o %t
// RUN: %t 2>&1 | FileCheck %s
// RUN: %run %t 2>&1 | FileCheck %s
#include <stdlib.h>
#include <unistd.h>

View File

@ -1,9 +1,9 @@
// Test max_redzone runtime option.
// RUN: %clangxx_asan -O0 %s -o %t && ASAN_OPTIONS=max_redzone=16 %t 0 2>&1
// RUN: %clangxx_asan -O0 %s -o %t && %t 1 2>&1
// RUN: %clangxx_asan -O3 %s -o %t && ASAN_OPTIONS=max_redzone=16 %t 0 2>&1
// RUN: %clangxx_asan -O3 %s -o %t && %t 1 2>&1
// RUN: %clangxx_asan -O0 %s -o %t && 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 && %run %t 1 2>&1
#include <stdio.h>
#include <stdlib.h>

View File

@ -1,7 +1,7 @@
// RUN: %clangxx_asan -O0 %s -o %t && ASAN_OPTIONS=strict_memcmp=0 %t
// RUN: %clangxx_asan -O0 %s -o %t && ASAN_OPTIONS=strict_memcmp=1 not %t 2>&1 | FileCheck %s
// 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
// Default to strict_memcmp=1.
// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
#include <stdio.h>
#include <string.h>

View File

@ -1,7 +1,7 @@
// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
// 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
// REQUIRES: compiler-rt-optimized

View File

@ -1,33 +1,33 @@
// Test that large memset/memcpy/memmove check the entire range.
// RUN: %clangxx_asan -O0 -DTEST_MEMSET %s -o %t && not %t 2>&1 | \
// RUN: %clangxx_asan -O0 -DTEST_MEMSET %s -o %t && not %run %t 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-MEMSET
// RUN: %clangxx_asan -O1 -DTEST_MEMSET %s -o %t && not %t 2>&1 | \
// RUN: %clangxx_asan -O1 -DTEST_MEMSET %s -o %t && not %run %t 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-MEMSET
// RUN: %clangxx_asan -O2 -DTEST_MEMSET %s -o %t && not %t 2>&1 | \
// RUN: %clangxx_asan -O2 -DTEST_MEMSET %s -o %t && not %run %t 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-MEMSET
// RUN: %clangxx_asan -O3 -DTEST_MEMSET %s -o %t && not %t 2>&1 | \
// RUN: %clangxx_asan -O3 -DTEST_MEMSET %s -o %t && not %run %t 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-MEMSET
// RUN: %clangxx_asan -O0 -DTEST_MEMCPY %s -o %t && not %t 2>&1 | \
// RUN: %clangxx_asan -O0 -DTEST_MEMCPY %s -o %t && not %run %t 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-MEMCPY
// RUN: %clangxx_asan -O1 -DTEST_MEMCPY %s -o %t && not %t 2>&1 | \
// RUN: %clangxx_asan -O1 -DTEST_MEMCPY %s -o %t && not %run %t 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-MEMCPY
// RUN: %clangxx_asan -O2 -DTEST_MEMCPY %s -o %t && not %t 2>&1 | \
// RUN: %clangxx_asan -O2 -DTEST_MEMCPY %s -o %t && not %run %t 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-MEMCPY
// RUN: %clangxx_asan -O3 -DTEST_MEMCPY %s -o %t && not %t 2>&1 | \
// RUN: %clangxx_asan -O3 -DTEST_MEMCPY %s -o %t && not %run %t 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-MEMCPY
// RUN: %clangxx_asan -O0 -DTEST_MEMMOVE %s -o %t && not %t 2>&1 | \
// RUN: %clangxx_asan -O0 -DTEST_MEMMOVE %s -o %t && not %run %t 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-MEMMOVE
// RUN: %clangxx_asan -O1 -DTEST_MEMMOVE %s -o %t && not %t 2>&1 | \
// RUN: %clangxx_asan -O1 -DTEST_MEMMOVE %s -o %t && not %run %t 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-MEMMOVE
// RUN: %clangxx_asan -O2 -DTEST_MEMMOVE %s -o %t && not %t 2>&1 | \
// RUN: %clangxx_asan -O2 -DTEST_MEMMOVE %s -o %t && not %run %t 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-MEMMOVE
// RUN: %clangxx_asan -O3 -DTEST_MEMMOVE %s -o %t && not %t 2>&1 | \
// RUN: %clangxx_asan -O3 -DTEST_MEMMOVE %s -o %t && not %run %t 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-MEMMOVE
// RUN: %clangxx_asan -O2 -DTEST_MEMCPY_SIZE_OVERFLOW %s -o %t && not %t 2>&1 | \
// RUN: %clangxx_asan -O2 -DTEST_MEMCPY_SIZE_OVERFLOW %s -o %t && not %run %t 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-MEMCPY_SIZE_OVERFLOW
#include <assert.h>

View File

@ -1,12 +1,12 @@
// Test the mmap_limit_mb flag.
//
// RUN: %clangxx_asan -O2 %s -o %t
// RUN: %t 100 16
// RUN: %t 100 1000000
// RUN: ASAN_OPTIONS=mmap_limit_mb=500 %t 50 16
// RUN: ASAN_OPTIONS=mmap_limit_mb=500 %t 50 1000000
// RUN: ASAN_OPTIONS=mmap_limit_mb=500 not %t 500 16 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=mmap_limit_mb=500 not %t 500 1000000 2>&1 | FileCheck %s
// 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
#include <assert.h>
#include <stdlib.h>

View File

@ -1,7 +1,7 @@
// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
__attribute__((noinline))
static void NullDeref(int *ptr) {

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
#include <stdio.h>
#include <stdlib.h>

View File

@ -1,7 +1,7 @@
// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
// 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
#include <stdlib.h>
int main(int argc, char **argv) {

View File

@ -1,8 +1,8 @@
// RUN: %clangxx_asan -O0 %s -o %t
// RUN: not %t 2>&1 | FileCheck %s
// RUN: not %t heap 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=poison_partial=0 %t
// RUN: ASAN_OPTIONS=poison_partial=0 %t heap
// 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
#include <string.h>
char g[21];
char *x;

View File

@ -1,5 +1,5 @@
// RUN: %clangxx_asan -O0 %s -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && %run %t 2>&1 | FileCheck %s
#include <sanitizer/asan_interface.h>

View File

@ -1,6 +1,6 @@
// RUN: %clangxx_asan -O0 %s -o %t
// RUN: not %t 2>&1 | FileCheck %s --check-prefix=YES
// RUN: ASAN_OPTIONS=print_summary=false not %t 2>&1 | FileCheck %s --check-prefix=NO
// 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
int main() {
char *x = new char[20];

View File

@ -1,7 +1,7 @@
// RUN: %clang_asan -O2 %s -o %t
// RUN: ASAN_OPTIONS=check_printf=1 %t 2>&1 | FileCheck %s
// RUN: ASAN_OPTIONS=check_printf=0 %t 2>&1 | FileCheck %s
// RUN: %t 2>&1 | FileCheck %s
// 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: %run %t 2>&1 | FileCheck %s
#include <stdio.h>
int main() {

View File

@ -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 %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// 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
#include <stdio.h>
#include <stdlib.h>

View File

@ -1,7 +1,7 @@
// RUN: %clang_asan -O2 %s -o %t
// RUN: ASAN_OPTIONS=check_printf=1 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: ASAN_OPTIONS=check_printf=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
// RUN: not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// 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: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
#include <stdio.h>
int main() {

View File

@ -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 puts().
// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=1 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// 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
#include <stdio.h>
int main() {

View File

@ -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 %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: ASAN_OPTIONS=replace_intrin=0:check_printf=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
// RUN: ASAN_OPTIONS=replace_intrin=0 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// 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
#include <stdio.h>
#include <string.h>

View File

@ -1,5 +1,5 @@
// RUN: %clangxx_asan -O0 %s -o %t && %t
// RUN: %clangxx_asan -O0 %s -DPOSITIVE -o %t && not %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O0 %s -o %t && %run %t
// RUN: %clangxx_asan -O0 %s -DPOSITIVE -o %t && not %run %t 2>&1 | FileCheck %s
// Test the readv() interceptor.

View File

@ -1,10 +1,10 @@
// Sanity checking a test in pure C.
// RUN: %clang_asan -O2 %s -o %t
// RUN: not %t 2>&1 | FileCheck %s
// RUN: not %run %t 2>&1 | FileCheck %s
// Sanity checking a test in pure C with -pie.
// RUN: %clang_asan -O2 %s -pie -fPIE -o %t
// RUN: not %t 2>&1 | FileCheck %s
// RUN: not %run %t 2>&1 | FileCheck %s
#include <stdlib.h>
int main() {

Some files were not shown because too many files have changed in this diff Show More