This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Ada] fix bug in deferred constant
Hi Arnaud,
> > In gfortran.dg, we use the dg-additional-sources directive to compile
> > multiple source files for one test (we use it to have mixed C-Fortran
> > testcases). As far as I can see, it has been there since 2003-06-05.
> > See dg-additional-sources, dg-additional-files and
> > dg-additional-files-options in gcc/testsuite/lib/gcc-defs.exp for
> > details. Would it suit your purpose?
>
> Possibly. Could someone show what one of the Ada test cases I posted
> would look like using these options ? I'm not familiar enough with
> dejagnu to be of much help here, but if there's a simple way to do
> what we need, I'll be happy to follow it.
I'm using the following approach: place extra stuff in a new
subdirectory "extra" (this requires a patch to dg.exp). See
the example below:
Index: dg.exp
===================================================================
--- dg.exp (revision 119689)
+++ dg.exp (working copy)
@@ -25,6 +25,9 @@
set DEFAULT_CFLAGS ""
}
+global TOOL_OPTIONS
+set TOOL_OPTIONS "-I$srcdir/$subdir/extra"
+
# Initialize `dg'.
dg-init
Index: e221_004.adb
===================================================================
--- e221_004.adb (revision 0)
+++ e221_004.adb (revision 0)
@@ -0,0 +1,12 @@
+-- Compiler hung.
+
+-- { dg-do compile }
+-- { dg-options "-gnatN -O2" }
+
+with E221_004_F;
+
+procedure E221_004 is
+ B : Boolean;
+begin
+ B := E221_004_F.C;
+end;
Index: extra/e221_004_f.adb
===================================================================
--- extra/e221_004_f.adb (revision 0)
+++ extra/e221_004_f.adb (revision 0)
@@ -0,0 +1,8 @@
+package body E221_004_F is
+
+ function C return Boolean is
+ begin
+ return C; -- { dg-warning "possible infinite recursion" }
+ end C;
+
+end E221_004_F;
Index: extra/e221_004_f.ads
===================================================================
--- extra/e221_004_f.ads (revision 0)
+++ extra/e221_004_f.ads (revision 0)
@@ -0,0 +1,6 @@
+package E221_004_F is
+
+ function C return Boolean;
+ pragma Inline (C);
+
+end E221_004_F;