diff --git a/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cpp b/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cpp --- a/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cpp +++ b/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cpp @@ -1,18 +1,18 @@ // Test ASan detection of stack-overflow condition. -// RUN: %clangxx_asan -O0 %s -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O3 %s -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O0 %s -DSAVE_ALL_THE_REGISTERS -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O3 %s -DSAVE_ALL_THE_REGISTERS -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O0 %s -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O3 %s -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 %s -fsanitize-address-use-after-return=never -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 %s -fsanitize-address-use-after-return=never -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 %s -fsanitize-address-use-after-return=never -DSAVE_ALL_THE_REGISTERS -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 %s -fsanitize-address-use-after-return=never -DSAVE_ALL_THE_REGISTERS -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 %s -fsanitize-address-use-after-return=never -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 %s -fsanitize-address-use-after-return=never -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O0 %s -DTHREAD -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O3 %s -DTHREAD -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O0 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O3 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O0 %s -DTHREAD -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O3 %s -DTHREAD -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 %s -fsanitize-address-use-after-return=never -DTHREAD -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 %s -fsanitize-address-use-after-return=never -DTHREAD -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 %s -fsanitize-address-use-after-return=never -DTHREAD -DSAVE_ALL_THE_REGISTERS -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 %s -fsanitize-address-use-after-return=never -DTHREAD -DSAVE_ALL_THE_REGISTERS -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 %s -fsanitize-address-use-after-return=never -DTHREAD -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 %s -fsanitize-address-use-after-return=never -DTHREAD -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s // RUN: not %run %t 2>&1 | FileCheck %s // REQUIRES: stable-runtime @@ -69,7 +69,7 @@ #else char buf[BS]; // Check that the stack grows in the righ direction, unless we use fake stack. - if (p && !__asan_get_current_fake_stack()) + if (p) assert(p - buf >= BS); buf[rand() % BS] = 1; buf[rand() % BS] = 2; diff --git a/compiler-rt/test/asan/TestCases/contiguous_container.cpp b/compiler-rt/test/asan/TestCases/contiguous_container.cpp --- a/compiler-rt/test/asan/TestCases/contiguous_container.cpp +++ b/compiler-rt/test/asan/TestCases/contiguous_container.cpp @@ -65,11 +65,7 @@ assert(__asan_address_is_poisoned(x + 14)); ThrowAndCatch(); assert(!__asan_address_is_poisoned(x + 13)); - // FIXME: invert the assertion below once we fix - // https://code.google.com/p/address-sanitizer/issues/detail?id=258 - // This assertion works only w/o UAR. - if (!__asan_get_current_fake_stack()) - assert(!__asan_address_is_poisoned(x + 14)); + assert(!__asan_address_is_poisoned(x + 14)); __sanitizer_annotate_contiguous_container(x, x + 32, x + 14, x + 32); assert(!__asan_address_is_poisoned(x + 13)); assert(!__asan_address_is_poisoned(x + 14)); diff --git a/compiler-rt/test/asan/TestCases/longjmp.cpp b/compiler-rt/test/asan/TestCases/longjmp.cpp --- a/compiler-rt/test/asan/TestCases/longjmp.cpp +++ b/compiler-rt/test/asan/TestCases/longjmp.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx_asan -O %s -o %t && %run %t +// RUN: %clangxx_asan -fsanitize-address-use-after-return=never -O %s -o %t && %run %t #include #include @@ -17,9 +17,5 @@ longjmp(buf, 1); fprintf(stderr, "After: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); - // FIXME: Invert this assertion once we fix - // https://code.google.com/p/address-sanitizer/issues/detail?id=258 - // This assertion works only w/o UAR. - if (!__asan_get_current_fake_stack()) - assert(!__asan_address_is_poisoned(x + 32)); + assert(!__asan_address_is_poisoned(x + 32)); } diff --git a/compiler-rt/test/asan/TestCases/throw_catch.cpp b/compiler-rt/test/asan/TestCases/throw_catch.cpp --- a/compiler-rt/test/asan/TestCases/throw_catch.cpp +++ b/compiler-rt/test/asan/TestCases/throw_catch.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx_asan -O %s -o %t && %run %t +// RUN: %clangxx_asan -fsanitize-address-use-after-return=never -O %s -o %t && %run %t #include #include @@ -30,11 +30,7 @@ ThrowAndCatch(); fprintf(stderr, "After: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); - // FIXME: Invert this assertion once we fix - // https://code.google.com/p/address-sanitizer/issues/detail?id=258 - // This assertion works only w/o UAR. - if (!__asan_get_current_fake_stack()) - assert(!__asan_address_is_poisoned(x + 32)); + assert(!__asan_address_is_poisoned(x + 32)); } __attribute__((noinline)) @@ -50,11 +46,7 @@ } fprintf(stderr, "After: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); - // FIXME: Invert this assertion once we fix - // https://code.google.com/p/address-sanitizer/issues/detail?id=258 - // This assertion works only w/o UAR. - if (!__asan_get_current_fake_stack()) - assert(!__asan_address_is_poisoned(x + 32)); + assert(!__asan_address_is_poisoned(x + 32)); } int main(int argc, char **argv) {