From 3a11caae4f6750da83cba8f501fa43f61103ccfe Mon Sep 17 00:00:00 2001 From: Maxim Ostapenko Date: Thu, 24 Mar 2016 15:12:35 +0300 Subject: Fix c-c++-common/asan/pr64820.c testcase to pass output pattern tests under qemu-aarch64. Adjust halt_on_error tests. gcc/testsuite/ * c-c++-common/asan/pr64820.c: Adjust output patterns. * c-c++-common/asan/halt_on_error-1.c: Adjust. * c-c++-common/asan/halt_on_error-1.c: Likewise. Change-Id: Ic7be1b413b6761d4a89c4a6aa428b2255c7608e8 Signed-off-by: Maxim Ostapenko --- gcc/testsuite/c-c++-common/asan/halt_on_error-1.c | 9 ++++++++- gcc/testsuite/c-c++-common/asan/halt_on_error-2.c | 9 ++++++++- gcc/testsuite/c-c++-common/asan/pr64820.c | 4 ++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/c-c++-common/asan/halt_on_error-1.c b/gcc/testsuite/c-c++-common/asan/halt_on_error-1.c index b015e9684bf..f0cfea3f7be 100644 --- a/gcc/testsuite/c-c++-common/asan/halt_on_error-1.c +++ b/gcc/testsuite/c-c++-common/asan/halt_on_error-1.c @@ -1,10 +1,17 @@ /* Test recovery mode. */ /* { dg-do run } */ /* { dg-options "-fsanitize-recover=address" } */ -/* { dg-set-target-env-var ASAN_OPTIONS "halt_on_error=false" } */ #include +#ifdef __cplusplus +extern "C" +#endif +const char * +__asan_default_options () { + return "halt_on_error=false"; +} + volatile int ten = 10; int main() { diff --git a/gcc/testsuite/c-c++-common/asan/halt_on_error-2.c b/gcc/testsuite/c-c++-common/asan/halt_on_error-2.c index 4527889af14..28f4456a60a 100644 --- a/gcc/testsuite/c-c++-common/asan/halt_on_error-2.c +++ b/gcc/testsuite/c-c++-common/asan/halt_on_error-2.c @@ -1,11 +1,18 @@ /* Test recovery mode. */ /* { dg-do run } */ /* { dg-options "-fsanitize-recover=address" } */ -/* { dg-set-target-env-var ASAN_OPTIONS "halt_on_error=true" } */ /* { dg-shouldfail "asan" } */ #include +#ifdef __cplusplus +extern "C" +#endif +const char * +__asan_default_options () { + return "halt_on_error=true"; +} + volatile int ten = 10; int main() { diff --git a/gcc/testsuite/c-c++-common/asan/pr64820.c b/gcc/testsuite/c-c++-common/asan/pr64820.c index 583ca0a60b6..69639407e0b 100644 --- a/gcc/testsuite/c-c++-common/asan/pr64820.c +++ b/gcc/testsuite/c-c++-common/asan/pr64820.c @@ -33,7 +33,7 @@ int main(int argc, char **argv) { } /* { dg-output "AddressSanitizer: stack-use-after-return on address 0x\[0-9a-f\]+\[^\n\r]*(\n|\r\n|\r)" } */ -/* { dg-output "WRITE of size 1 at .* thread T0.*" } */ +/* { dg-output "\[^\n\r]*WRITE of size 1 at .* thread T0.*" } */ /* { dg-output " #0.*(Func2)?.*pr64820.(c:28)?.*" } */ /* { dg-output "is located in stack of thread T0 at offset.*" } */ -/* { dg-output "\'local\' <== Memory access at offset 32 is inside this variable" } */ +/* { dg-output "\'local\'\[^\n\r]*<== Memory access at offset 32 is inside this variable" } */ -- cgit v1.2.3