Hi!

These 3 tests use compiler_version() and/or compiler_options() functions,
which are inherently incompatible with -fcompare-debug compilation, as they
emit into a string literal in the assembly the exact f951 command line
options, which differs between the two compilations with -fcompare-debug,
where one has -gtoggle and -fcompare-debug-second options added and
different -fdump-final-insns= option argument.

The following patch adds dg-skip-if directives, so that these tests are
ignored during
make check-gfortran RUNTESTFLAGS='--target_board=unix/-fcompare-debug'

Tested on x86_64-linux without (where the 3 tests FAIL) and with the patch, ok 
for
trunk?

2020-03-25  Jakub Jelinek  <ja...@redhat.com>

        PR debug/94280
        * gfortran.dg/iso_c_binding_compiler_1.f90: Add dg-skip-if for
        -fcompare-debug.
        * gfortran.dg/iso_c_binding_compiler_3.f90: Likewise.
        * gfortran.dg/unlimited_polymorphic_31.f03: Likewise.

--- gcc/testsuite/gfortran.dg/iso_c_binding_compiler_1.f90.jj   2020-01-12 
11:54:38.260385543 +0100
+++ gcc/testsuite/gfortran.dg/iso_c_binding_compiler_1.f90      2020-03-25 
10:11:25.175595427 +0100
@@ -1,4 +1,7 @@
 ! { dg-do link }
+! The compiler_version() or compiler_options() functions are dependent on the
+! command line options and thus incompatible with -fcompare-debug.
+! { dg-skip-if "-fcompare-debug incompatible test" { *-*-* } { 
"-fcompare-debug" } { "" } } */
 !
 ! PR fortran/40569
 !
--- gcc/testsuite/gfortran.dg/iso_c_binding_compiler_3.f90.jj   2020-01-12 
11:54:38.260385543 +0100
+++ gcc/testsuite/gfortran.dg/iso_c_binding_compiler_3.f90      2020-03-25 
10:11:42.208336885 +0100
@@ -1,5 +1,8 @@
 ! { dg-do compile }
 ! { dg-options "-Wall" }
+! The compiler_version() or compiler_options() functions are dependent on the
+! command line options and thus incompatible with -fcompare-debug.
+! { dg-skip-if "-fcompare-debug incompatible test" { *-*-* } { 
"-fcompare-debug" } { "" } } */
 !
 ! PR fortran/45823
 !
--- gcc/testsuite/gfortran.dg/unlimited_polymorphic_31.f03.jj   2020-03-02 
13:33:10.969494283 +0100
+++ gcc/testsuite/gfortran.dg/unlimited_polymorphic_31.f03      2020-03-25 
10:12:08.222942008 +0100
@@ -1,4 +1,7 @@
 ! { dg-do run }
+! The compiler_version() or compiler_options() functions are dependent on the
+! command line options and thus incompatible with -fcompare-debug.
+! { dg-skip-if "-fcompare-debug incompatible test" { *-*-* } { 
"-fcompare-debug" } { "" } } */
 !
 ! Test the fix for PR92785, where the array passed to 'write scalar' was not
 ! normalised to LBOUND = 1.

        Jakub

Reply via email to