forked from OSchip/llvm-project
[flang] call09.f90 and review comment
Original-commit: flang-compiler/f18@bc2ac270c6 Reviewed-on: https://github.com/flang-compiler/f18/pull/711 Tree-same-pre-rewrite: false
This commit is contained in:
parent
c3d35afd87
commit
7f52d94bf3
|
@ -182,6 +182,7 @@ module m01
|
|||
|
||||
subroutine test11(in) ! C15.5.2.4(20)
|
||||
real, intent(in) :: in
|
||||
real :: x
|
||||
! ERROR: effective argument associated with INTENT(OUT) dummy must be definable
|
||||
call intentout(in)
|
||||
! ERROR: effective argument associated with INTENT(OUT) dummy must be definable
|
||||
|
@ -194,6 +195,10 @@ module m01
|
|||
call intentinout(3.14159)
|
||||
! ERROR: effective argument associated with INTENT(IN OUT) dummy must be definable
|
||||
call intentinout(in + 1.)
|
||||
x = 0.
|
||||
call intentinout(x) ! ok
|
||||
! ERROR: effective argument associated with INTENT(IN OUT) dummy must be definable
|
||||
call intentinout((x))
|
||||
end subroutine
|
||||
|
||||
subroutine test12 ! 15.5.2.4(21)
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
! Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
|
||||
!
|
||||
! Licensed under the Apache License, Version 2.0 (the "License");
|
||||
! you may not use this file except in compliance with the License.
|
||||
! You may obtain a copy of the License at
|
||||
!
|
||||
! http://www.apache.org/licenses/LICENSE-2.0
|
||||
!
|
||||
! Unless required by applicable law or agreed to in writing, software
|
||||
! distributed under the License is distributed on an "AS IS" BASIS,
|
||||
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
! See the License for the specific language governing permissions and
|
||||
! limitations under the License.
|
||||
|
||||
! Test 15.5.2.9(5) dummy procedure POINTER requirements
|
||||
|
||||
module m
|
||||
|
||||
contains
|
||||
|
||||
subroutine s01(p)
|
||||
procedure(sin), pointer, intent(in) :: p
|
||||
end subroutine
|
||||
subroutine s02(p)
|
||||
procedure(sin), pointer :: p
|
||||
end subroutine
|
||||
|
||||
function procptr()
|
||||
procedure(sin), pointer :: procptr
|
||||
procptr => cos
|
||||
end function
|
||||
|
||||
subroutine test
|
||||
procedure(tan), pointer :: p
|
||||
p => tan
|
||||
call s01(p) ! ok
|
||||
call s01(procptr()) ! ok
|
||||
call s01(null()) ! ok
|
||||
call s01(null(p)) ! ok
|
||||
call s01(sin) ! ok
|
||||
call s02(p) ! ok
|
||||
! ERROR: Effective argument associated with dummy procedure pointer must be a procedure pointer unless INTENT(IN)
|
||||
call s02(procptr())
|
||||
! ERROR: Effective argument associated with dummy procedure pointer must be a procedure pointer unless INTENT(IN)
|
||||
call s02(null())
|
||||
! ERROR: Effective argument associated with dummy procedure pointer must be a procedure pointer unless INTENT(IN)
|
||||
call s02(null(p))
|
||||
! ERROR: Effective argument associated with dummy procedure pointer must be a procedure pointer unless INTENT(IN)
|
||||
call s02(sin)
|
||||
end subroutine
|
||||
|
||||
end module
|
Loading…
Reference in New Issue