diff options
author | Daniel Kraft <d@domob.eu> | 2008-09-01 15:43:10 +0200 |
---|---|---|
committer | Daniel Kraft <domob@gcc.gnu.org> | 2008-09-01 15:43:10 +0200 |
commit | 3e1e5626dc66aa2bf4a2529b4aa842741d726340 (patch) | |
tree | 0fc3cb984d5be7e10c9ff226b82425a557ec7801 /gcc/testsuite | |
parent | 51c69ddb914f062d93c2180a293c944107fbf999 (diff) | |
download | gcc-3e1e5626dc66aa2bf4a2529b4aa842741d726340.tar.gz |
re PR fortran/37193 ("USE mod, ONLY: i, i=>j" does not import "i")
2008-09-01 Daniel Kraft <d@domob.eu>
PR fortran/37193
* module.c (read_module): Initialize use_only flag on used symbols.
2008-09-01 Daniel Kraft <d@domob.eu>
PR fortran/37193
* gfortran.dg/use_rename_4.f90: New test.
* gfortran.dg/use_rename_5.f90: New test.
From-SVN: r139866
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/use_rename_4.f90 | 22 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/use_rename_5.f90 | 17 |
3 files changed, 45 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 07830c86a4f..44b789a4a85 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-09-01 Daniel Kraft <d@domob.eu> + + PR fortran/37193 + * gfortran.dg/use_rename_4.f90: New test. + * gfortran.dg/use_rename_5.f90: New test. + 2008-09-01 Richard Guenther <rguenther@suse.de> PR tree-optimization/37305 diff --git a/gcc/testsuite/gfortran.dg/use_rename_4.f90 b/gcc/testsuite/gfortran.dg/use_rename_4.f90 new file mode 100644 index 00000000000..e0e83b89181 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/use_rename_4.f90 @@ -0,0 +1,22 @@ +! { dg-do run } + +! PR fortran/37193 +! Check fix for problem with re-using the same symbol both renamed and +! plain. + +MODULE m + IMPLICIT NONE + INTEGER :: i +END MODULE m + +PROGRAM main + USE m, ONLY: i, j => i + IMPLICIT NONE + + i = 4 + j = 5 + + IF (i /= j) THEN + CALL abort () + END IF +END PROGRAM main diff --git a/gcc/testsuite/gfortran.dg/use_rename_5.f90 b/gcc/testsuite/gfortran.dg/use_rename_5.f90 new file mode 100644 index 00000000000..3d7839a0d12 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/use_rename_5.f90 @@ -0,0 +1,17 @@ +! { dg-do compile } + +! PR fortran/37193 +! Check that renamed symbols are not accessiable uner their target name. + +MODULE m + IMPLICIT NONE + INTEGER :: i +END MODULE m + +PROGRAM main + USE m, ONLY: j => i + IMPLICIT NONE + + i = 4 ! { dg-error "no IMPLICIT type" } + j = 5 +END PROGRAM main |