[PATCH resend] testsuite: avoid no-stack-protector-attr-3 fail on mips*-*-*

Xi Ruoyao xry111@mengyan1223.wang
Tue Jun 22 09:44:57 GMT 2021


[Resend because the original subject missed "[PATCH]" and the path in
ChangeLog is wrong.]

On MIPS a call to __stack_chk_fail needs an additional .reloc pseudo-op,
so "stack_chk_fail" will appear two times.

gcc/testsuite/

	* g++.dg/no-stack-protector-attr-3.C (dg-final): Adjust for
	  MIPS.
---
 gcc/testsuite/g++.dg/no-stack-protector-attr-3.C | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.dg/no-stack-protector-attr-3.C b/gcc/testsuite/g++.dg/no-stack-protector-attr-3.C
index 56a4e74da50..76a5ec08681 100644
--- a/gcc/testsuite/g++.dg/no-stack-protector-attr-3.C
+++ b/gcc/testsuite/g++.dg/no-stack-protector-attr-3.C
@@ -20,4 +20,5 @@ int __attribute__((stack_protect)) bar()
   return 0;
 }
 
-/* { dg-final { scan-assembler-times "stack_chk_fail" 1 } } */
+/* { dg-final { scan-assembler-times "stack_chk_fail" 1 { target { ! mips*-*-* } } } }*/
+/* { dg-final { scan-assembler-times "stack_chk_fail" 2 { target { mips*-*-* } } } }*/
-- 
2.32.0





More information about the Gcc-patches mailing list