From 5057ee07ccc918a32b9c36855a8c1f74e0b39b04 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Thu, 9 Nov 2023 00:01:32 -0300 Subject: [PATCH] testsuite: force PIC/PIE off for pr58245-1.C This test expects a single mention of stack_chk_fail, as part of a call sequence, but when e.g. PIE is enabled by default, we output .hidden stack_chk_fail_local, which makes for a count mismatch. Disable PIC/PIE so as to not depend on the configurable default. for gcc/testsuite/ChangeLog * g++.dg/pr58245-1.C: Disable PIC/PIE. --- gcc/testsuite/g++.dg/pr58245-1.C | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/testsuite/g++.dg/pr58245-1.C b/gcc/testsuite/g++.dg/pr58245-1.C index 1439bc62e710..71d4736ddf61 100644 --- a/gcc/testsuite/g++.dg/pr58245-1.C +++ b/gcc/testsuite/g++.dg/pr58245-1.C @@ -8,3 +8,7 @@ bar (void) } /* { dg-final { scan-assembler-times "stack_chk_fail" 1 } } */ + +/* When compiling for PI[EC], we issue a .hidden stack_chk_fail_local, + that causes the above to fail the expected match count. */ +/* { dg-additional-options "-fno-PIC" } */ -- 2.47.2