-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Don't check dummy vs. actual result rank for assumed-rank poi… (
#66237) …nters When associating a function result pointer as an actual argument with a dummy pointer that is assumed-rank, don't emit a bogus error.
- Loading branch information
Showing
6 changed files
with
60 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic -Werror | ||
! Tests actual/dummy pointer argument shape mismatches | ||
module m | ||
contains | ||
subroutine s0(p) | ||
real, pointer, intent(in) :: p | ||
end | ||
subroutine s1(p) | ||
real, pointer, intent(in) :: p(:) | ||
end | ||
subroutine sa(p) | ||
real, pointer, intent(in) :: p(..) | ||
end | ||
subroutine test | ||
real, pointer :: a0, a1(:) | ||
call s0(null(a0)) ! ok | ||
!ERROR: Rank of dummy argument is 0, but actual argument has rank 1 | ||
!ERROR: Rank of pointer is 0, but function result has rank 1 | ||
call s0(null(a1)) | ||
!ERROR: Rank of dummy argument is 1, but actual argument has rank 0 | ||
!ERROR: Rank of pointer is 1, but function result has rank 0 | ||
call s1(null(a0)) | ||
call s1(null(a1)) ! ok | ||
call sa(null(a0)) ! ok | ||
call sa(null(a1)) ! ok | ||
end | ||
end |