]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: fortran: Fix gfortran.dg/alloc_comp_deep_copy_5.f90 etc. with non-gas...
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Mon, 1 Dec 2025 13:17:32 +0000 (14:17 +0100)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Mon, 1 Dec 2025 13:17:32 +0000 (14:17 +0100)
The gfortran.dg/alloc_comp_deep_copy_[56].f90 tests FAIL on Solaris:

FAIL: gfortran.dg/alloc_comp_deep_copy_5.f90   -O0  (test for excess errors)
UNRESOLVED: gfortran.dg/alloc_comp_deep_copy_5.f90   -O0  compilation failed to produce executable

and many more when using either or both the native assembler or linker:

Excess errors:
Assembler:
        "", line 1 : Illegal flag (-)

which is due to passing --noexecstack to the assembler.  This is wrong in
general unless GNU as is used.  Likewise, -Wl,-z,noexecstack has the same
issue.

This is *not* a target issue: the tests PASS as-is when using gas/gld on
Solaris (thus the current { target { ! *-*-darwin* } } is wrong, too).
Instead, the gas and gld effective-target keywords should be used to
control whether the flags are used, which is what this patch does.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11,
x86_64-pc-linux-gnu, and x86_64-apple-darwin25.1.0.

2025-11-27  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/testsuite:
PR testsuite/122596
* gfortran.dg/alloc_comp_deep_copy_5.f90: Restrict
-Wa,--noexecstack, -Wl,-z,noexecstack to gas, gld.
* gfortran.dg/alloc_comp_deep_copy_6.f90: Likewise.

gcc/testsuite/gfortran.dg/alloc_comp_deep_copy_5.f90
gcc/testsuite/gfortran.dg/alloc_comp_deep_copy_6.f90

index 7415eedf2a419c2ca83febff3fc5c3578889dc3e..c0b305e47adee2c1ffc4ab254016b945f77dda9c 100644 (file)
@@ -1,6 +1,6 @@
 ! { dg-do run }
-! { dg-additional-options "-Wa,--noexecstack" { target { ! *-*-darwin* } } }
-! { dg-additional-options "-Wl,-z,noexecstack" { target { ! *-*-darwin* } } }
+! { dg-additional-options "-Wa,--noexecstack" { target gas } }
+! { dg-additional-options "-Wl,-z,noexecstack" { target gld } }
 !
 ! PR fortran/121628
 ! Test deep copy of recursive allocatable array components with multi-level
index b243a89a6a3e502e49694e048613b51506177fae..ae20d5fc861ee5108864327cff4e32187cc2a84f 100644 (file)
@@ -1,6 +1,6 @@
 ! { dg-do run }
-! { dg-additional-options "-Wa,--noexecstack" { target { ! *-*-darwin* } } }
-! { dg-additional-options "-Wl,-z,noexecstack" { target { ! *-*-darwin* } } }
+! { dg-additional-options "-Wa,--noexecstack" { target gas } }
+! { dg-additional-options "-Wl,-z,noexecstack" { target gld } }
 !
 ! PR fortran/121628
 ! Test deep copy of recursive allocatable components with both data arrays