diff options
author | billingd <billingd@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-05 23:42:19 +0000 |
---|---|---|
committer | billingd <billingd@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-05 23:42:19 +0000 |
commit | d947d7565d1e40349b2e433658c7cea706a93c58 (patch) | |
tree | a831050c295ee23f7665e63285c0032152ce78fc /gcc/testsuite | |
parent | 88d7b4c4eba22e002528df1d77abdf85edbaa169 (diff) | |
download | gcc-d947d7565d1e40349b2e433658c7cea706a93c58.tar.gz |
2005-06-05 David Billinghurst <David.Billinghurst@riotinto.com>
* lib/gfortran.exp (gfortran_target_compile): Call
dg-additional-files-options
* gfortran.dg/f2c_4.f90: New file
* gfortran.dg/f2c_4.c: New file
* gfortran.dg/f2c_5.f90: New file
* gfortran.dg/f2c_5.c: New file
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100641 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rwxr-xr-x | gcc/testsuite/gfortran.dg/f2c_4.c | 9 | ||||
-rwxr-xr-x | gcc/testsuite/gfortran.dg/f2c_4.f90 | 14 | ||||
-rwxr-xr-x | gcc/testsuite/gfortran.dg/f2c_5.c | 9 | ||||
-rwxr-xr-x | gcc/testsuite/gfortran.dg/f2c_5.f90 | 12 | ||||
-rw-r--r-- | gcc/testsuite/lib/gfortran.exp | 2 |
5 files changed, 45 insertions, 1 deletions
diff --git a/gcc/testsuite/gfortran.dg/f2c_4.c b/gcc/testsuite/gfortran.dg/f2c_4.c new file mode 100755 index 00000000000..0d64fc89b14 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/f2c_4.c @@ -0,0 +1,9 @@ +extern double f2c_4b__(double *); +extern void abort (void); + +void f2c_4a__(void) { + double a,b; + a = 1023.0; + b=f2c_4b__(&a); + if ( a != b ) abort(); +} diff --git a/gcc/testsuite/gfortran.dg/f2c_4.f90 b/gcc/testsuite/gfortran.dg/f2c_4.f90 new file mode 100755 index 00000000000..a03b4f8b593 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/f2c_4.f90 @@ -0,0 +1,14 @@ +! { dg-do run } +! { dg-additional-sources f2c_4.c } +! { dg-options "-ff2c -w" } + +! Check -ff2c calling conventions +! Return value of REAL function is promoted to C type double +! Addional underscore appended to function name +call f2c_4a() +end + +real function f2c_4b(x) + double precision x + f2c_4b = x +end diff --git a/gcc/testsuite/gfortran.dg/f2c_5.c b/gcc/testsuite/gfortran.dg/f2c_5.c new file mode 100755 index 00000000000..bb57556d011 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/f2c_5.c @@ -0,0 +1,9 @@ +extern float f2c_5b_(double *); +extern void abort (void); + +void f2c_5a_(void) { + double a,b; + a = 1023.0; + b=f2c_5b_(&a); + if ( a != b ) abort(); +} diff --git a/gcc/testsuite/gfortran.dg/f2c_5.f90 b/gcc/testsuite/gfortran.dg/f2c_5.f90 new file mode 100755 index 00000000000..aa246845eb3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/f2c_5.f90 @@ -0,0 +1,12 @@ +! { dg-do run } +! { dg-additional-sources f2c_5.c } +! { dg-options "-fno-f2c" } +! Check calling conventions without -ff2c +program f2c_5 + call f2c_5a() +end + +real function f2c_5b(x) + double precision x + f2c_5b = x +end diff --git a/gcc/testsuite/lib/gfortran.exp b/gcc/testsuite/lib/gfortran.exp index 43a104e1f51..850df4f0f03 100644 --- a/gcc/testsuite/lib/gfortran.exp +++ b/gcc/testsuite/lib/gfortran.exp @@ -188,6 +188,6 @@ proc gfortran_target_compile { source dest type options } { lappend options "compiler=$GFORTRAN_UNDER_TEST" set options [concat "$ALWAYS_GFORTRANFLAGS" $options] - + set options [dg-additional-files-options $options $source] return [target_compile $source $dest $type $options] } |