diff mbox series

[Darwin,PPC,testsuite,committed] Fix pr71785 testcase for Darwin.

Message ID 951E5807-41A7-45CA-ACD7-47678C510A9E@sandoe.co.uk
State New
Headers show
Series [Darwin,PPC,testsuite,committed] Fix pr71785 testcase for Darwin. | expand

Commit Message

Iain Sandoe June 23, 2019, 7:04 p.m. UTC
The test was failing with false positive for the scan-assembler-not.

Firstly, we adjust the test conditions to use non-PIC code for Darwin.
Secondly, we have to account for out-of-line GPR restores which gives
a false positive on the scan-assembler-not.  Lastly, we make the test a
bit more specific for Darwin - that it looks for absence of branches to
local labels.

Tested on powerpc-darwin9, powerpc-linux-gnu
applied to mainline
thanks,
Iain

2019-06-23  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/powerpc/pr71785.c: For Darwin, make test non-PIC,
	expect the out-of-line GPR restore, and test specifically for
	absence of branches to local labels.
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/pr71785.c b/gcc/testsuite/gcc.target/powerpc/pr71785.c
index 613dcd1..c667ad8 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr71785.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr71785.c
@@ -1,6 +1,11 @@ 
 /* { dg-do compile { target { powerpc*-*-* } } } */
 /* { dg-options "-O2" } */
-/* { dg-final { scan-assembler-not {\mb\M} } } */
+/* We have to lose the default pic codegen on Darwin.  */
+/* { dg-additional-options "-mdynamic-no-pic" { target powerpc*-*-darwin* } } */
+/* ... and account for the out-of-line GPR restore.  */
+/* { dg-final { scan-assembler-times {\mb[ \t]*restGPR} 1 { target powerpc*-*-darwin* } } } */
+/* { dg-final { scan-assembler-not {\mb[ \t]L} { target powerpc*-*-darwin* } } } */
+/* { dg-final { scan-assembler-not {\mb\M} { target { ! powerpc*-*-darwin* } } } } */
 
 /* Check that all computed gotos in this testcase end up unfactored completely.
    If some is not there will be a unconditional jump left; if all works fine,