aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2025-09-08 07:47:35 -0700
committerH.J. Lu <hjl.tools@gmail.com>2025-09-11 06:40:47 -0700
commit46028a2f40329bbc6a7d7638b5bab6b3bb282009 (patch)
treedcecd8238328c9045a761198f7463fbc7cc8a24d
parentd99c6786c3ea083cdc70fa012674db58cc91079f (diff)
downloadgcc-46028a2f40329bbc6a7d7638b5bab6b3bb282009.zip
gcc-46028a2f40329bbc6a7d7638b5bab6b3bb282009.tar.gz
gcc-46028a2f40329bbc6a7d7638b5bab6b3bb282009.tar.bz2
pr107421.f90: Require PIE and pass -fPIE for non-x86 targets
-mno-direct-extern-access is used to disable direct access to external symbol from executable with and without PIE for x86. Require PIE and pass -fPIE to disable direct access to external symbol for other targets. PR fortran/107421 PR testsuite/121848 * gfortran.dg/gomp/pr107421.f90: Require PIE and pass -fPIE for non-x86 targets. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr107421.f904
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr107421.f90 b/gcc/testsuite/gfortran.dg/gomp/pr107421.f90
index db98dce..a524db5 100644
--- a/gcc/testsuite/gfortran.dg/gomp/pr107421.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/pr107421.f90
@@ -1,4 +1,8 @@
+! { dg-require-effective-target pie }
! { dg-additional-options "-fdump-ipa-whole-program" }
+! Add -fPIE or -mno-direct-extern-access to disable direct access to
+! external symbol from executable.
+! { dg-additional-options "-fPIE" { target { ! { i?86-*-* x86_64-*-* } } } }
! { dg-additional-options "-mno-direct-extern-access" { target { i?86-*-* x86_64-*-* } } }
integer :: i