-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Support PDT KIND parameters in later parameter kind expressions
Fortran allows an earlier-declared KIND type parameter of a parameterized derived type to be used in the constant expression defining the integer kind of a later type parameter. TYPE :: T(K,L) INTEGER, KIND :: K INTEGER(K), LEN :: L ... END TYPE Differential Revision: https://reviews.llvm.org/D159044https://reviews.llvm.org/D159044
- Loading branch information
Showing
11 changed files
with
181 additions
and
79 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,18 @@ | ||
! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic | ||
program main | ||
if (.true.) then | ||
do j = 1, 2 | ||
goto 1 ! ok; used to cause looping in label resolution | ||
end do | ||
else | ||
goto 1 ! ok | ||
1 end if | ||
if (.true.) then | ||
do j = 1, 2 | ||
!WARNING: Label '1' is in a construct that should not be used as a branch target here | ||
goto 1 | ||
end do | ||
end if | ||
!WARNING: Label '1' is in a construct that should not be used as a branch target here | ||
goto 1 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s | ||
program p | ||
type t(k,n) | ||
integer, kind :: k | ||
integer(k), len :: n | ||
!CHECK: warning: INTEGER(1) addition overflowed | ||
integer :: c = n + 1_1 | ||
end type | ||
!CHECK: in the context: instantiation of parameterized derived type 't(k=1_4,n=127_1)' | ||
print *, t(1,127)() | ||
end | ||
|
||
!CHECK: PRINT *, t(k=1_4,n=127_1)(c=-128_4) | ||
|
||
|
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
Oops, something went wrong.