diff options
author | Yiran Wang <yiran@google.com> | 2015-06-23 15:33:17 -0700 |
---|---|---|
committer | Yiran Wang <yiran@google.com> | 2015-06-29 10:56:28 -0700 |
commit | 1d9fec7937f45dde5e04cac966a2d9a12f2fc15a (patch) | |
tree | 3fbcd18a379a05fd6d43491a107e1f36bc61b185 /gcc-4.9/gcc/testsuite/gfortran.dg | |
parent | f378ebf14df0952eae870c9865bab8326aa8f137 (diff) | |
download | toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.gz toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.bz2 toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.zip |
Synchronize with google/gcc-4_9 to r224707 (from r214835)
Change-Id: I3d6f06fc613c8f8b6a82143dc44b7338483aac5d
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.dg')
7 files changed, 145 insertions, 1 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/dependency_45.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/dependency_45.f90 new file mode 100644 index 000000000..8b43f7507 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/dependency_45.f90 @@ -0,0 +1,12 @@ +! { dg-do run } +! { dg-options "-Warray-temporaries" } +! PR 56867 - substrings were not checked for dependency. +program main + character(len=4) :: a + character(len=4) :: c(3) + c(1) = 'abcd' + c(2) = '1234' + c(3) = 'wxyz' + c(:)(1:2) = c(2)(2:3) ! { dg-warning "array temporary" } + if (c(3) .ne. '23yz') call abort +end program main diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/pr59488-1.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/pr59488-1.f90 new file mode 100644 index 000000000..9db17dd27 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/pr59488-1.f90 @@ -0,0 +1,13 @@ +! PR fortran/59488 +! { dg-do compile } +! { dg-options "-fopenmp" } + + implicit none + integer, parameter :: p(2) = (/ 11, 12 /) + integer :: r + + !$omp parallel do default(none) + do r = 1, 2 + print *, p(r) + end do +end diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/pr59488-2.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/pr59488-2.f90 new file mode 100644 index 000000000..38f157b81 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/pr59488-2.f90 @@ -0,0 +1,16 @@ +! PR fortran/59488 +! { dg-do compile } +! { dg-options "-fopenmp" } + + implicit none + type t + integer :: s1, s2, s3 + end type + integer :: r + type(t), parameter :: u = t(1, 2, 3) + + !$omp parallel do default(none) + do r = 1, 2 + print *, u + end do +end diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/pointer_intent_7.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/pointer_intent_7.f90 index c09eb2b5f..5387ace8c 100644 --- a/gcc-4.9/gcc/testsuite/gfortran.dg/pointer_intent_7.f90 +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/pointer_intent_7.f90 @@ -23,7 +23,7 @@ contains call bar2 (c) call bar3 (c) call bar2p (b) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" } - call bar3p (b) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" } + call bar3p (b) ! { dg-error "Actual argument to .n. at \\(1\\) must be polymorphic" } call bar2p (c) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" } call bar3p (c) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" } end subroutine diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/pr64528.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/pr64528.f90 new file mode 100644 index 000000000..f6cca4f73 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/pr64528.f90 @@ -0,0 +1,20 @@ +! PR fortran/64528 +! { dg-do compile } +! { dg-options "-O -fno-tree-dce -fno-tree-ccp" } + +program pr64528 + interface + subroutine foo(x) + integer, value :: x + end subroutine foo + end interface + integer :: x + x = 10 + call foo(x) + if(x .ne. 10) then + endif +end program pr64528 +subroutine foo(x) + integer, value :: x + x = 11 +end subroutine foo diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/typebound_call_26.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/typebound_call_26.f90 new file mode 100644 index 000000000..dffbf93e7 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/typebound_call_26.f90 @@ -0,0 +1,30 @@ +! { dg-do compile } +! +! PR 64244: [4.8/4.9/5 Regression] ICE at class.c:236 when using non_overridable +! +! Contributed by Ondřej Čertík <ondrej.certik@gmail.com> + +module m + implicit none + + type :: A + contains + generic :: f => g + procedure, non_overridable :: g + end type + +contains + + subroutine g(this) + class(A), intent(in) :: this + end subroutine + +end module + + +program test_non_overridable + use m, only: A + implicit none + class(A), allocatable :: h + call h%f() +end diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/typebound_operator_20.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/typebound_operator_20.f90 new file mode 100644 index 000000000..26c49a188 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/typebound_operator_20.f90 @@ -0,0 +1,53 @@ +! { dg-do run } +! +! PR 63733: [4.8/4.9/5 Regression] [OOP] wrong resolution for OPERATOR generics +! +! Original test case from Alberto F. Martín Huertas <amartin@cimne.upc.edu> +! Slightly modified by Salvatore Filippone <sfilippone@uniroma2.it> +! Further modified by Janus Weil <janus@gcc.gnu.org> + +module overwrite + type parent + contains + procedure :: sum => sum_parent + generic :: operator(+) => sum + end type + + type, extends(parent) :: child + contains + procedure :: sum => sum_child + end type + +contains + + integer function sum_parent(op1,op2) + implicit none + class(parent), intent(in) :: op1, op2 + sum_parent = 0 + end function + + integer function sum_child(op1,op2) + implicit none + class(child) , intent(in) :: op1 + class(parent), intent(in) :: op2 + sum_child = 1 + end function + +end module + +program drive + use overwrite + implicit none + + type(parent) :: m1, m2 + class(parent), pointer :: mres + type(child) :: h1, h2 + class(parent), pointer :: hres + + if (m1 + m2 /= 0) call abort() + if (h1 + m2 /= 1) call abort() + if (h1%sum(h2) /= 1) call abort() + +end + +! { dg-final { cleanup-modules "overwrite" } } |