Fix c-c++-common/asan/pr64820.c testcase to pass output pattern tests under
authorIvan Baravy <i.baravy@samsung.com>
Mon, 27 Feb 2017 07:42:49 +0000 (10:42 +0300)
committerIvan Baravy <i.baravy@samsung.com>
Mon, 27 Feb 2017 07:42:49 +0000 (10:42 +0300)
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.

gcc/testsuite/c-c++-common/asan/halt_on_error-1.c
gcc/testsuite/c-c++-common/asan/halt_on_error-2.c
gcc/testsuite/c-c++-common/asan/pr64820.c

index 52e705d..78ec5e3 100644 (file)
@@ -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 <string.h>
 
+#ifdef __cplusplus
+extern "C"
+#endif
+const char *
+__asan_default_options () {
+  return "halt_on_error=false";
+}
+
 volatile int ten = 10;
 
 int main() {
index 35dc0fa..14e49fc 100644 (file)
@@ -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 <string.h>
 
+#ifdef __cplusplus
+extern "C"
+#endif
+const char *
+__asan_default_options () {
+  return "halt_on_error=true";
+}
+
 volatile int ten = 10;
 
 int main() {
index 885a662..c42f608 100644 (file)
@@ -25,7 +25,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:21)?.*" } */
 /* { 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" } */