-
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] Check dummy arguments of BIND(C) procedures
Declaration checking in semantics was only examining symbols with explicit BIND(C) attributes; extend it to also check dummy arguments to such procedures. Differential Revision: https://reviews.llvm.org/D145746
- Loading branch information
Showing
7 changed files
with
108 additions
and
31 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,21 @@ | ||
! RUN: %python %S/test_errors.py %s %flang_fc1 | ||
module m | ||
!ERROR: A scalar interoperable variable may not be ALLOCATABLE or POINTER | ||
real, allocatable, bind(c) :: x1 | ||
!ERROR: A scalar interoperable variable may not be ALLOCATABLE or POINTER | ||
real, pointer, bind(c) :: x2 | ||
!ERROR: BIND(C) array must have explicit shape or be assumed-size unless a dummy argument without the VALUE attribute | ||
real, allocatable, bind(c) :: x3(:) | ||
contains | ||
subroutine s1(x) bind(c) | ||
!ERROR: A BIND(C) VALUE dummy argument must have an interoperable type | ||
logical(2), intent(in), value :: x | ||
end | ||
subroutine s2(x) bind(c) | ||
!PORTABILITY: An interoperable procedure with an OPTIONAL dummy argument might not be portable | ||
integer, intent(in), optional :: x | ||
end | ||
!ERROR: A subprogram interface with the BIND attribute may not have an alternate return argument | ||
subroutine s3(*) bind(c) | ||
end | ||
end |
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