diff options
author | Tobias Schlüter <tobi@gcc.gnu.org> | 2006-02-10 01:10:47 +0100 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2006-02-10 01:10:47 +0100 |
commit | 2414e1d655249938cc53becd63d8fb95db65bbfe (patch) | |
tree | a5d5c040eb2490c1c8811341728f943405f6d7df /gcc/testsuite/gfortran.dg | |
parent | a286e145de1b08b1a73d4efe03d36375fa698273 (diff) | |
download | gcc-2414e1d655249938cc53becd63d8fb95db65bbfe.zip gcc-2414e1d655249938cc53becd63d8fb95db65bbfe.tar.gz gcc-2414e1d655249938cc53becd63d8fb95db65bbfe.tar.bz2 |
re PR fortran/14771 (frontend doesn't record parentheses)
fortran/
2006-02-09 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/14771
* gfortran.h (gfc_intrinsic_op): Add INTRINSIC_PARENTHESES.
* dump-parse-tree (gfc_show_expr): Handle INTRINSIC_PARENTHESES.
* expr.c (simplify_intrinsic_op): Treat INTRINSIC_PARENTHESES as
if it were INTRINSIC_UPLUS.
* resolve.c (resolve_operator): Handle INTRINSIC_PARENTHESES.
* match.c (intrinsic_operators): Add INTRINSIC_PARENTHESES.
* matchexp.c (match_primary): Record parentheses surrounding
numeric expressions.
* module.c (intrinsics): Add INTRINSIC_PARENTHESES for module
dumping.
* trans-expr.c (gfc_conv_expr_op): Handle INTRINSIC_PARENTHESES.
testsuite/
2006-02-09 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/14771
* gfortran.dg/parens_1.f90: New.
* gfortran.dg/parens_2.f90: New.
* gfortran.dg/parens_3.f90: New.
From-SVN: r110819
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r-- | gcc/testsuite/gfortran.dg/parens_1.f90 | 8 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/parens_2.f90 | 11 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/parens_3.f90 | 48 |
3 files changed, 67 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/parens_1.f90 b/gcc/testsuite/gfortran.dg/parens_1.f90 new file mode 100644 index 0000000..91ced3b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/parens_1.f90 @@ -0,0 +1,8 @@ +! PR 20894 +! { dg-do compile } +! Originally contributed by Joost VandeVondele +INTEGER, POINTER :: I,J +INTEGER :: K +ALLOCATE(I) +J=>(I) ! { dg-error "Pointer assignment target is neither TARGET nor POINTER" } +END diff --git a/gcc/testsuite/gfortran.dg/parens_2.f90 b/gcc/testsuite/gfortran.dg/parens_2.f90 new file mode 100644 index 0000000..bc2acd8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/parens_2.f90 @@ -0,0 +1,11 @@ +! PR 25048 +! { dg-do compile } +! Originally contributed by Joost VandeVondele +INTEGER, POINTER :: I +CALL S1((I)) ! { dg-error "Actual argument for .i. must be a pointer" } +CONTAINS + SUBROUTINE S1(I) + INTEGER, POINTER ::I + END SUBROUTINE S1 +END + diff --git a/gcc/testsuite/gfortran.dg/parens_3.f90 b/gcc/testsuite/gfortran.dg/parens_3.f90 new file mode 100644 index 0000000..47bb75e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/parens_3.f90 @@ -0,0 +1,48 @@ +! PR 14771 +! { dg-do run } +! Originally contributed by Walt Brainerd, modified for the testsuite + PROGRAM fc107 + +! Submitted by Walt Brainerd, The Fortran Company +! GNU Fortran 95 (GCC 4.1.0 20050322 (experimental)) +! Windows XP + +! Return value should be 3 + + INTEGER I, J, M(2), N(2) + integer, pointer :: k + integer, target :: l + INTEGER TRYME + + interface + FUNCTION TRYyou(RTNME,HITME) + INTEGER RTNME(2),HITME(2), tryyou(2) + END function tryyou + end interface + + m = 7 + l = 5 + I = 3 + k => l + + j = tryme((i),i) + if (j .ne. 3) call abort () + + j = tryme((k),k) + if (j .ne. 5) call abort () + + n = tryyou((m),m) + if (any(n .ne. 7)) call abort () + END + + INTEGER FUNCTION TRYME(RTNME,HITME) + INTEGER RTNME,HITME + HITME = 999 + TRYME = RTNME + END + + FUNCTION TRYyou(RTNME,HITME) + INTEGER RTNME(2),HITME(2), tryyou(2) + HITME = 999 + TRYyou = RTNME + END |