diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-23 22:15:51 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-23 22:15:51 +0000 |
commit | 9c6cdcae0dc9ab7ea592aeeec349a8a9e1f94e03 (patch) | |
tree | c983f3bd0f0b77e7322751841c73daea479f7408 /gcc/testsuite/gfortran.dg | |
parent | 1e7f9b29eacd09ca29682b6a49f8380b043f5838 (diff) | |
download | gcc-9c6cdcae0dc9ab7ea592aeeec349a8a9e1f94e03.tar.gz |
gcc/fortran/
2010-07-24 Tobias Burnus <burnus@net-b.de>
* options.c (gfc_init_options): Enable -fwhole-file by default.
* interface.c (compare_parameter): Assume a Hollerith constant is
compatible with all other argument types.
libgomp/
2010-07-24 Tobias Burnus <burnus@net-b.de>
* testsuite/libgomp.fortran/appendix-a/a.28.5.f90: Add -w to
silence -fwhole-file warning.
gcc/testsuite/
2010-07-24 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/func_decl_4.f90: Split test into two ...
* gfortran.dg/func_decl_5.f90: ... parts.
* gfortran.dg/common_resize_1.f: xfail two warnings (cf. PR 45045).
* gfortran.dg/bounds_temporaries_1.f90: Add new dg-warning.
* gfortran.dg/global_references_1.f90: Add new dg-warning.
* gfortran.dg/generic_actual_arg.f90: Add new dg-warning.
* gfortran.dg/entry_17.f90: Remove no-longer needed dg-warning.
* gfortran.dg/used_before_typed_4.f90: Add new dg-warning.
* gfortran.dg/bounds_check_strlen_1.f90: Add new dg-warning.
* gfortran.dg/intrinsic_std_1.f90: Split by remove tree dump ...
* gfortran.dg/intrinsic_std_6.f90: ... and create a dump test.
* gfortran.dg/sizeof.f90: Make test valid.
* gfortran.dg/pr20865.f90: Add new dg-error.
* gfortran.dg/integer_exponentiation_2.f90: Add new dg-warnings.
* gfortran.dg/g77/19990218-0.f: Ditto.
* gfortran.dg/g77/19990218-1.f: Ditto.
* gfortran.dg/g77/970625-2.f: Ditto.
* gfortran.dg/pr37243.f: Fix function declaration.
* gfortran.dg/use_only_1.f90: Fix implicit typing.
* gfortran.dg/loc_1.f90: Fix pointer datatype.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162491 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r-- | gcc/testsuite/gfortran.dg/bounds_check_strlen_1.f90 | 2 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90 | 2 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/common_resize_1.f | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/entry_17.f90 | 4 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/func_decl_4.f90 | 13 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/g77/19990218-0.f | 2 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/g77/19990218-1.f | 2 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/g77/970625-2.f | 2 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/generic_actual_arg.f90 | 2 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/global_references_1.f90 | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90 | 20 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 | 16 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/loc_1.f90 | 3 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr20865.f90 | 2 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr37243.f | 9 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/sizeof.f90 | 4 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/use_only_1.f90 | 1 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/used_before_typed_4.f90 | 2 |
18 files changed, 53 insertions, 44 deletions
diff --git a/gcc/testsuite/gfortran.dg/bounds_check_strlen_1.f90 b/gcc/testsuite/gfortran.dg/bounds_check_strlen_1.f90 index 44673024b82..7ea4a89a101 100644 --- a/gcc/testsuite/gfortran.dg/bounds_check_strlen_1.f90 +++ b/gcc/testsuite/gfortran.dg/bounds_check_strlen_1.f90 @@ -12,7 +12,7 @@ END SUBROUTINE test PROGRAM main IMPLICIT NONE - CALL test ('abc') ! String is too short. + CALL test ('abc') ! { dg-warning "Character length of actual argument shorter" } END PROGRAM main ! { dg-output "shorter than the declared one for dummy argument 'str' \\(3/5\\)" } diff --git a/gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90 b/gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90 index a277566735d..32bb265c130 100644 --- a/gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90 +++ b/gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90 @@ -22,7 +22,7 @@ end subroutine gfcbug34 ! This is PR25669 subroutine foo (a) real a(*) - call bar (a, LBOUND(a),2) + call bar (a, LBOUND(a),2) ! { dg-warning "Rank mismatch in argument" } end subroutine foo subroutine bar (b, i, j) real b(i:j) diff --git a/gcc/testsuite/gfortran.dg/common_resize_1.f b/gcc/testsuite/gfortran.dg/common_resize_1.f index 7d4baaacea6..a94c1bc0c6a 100644 --- a/gcc/testsuite/gfortran.dg/common_resize_1.f +++ b/gcc/testsuite/gfortran.dg/common_resize_1.f @@ -49,14 +49,15 @@ c 7 vy5(lnv),vy6(lnv),vy7(lnv),vy8(lnv),
8 vz1(lnv),vz2(lnv),vz3(lnv),vz4(lnv),
9 vz5(lnv),vz6(lnv),vz7(lnv),vz8(lnv)
- common/aux32/ ! { dg-warning "shall be of the same size" }
+ ! XFAILed here and below because of PRs 45045 and 45044
+ common/aux32/ ! { dg-warning "shall be of the same size" "" { xfail *-*-*} }
a a17(lnv),a28(lnv),dett(lnv),
1 aj1(lnv),aj2(lnv),aj3(lnv),aj4(lnv),
2 aj5(lnv),aj6(lnv),aj7(lnv),aj8(lnv),
3 aj9(lnv),x17(lnv),x28(lnv),x35(lnv),
4 x46(lnv),y17(lnv),y28(lnv),y35(lnv),
5 y46(lnv),z17(lnv),z28(lnv),z35(lnv),z46(lnv)
- common/aux33/ ! { dg-warning "shall be of the same size" }
+ common/aux33/ ! { dg-warning "shall be of the same size" "" { xfail *-*-*} }
a ix1(lnv),ix2(lnv),ix3(lnv),ix4(lnv),ix5(lnv),
1 ix6(lnv),ix7(lnv),ix8(lnv),mxt(lnv),nmel
common/aux36/lft,llt
diff --git a/gcc/testsuite/gfortran.dg/entry_17.f90 b/gcc/testsuite/gfortran.dg/entry_17.f90 index 22aabb3a88f..b4e91c2a8ee 100644 --- a/gcc/testsuite/gfortran.dg/entry_17.f90 +++ b/gcc/testsuite/gfortran.dg/entry_17.f90 @@ -24,7 +24,7 @@ function test3() ! { dg-warning "Obsolescent feature" } return entry bar3() bar3 = "" -end function test3 ! { dg-warning "Obsolescent feature" } +end function test3 function test4(n) ! { dg-error "returning variables of different string lengths" } integer :: n @@ -52,4 +52,4 @@ function test6() ! { dg-warning "Obsolescent feature|returning variables of diff return entry bar6() bar6 = "" -end function test6 ! { dg-warning "Obsolescent feature" } +end function test6 diff --git a/gcc/testsuite/gfortran.dg/func_decl_4.f90 b/gcc/testsuite/gfortran.dg/func_decl_4.f90 index 972454dce04..edc6c7e25c7 100644 --- a/gcc/testsuite/gfortran.dg/func_decl_4.f90 +++ b/gcc/testsuite/gfortran.dg/func_decl_4.f90 @@ -3,13 +3,18 @@ ! ! Functions shall not have an initializer. ! +! Due to -fwhole-file, the function declaration +! warnings come before the init warnings; thus +! the warning for the WRONG lines have been moved to +! func_decl_5.f90 +! -function f1() ! { dg-error "cannot have an initializer" } - integer :: f1 = 42 +function f1() + integer :: f1 = 42 ! WRONG, see func_decl_5.f90 end function -function f2() RESULT (r) ! { dg-error "cannot have an initializer" } - integer :: r = 42 +function f2() RESULT (r) + integer :: r = 42 ! WRONG, see func_decl_5.f90 end function function f3() RESULT (f3) ! { dg-error "must be different than function name" } diff --git a/gcc/testsuite/gfortran.dg/g77/19990218-0.f b/gcc/testsuite/gfortran.dg/g77/19990218-0.f index 631e74195ea..57bb6384110 100644 --- a/gcc/testsuite/gfortran.dg/g77/19990218-0.f +++ b/gcc/testsuite/gfortran.dg/g77/19990218-0.f @@ -2,7 +2,7 @@ c { dg-do compile } program test double precision a,b,c data a,b/1.0d-46,1.0d0/ - c=fun(a,b) + c=fun(a,b) ! { dg-error "Return type mismatch of function" } print*,'in main: fun=',c end double precision function fun(a,b) diff --git a/gcc/testsuite/gfortran.dg/g77/19990218-1.f b/gcc/testsuite/gfortran.dg/g77/19990218-1.f index 2ac43903444..8506e4fe148 100644 --- a/gcc/testsuite/gfortran.dg/g77/19990218-1.f +++ b/gcc/testsuite/gfortran.dg/g77/19990218-1.f @@ -20,6 +20,6 @@ c program test double precision a,b,c data a,b/1.0d-46,1.0d0/ - c=fun(a,b) + c=fun(a,b) ! { dg-error "Return type mismatch of function" } print*,'in main: fun=',c end diff --git a/gcc/testsuite/gfortran.dg/g77/970625-2.f b/gcc/testsuite/gfortran.dg/g77/970625-2.f index c77a2b5f310..19bd096815a 100644 --- a/gcc/testsuite/gfortran.dg/g77/970625-2.f +++ b/gcc/testsuite/gfortran.dg/g77/970625-2.f @@ -40,7 +40,7 @@ PROGRAM = THEN - IF ELSE IF = THEN .GT. IF IF (THEN.GT.REAL) THEN - CALL FUNCTION PROGRAM (ELSE IF, GO TO PROGRAM, THEN) + CALL FUNCTION PROGRAM (ELSE IF, GO TO PROGRAM, THEN) ! { dg-warning "Type mismatch in argument" } ELSE IF (ELSE IF) THEN REAL = THEN + END DO END IF diff --git a/gcc/testsuite/gfortran.dg/generic_actual_arg.f90 b/gcc/testsuite/gfortran.dg/generic_actual_arg.f90 index 9cf0d8eb004..e0b36a01036 100644 --- a/gcc/testsuite/gfortran.dg/generic_actual_arg.f90 +++ b/gcc/testsuite/gfortran.dg/generic_actual_arg.f90 @@ -37,7 +37,7 @@ USE TEST USE TEST2 CALL F(CALCULATION) ! { dg-error "GENERIC procedure" } -CALL F(CALCULATION2) ! OK because there is a same name specific +CALL F(CALCULATION2) ! OK because there is a same name specific, but: ! { dg-warning "More actual than formal arguments" } END SUBROUTINE F() diff --git a/gcc/testsuite/gfortran.dg/global_references_1.f90 b/gcc/testsuite/gfortran.dg/global_references_1.f90 index 0e633455518..d241aca1b53 100644 --- a/gcc/testsuite/gfortran.dg/global_references_1.f90 +++ b/gcc/testsuite/gfortran.dg/global_references_1.f90 @@ -32,11 +32,11 @@ function h(x) ! { dg-error "is already being used as a FUNCTION" } end function h SUBROUTINE TT() - CHARACTER(LEN=10), EXTERNAL :: j + CHARACTER(LEN=10), EXTERNAL :: j ! { dg-warning "Return type mismatch" } CHARACTER(LEN=10) :: T ! PR20881=========================================================== ! Error only appears once but testsuite associates with both lines. - T = j () ! { dg-error "is already being used as a FUNCTION" } + T = j (1.0) ! { dg-error "is already being used as a SUBROUTINE" } print *, T END SUBROUTINE TT @@ -78,7 +78,7 @@ end ! Lahey - 2636-S: "SOURCE.F90", line 81: ! Subroutine 'j' is previously referenced as a function in 'line 39'. -SUBROUTINE j (x) ! { dg-error "is already being used as a FUNCTION" } +SUBROUTINE j (x) ! { dg-error "is already being used as a SUBROUTINE" } integer a(10) common /bar/ a ! Global entity foo real x diff --git a/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90 b/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90 index 1261d48d341..d55f70c9a95 100644 --- a/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90 +++ b/gcc/testsuite/gfortran.dg/integer_exponentiation_2.f90 @@ -139,16 +139,16 @@ subroutine foo(a) call gee_i(i**(-huge(0_4))) call gee_i(i**(-huge(0_4)-1_4)) - call gee_i(i**0_8) - call gee_i(i**1_8) - call gee_i(i**2_8) - call gee_i(i**3_8) - call gee_i(i**(-1_8)) - call gee_i(i**(-2_8)) - call gee_i(i**(-3_8)) - call gee_i(i**huge(0_8)) - call gee_i(i**(-huge(0_8))) - call gee_i(i**(-huge(0_8)-1_8)) + call gee_i(i**0_8) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**1_8) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**2_8) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**3_8) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**(-1_8)) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**(-2_8)) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**(-3_8)) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**huge(0_8)) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**(-huge(0_8))) ! { dg-warning "Type mismatch in argument" } + call gee_i(i**(-huge(0_8)-1_8)) ! { dg-warning "Type mismatch in argument" } ! Real call gee_r(a**0_1) diff --git a/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 b/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 index 290b54c2cb4..ac8649bbc62 100644 --- a/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 +++ b/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 @@ -1,5 +1,9 @@ ! { dg-do compile } -! { dg-options "-std=f95 -Wintrinsics-std -fdump-tree-original" } +! { dg-options "-std=f95 -Wintrinsics-std" } + +! +! See intrinsic_std_6.f90 for the dump check. +! ! PR fortran/33141 ! Check for the expected behaviour when an intrinsic function/subroutine is @@ -32,8 +36,8 @@ END SUBROUTINE implicit_type SUBROUTINE specification_expression CHARACTER(KIND=selected_char_kind("ascii")) :: x -! { dg-error "must be an intrinsic function" "" { target "*-*-*" } 34 } -! { dg-warning "Fortran 2003" "" { target "*-*-*" } 34 } +! { dg-error "must be an intrinsic function" "" { target "*-*-*" } 38 } +! { dg-warning "Fortran 2003" "" { target "*-*-*" } 38 } END SUBROUTINE specification_expression SUBROUTINE intrinsic_decl @@ -41,9 +45,3 @@ SUBROUTINE intrinsic_decl INTRINSIC :: atanh ! { dg-error "Fortran 2008" } INTRINSIC :: abort ! { dg-error "extension" } END SUBROUTINE intrinsic_decl - -! Scan that really external functions are called. -! { dg-final { scan-tree-dump " abort " "original" } } -! { dg-final { scan-tree-dump " asinh " "original" } } -! { dg-final { scan-tree-dump " acosh " "original" } } -! { dg-final { cleanup-tree-dump "original" } } diff --git a/gcc/testsuite/gfortran.dg/loc_1.f90 b/gcc/testsuite/gfortran.dg/loc_1.f90 index ef0b1c10280..2c070dfb1bb 100644 --- a/gcc/testsuite/gfortran.dg/loc_1.f90 +++ b/gcc/testsuite/gfortran.dg/loc_1.f90 @@ -17,9 +17,10 @@ subroutine fn end subroutine fn subroutine foo (ii) + use iso_c_binding, only: c_intptr_t common /targ/targ integer targ(10) - integer ii + integer(c_intptr_t) ii targ(2) = ii end subroutine foo diff --git a/gcc/testsuite/gfortran.dg/pr20865.f90 b/gcc/testsuite/gfortran.dg/pr20865.f90 index 5c26965ccc5..e99eb0bedbf 100644 --- a/gcc/testsuite/gfortran.dg/pr20865.f90 +++ b/gcc/testsuite/gfortran.dg/pr20865.f90 @@ -8,5 +8,5 @@ integer :: i, st st(i) = (i*i+2) - call tt(st) ! { dg-error "Statement function .* is not allowed as an actual argument" } + call tt(st) ! { dg-error "Statement function .* is not allowed as an actual argument|Invalid procedure argument" } end diff --git a/gcc/testsuite/gfortran.dg/pr37243.f b/gcc/testsuite/gfortran.dg/pr37243.f index 01ec0bdf886..0a606ad7707 100644 --- a/gcc/testsuite/gfortran.dg/pr37243.f +++ b/gcc/testsuite/gfortran.dg/pr37243.f @@ -53,10 +53,13 @@ call schmd(V, 1, 18, 18) end - subroutine DAXPY + subroutine DAXPY(N,D,V,M,W,L) + INTEGER :: N, M, L + DOUBLE PRECISION D, V(1,1), W(1,1) end - FUNCTION DDOT () - DOUBLE PRECISION DDOT + FUNCTION DDOT (N,V,M,W,L) + INTEGER :: N, M, L + DOUBLE PRECISION DDOT, V(1,1), W(1,1) DDOT = 1 end diff --git a/gcc/testsuite/gfortran.dg/sizeof.f90 b/gcc/testsuite/gfortran.dg/sizeof.f90 index 5518ba22491..fbe6b868fb0 100644 --- a/gcc/testsuite/gfortran.dg/sizeof.f90 +++ b/gcc/testsuite/gfortran.dg/sizeof.f90 @@ -82,7 +82,7 @@ subroutine check_derived () call abort end subroutine check_derived -call check_int () -call check_real () +call check_int (1) +call check_real (1.0, (/1.0, 2.0, 3.0, 4.0, 5.0/)) call check_derived () end diff --git a/gcc/testsuite/gfortran.dg/use_only_1.f90 b/gcc/testsuite/gfortran.dg/use_only_1.f90 index 30808fb856f..e0132438416 100644 --- a/gcc/testsuite/gfortran.dg/use_only_1.f90 +++ b/gcc/testsuite/gfortran.dg/use_only_1.f90 @@ -73,6 +73,7 @@ contains USE xmod, ONLY: xfoobar_renamed => xfoobar USE ymod, ONLY: yfoobar_renamed => yfoobar USE ymod + implicit integer(4) (a-z) if (xfoobar_renamed (42) == xfoobar ()) call abort () if (yfoobar_renamed (42) == yfoobar ()) call abort () end subroutine diff --git a/gcc/testsuite/gfortran.dg/used_before_typed_4.f90 b/gcc/testsuite/gfortran.dg/used_before_typed_4.f90 index 9d7ccc10add..ff8a1fc2970 100644 --- a/gcc/testsuite/gfortran.dg/used_before_typed_4.f90 +++ b/gcc/testsuite/gfortran.dg/used_before_typed_4.f90 @@ -22,5 +22,5 @@ END SUBROUTINE test PROGRAM main IMPLICIT NONE INTEGER :: arr1(42), arr2(42) - CALL test (3, arr1, 2, arr2) + CALL test (3, arr1, 2, arr2) ! { dg-warning "Type mismatch in argument" } END PROGRAM main |