[PATCH, rs6000] pr65479 Add option to fix failing asan test cases.

This patch adds the -fasynchronous-unwind-tables option to several of the asan
test cases.  The option causes a full strack trace to be produced when the
sanitizer detects an error.  Without the full trace the 3 test cases fail.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65479 for more information.

Bootstrapped and tested on powerpc64le-unknown-linux-gnu,
powerpc64be-unknown-linux-gnu, and x86_64-pc-linux-gnu with no regressions.
Is this ok for trunk?

[gcc/testsuite]

2016-10-14  Bill Seurer  <seu...@linux.vnet.ibm.com>

c-c++-common/asan/misalign-1.c: Add option for powerpc.
c-c++-common/asan/misalign-2.c: Add option for powerpc.
c-c++-common/asan/null-deref-1.c: Add option for powerpc.

Index: gcc/testsuite/c-c++-common/asan/misalign-1.c
===================================================================
--- gcc/testsuite/c-c++-common/asan/misalign-1.c        (revision 241174)
+++ gcc/testsuite/c-c++-common/asan/misalign-1.c        (working copy)
@@ -1,6 +1,7 @@
 /* { dg-do run { target { ilp32 || lp64 } } } */
 /* { dg-options "-O2" } */
 /* { dg-additional-options "-fno-omit-frame-pointer" { target *-*-darwin* } } 
*/
+/* { dg-additional-options "-fasynchronous-unwind-tables" { target { 
powerpc*-*-linux* } } } */
 /* { dg-shouldfail "asan" } */
 
 struct S { int i; } __attribute__ ((packed));
@@ -39,5 +40,5 @@ main ()
 /* { dg-output "ERROR: AddressSanitizer:\[^\n\r]*on address\[^\n\r]*" } */
 /* { dg-output "0x\[0-9a-f\]+ at pc 0x\[0-9a-f\]+ bp 0x\[0-9a-f\]+ sp 
0x\[0-9a-f\]+\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*READ of size 4 at 0x\[0-9a-f\]+ thread 
T0\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "    #0 0x\[0-9a-f\]+ +(in 
_*foo(\[^\n\r]*misalign-1.c:1\[01]|\[^\n\r]*:0)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } 
*/
-/* { dg-output "    #1 0x\[0-9a-f\]+ +(in _*main 
(\[^\n\r]*misalign-1.c:3\[45]|\[^\n\r]*:0)|\[(\]).*(\n|\r\n|\r)" } */
+/* { dg-output "    #0 0x\[0-9a-f\]+ +(in 
_*foo(\[^\n\r]*misalign-1.c:1\[12]|\[^\n\r]*:0)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } 
*/
+/* { dg-output "    #1 0x\[0-9a-f\]+ +(in _*main 
(\[^\n\r]*misalign-1.c:3\[56]|\[^\n\r]*:0)|\[(\]).*(\n|\r\n|\r)" } */
Index: gcc/testsuite/c-c++-common/asan/misalign-2.c
===================================================================
--- gcc/testsuite/c-c++-common/asan/misalign-2.c        (revision 241174)
+++ gcc/testsuite/c-c++-common/asan/misalign-2.c        (working copy)
@@ -1,6 +1,7 @@
 /* { dg-do run { target { ilp32 || lp64 } } } */
 /* { dg-options "-O2" } */
 /* { dg-additional-options "-fno-omit-frame-pointer" { target *-*-darwin* } } 
*/
+/* { dg-additional-options "-fasynchronous-unwind-tables" { target { 
powerpc*-*-linux* } } } */
 /* { dg-shouldfail "asan" } */
 
 struct S { int i; } __attribute__ ((packed));
@@ -39,5 +40,5 @@ main ()
 /* { dg-output "ERROR: AddressSanitizer:\[^\n\r]*on address\[^\n\r]*" } */
 /* { dg-output "0x\[0-9a-f\]+ at pc 0x\[0-9a-f\]+ bp 0x\[0-9a-f\]+ sp 
0x\[0-9a-f\]+\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*READ of size 4 at 0x\[0-9a-f\]+ thread 
T0\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "    #0 0x\[0-9a-f\]+ +(in 
_*baz(\[^\n\r]*misalign-2.c:2\[23]|\[^\n\r]*:0)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } 
*/
-/* { dg-output "    #1 0x\[0-9a-f\]+ +(in _*main 
(\[^\n\r]*misalign-2.c:3\[45]|\[^\n\r]*:0)|\[(\]).*(\n|\r\n|\r)" } */
+/* { dg-output "    #0 0x\[0-9a-f\]+ +(in 
_*baz(\[^\n\r]*misalign-2.c:2\[34]|\[^\n\r]*:0)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } 
*/
+/* { dg-output "    #1 0x\[0-9a-f\]+ +(in _*main 
(\[^\n\r]*misalign-2.c:3\[56]|\[^\n\r]*:0)|\[(\]).*(\n|\r\n|\r)" } */
Index: gcc/testsuite/c-c++-common/asan/null-deref-1.c
===================================================================
--- gcc/testsuite/c-c++-common/asan/null-deref-1.c      (revision 241174)
+++ gcc/testsuite/c-c++-common/asan/null-deref-1.c      (working copy)
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-fno-omit-frame-pointer -fno-shrink-wrap" } */
 /* { dg-additional-options "-mno-omit-leaf-frame-pointer" { target { i?86-*-* 
x86_64-*-* } } } */
+/* { dg-additional-options "-fasynchronous-unwind-tables" { target { 
powerpc*-*-linux* } } } */
 /* { dg-shouldfail "asan" } */
 
 __attribute__((noinline, noclone))
@@ -18,5 +19,5 @@ int main()
 
 /* { dg-output "ERROR: AddressSanitizer:? SEGV on unknown address\[^\n\r]*" } 
*/
 /* { dg-output "0x\[0-9a-f\]+ \[^\n\r]*pc 0x\[0-9a-f\]+\[^\n\r]*(\n|\r\n|\r)" 
} */
-/* { dg-output "\[^\n\r]*    #0 0x\[0-9a-f\]+ +(in \[^\n\r]*NullDeref\[^\n\r]* 
(\[^\n\r]*null-deref-1.c:10|\[^\n\r]*:0)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "    #1 0x\[0-9a-f\]+ +(in _*main 
(\[^\n\r]*null-deref-1.c:15|\[^\n\r]*:0)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
+/* { dg-output "\[^\n\r]*    #0 0x\[0-9a-f\]+ +(in \[^\n\r]*NullDeref\[^\n\r]* 
(\[^\n\r]*null-deref-1.c:11|\[^\n\r]*:0)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
+/* { dg-output "    #1 0x\[0-9a-f\]+ +(in _*main 
(\[^\n\r]*null-deref-1.c:16|\[^\n\r]*:0)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */

-- 

-Bill Seurer

Reply via email to