view gcc/testsuite/gfortran.dg/submodule_16.f08 @ 118:fd00160c1b76

ifdef TARGET_64BIT
author mir3636
date Tue, 27 Feb 2018 15:01:35 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do compile }
!
! Tests the fix for PR71156 in which the valid code (f7, f8 and f9 below)
! triggered an error, while the invalid code (f1 to f6) compiled.
!
! Contributed by Damian Rousn  <damian@sourceryinstitute.org>
!
module my_interface
  implicit none
  interface
    module subroutine f1
    end subroutine
    module subroutine f2
    end subroutine
    module subroutine f3
    end subroutine
    elemental module subroutine f4
    end subroutine
    pure module subroutine f5
    end subroutine
    recursive module subroutine f6
    end subroutine
    elemental module subroutine f7
    end subroutine
    pure module subroutine f8
    end subroutine
    recursive module subroutine f9
    end subroutine
  end interface
end module

submodule(my_interface) my_implementation
  implicit none
contains
    elemental module subroutine f1 ! { dg-error "Mismatch in ELEMENTAL attribute" }
    end subroutine
    pure module subroutine f2 ! { dg-error "Mismatch in PURE attribute" }
    end subroutine
    recursive module subroutine f3 ! { dg-error "Mismatch in RECURSIVE attribute" }
    end subroutine
    module subroutine f4 ! { dg-error "ELEMENTAL prefix" }
    end subroutine
    module subroutine f5 ! { dg-error "PURE prefix" }
    end subroutine
    module subroutine f6 ! { dg-error "RECURSIVE prefix" }
    end subroutine
    elemental module subroutine f7
    end subroutine
    pure module subroutine f8
    end subroutine
    recursive module subroutine f9
    end subroutine
end submodule