Hi,

I have here a possible way to make the enum_9.f90 and the enum_10.f90 work under arm*-*-freebsd*. The solution for enum_9.f90 is straight forward. But the one for enum_10.f90 requires a reordering of the dg-additional-sources line. This I do not understand yet, but maybe one of you does.

If I have the original ordering and change the dg-options to check on 'target arm_eabi' I get strange compilation errors:

---
/build/gcc/obj_gcc_armv6/gcc/testsuite/gfortran/../../gfortran -B/build/gcc/obj_gcc_armv6/gcc/testsuite/gfortran/../../ -B/build/gcc/obj_gcc_armv6/armv6-unknown-freebsd11.0/./libgfortran/ -fno-diagnostics-show-caret -fdiagnostics-color=never ./enum_10.c -c -o arm_eabi89728.o arm_eabi89728.c^M gfortran: fatal error: cannot specify -o with -c, -S or -E with multiple files^M
compilation terminated.^M
---

The -c comes after the enum_10.c ....

Attached the solution which makes the tests pass. I tested them under FreeBSD armv6-*-freebsd11.0 and x86_64-unknown-freebsd11.0. Also under x86_64-unknown-linux-gnu. All PASS.

Would this be ok for trunk?

TIA,
Andreas

2015-01-11  Andreas Tobler  <andre...@gcc.gnu.org>

        * gfortran.dg/enum_9.f90: Replace arm*-*-linux* with arm_eabi.
        * gfortran.dg/enum_10.f90: Likewise. Reorder dg-additional-sources.
Index: gcc/testsuite/gfortran.dg/enum_9.f90
===================================================================
--- gcc/testsuite/gfortran.dg/enum_9.f90        (revision 219412)
+++ gcc/testsuite/gfortran.dg/enum_9.f90        (working copy)
@@ -1,6 +1,6 @@
 ! { dg-do run }
 ! { dg-options "-fshort-enums" }
-! { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target 
arm*-*-linux* } }
+! { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm_eabi } }
 ! Program to test enumerations when option -fshort-enums is given
 
 program main
Index: gcc/testsuite/gfortran.dg/enum_10.f90
===================================================================
--- gcc/testsuite/gfortran.dg/enum_10.f90       (revision 219412)
+++ gcc/testsuite/gfortran.dg/enum_10.f90       (working copy)
@@ -1,7 +1,7 @@
 ! { dg-do run }
+! { dg-options "-fshort-enums -w" }
+! { dg-options "-fshort-enums -w -Wl,--no-enum-size-warning" { target arm_eabi 
} }
 ! { dg-additional-sources enum_10.c }
-! { dg-options "-fshort-enums -w" }
-! { dg-options "-fshort-enums -w -Wl,--no-enum-size-warning" { target 
arm*-*-linux* } }
 ! Make sure short enums are indeed interoperable with the
 ! corresponding C type.
 

Reply via email to