2021-08-09 22:44:27 +08:00
|
|
|
! RUN: %python %S/test_symbols.py %s %flang_fc1
|
2019-09-13 14:03:06 +08:00
|
|
|
!DEF: /s1 (Subroutine) Subprogram
|
2018-10-18 22:55:48 +08:00
|
|
|
subroutine s1
|
|
|
|
!DEF: /s1/a ObjectEntity REAL(4)
|
|
|
|
!DEF: /s1/b ObjectEntity REAL(4)
|
|
|
|
real a(10), b(10)
|
|
|
|
!DEF: /s1/i ObjectEntity INTEGER(8)
|
|
|
|
integer(kind=8) i
|
2018-12-12 06:03:55 +08:00
|
|
|
!DEF: /s1/Forall1/i ObjectEntity INTEGER(8)
|
2018-10-18 22:55:48 +08:00
|
|
|
forall(i=1:10)
|
|
|
|
!REF: /s1/a
|
2018-12-12 06:03:55 +08:00
|
|
|
!REF: /s1/Forall1/i
|
2018-10-18 22:55:48 +08:00
|
|
|
!REF: /s1/b
|
|
|
|
a(i) = b(i)
|
|
|
|
end forall
|
2018-12-12 06:03:55 +08:00
|
|
|
!DEF: /s1/Forall2/i ObjectEntity INTEGER(8)
|
2018-10-18 22:55:48 +08:00
|
|
|
!REF: /s1/a
|
|
|
|
!REF: /s1/b
|
|
|
|
forall(i=1:10)a(i) = b(i)
|
|
|
|
end subroutine
|
|
|
|
|
2019-09-13 14:03:06 +08:00
|
|
|
!DEF: /s2 (Subroutine) Subprogram
|
2018-10-18 22:55:48 +08:00
|
|
|
subroutine s2
|
|
|
|
!DEF: /s2/a ObjectEntity REAL(4)
|
|
|
|
real a(10)
|
|
|
|
!DEF: /s2/i ObjectEntity INTEGER(4)
|
|
|
|
integer i
|
|
|
|
!DEF: /s2/Block1/i ObjectEntity INTEGER(4)
|
|
|
|
do concurrent(i=1:10)
|
|
|
|
!REF: /s2/a
|
|
|
|
!REF: /s2/Block1/i
|
|
|
|
a(i) = i
|
|
|
|
end do
|
|
|
|
!REF: /s2/i
|
|
|
|
do i=1,10
|
|
|
|
!REF: /s2/a
|
|
|
|
!REF: /s2/i
|
|
|
|
a(i) = i
|
|
|
|
end do
|
|
|
|
end subroutine
|
|
|
|
|
2019-09-13 14:03:06 +08:00
|
|
|
!DEF: /s3 (Subroutine) Subprogram
|
2018-10-18 22:55:48 +08:00
|
|
|
subroutine s3
|
|
|
|
!DEF: /s3/n PARAMETER ObjectEntity INTEGER(4)
|
|
|
|
integer, parameter :: n = 4
|
|
|
|
!DEF: /s3/n2 PARAMETER ObjectEntity INTEGER(4)
|
|
|
|
!REF: /s3/n
|
|
|
|
integer, parameter :: n2 = n*n
|
|
|
|
!REF: /s3/n
|
2020-06-19 08:17:04 +08:00
|
|
|
!DEF: /s3/x (InDataStmt) ObjectEntity REAL(4)
|
2018-10-18 22:55:48 +08:00
|
|
|
real, dimension(n,n) :: x
|
|
|
|
!REF: /s3/x
|
2019-09-13 14:03:06 +08:00
|
|
|
!DEF: /s3/ImpliedDos1/k (Implicit) ObjectEntity INTEGER(4)
|
2019-01-30 06:31:47 +08:00
|
|
|
!DEF: /s3/ImpliedDos1/j ObjectEntity INTEGER(8)
|
2018-10-18 22:55:48 +08:00
|
|
|
!REF: /s3/n
|
|
|
|
!REF: /s3/n2
|
|
|
|
data ((x(k,j),integer(kind=8)::j=1,n),k=1,n)/n2*3.0/
|
|
|
|
end subroutine
|
|
|
|
|
2019-09-13 14:03:06 +08:00
|
|
|
!DEF: /s4 (Subroutine) Subprogram
|
2018-10-18 22:55:48 +08:00
|
|
|
subroutine s4
|
|
|
|
!DEF: /s4/t DerivedType
|
|
|
|
!DEF: /s4/t/k TypeParam INTEGER(4)
|
|
|
|
type :: t(k)
|
|
|
|
!REF: /s4/t/k
|
|
|
|
integer, kind :: k
|
|
|
|
!DEF: /s4/t/a ObjectEntity INTEGER(4)
|
|
|
|
integer :: a
|
|
|
|
end type t
|
|
|
|
!REF: /s4/t
|
2020-01-15 03:38:09 +08:00
|
|
|
!DEF: /s4/x (InDataStmt) ObjectEntity TYPE(t(k=1_4))
|
2018-10-18 22:55:48 +08:00
|
|
|
type(t(1)) :: x
|
|
|
|
!REF: /s4/x
|
|
|
|
!REF: /s4/t
|
|
|
|
data x/t(1)(2)/
|
|
|
|
!REF: /s4/x
|
|
|
|
!REF: /s4/t
|
|
|
|
x = t(1)(2)
|
|
|
|
end subroutine
|
|
|
|
|
2019-09-13 14:03:06 +08:00
|
|
|
!DEF: /s5 (Subroutine) Subprogram
|
2018-10-18 22:55:48 +08:00
|
|
|
subroutine s5
|
|
|
|
!DEF: /s5/t DerivedType
|
|
|
|
!DEF: /s5/t/l TypeParam INTEGER(4)
|
|
|
|
type :: t(l)
|
|
|
|
!REF: /s5/t/l
|
|
|
|
integer, len :: l
|
|
|
|
end type t
|
|
|
|
!REF: /s5/t
|
2018-12-05 02:55:32 +08:00
|
|
|
!DEF: /s5/x ALLOCATABLE ObjectEntity TYPE(t(l=:))
|
2018-10-18 22:55:48 +08:00
|
|
|
type(t(:)), allocatable :: x
|
|
|
|
!DEF: /s5/y ALLOCATABLE ObjectEntity REAL(4)
|
|
|
|
real, allocatable :: y
|
|
|
|
!REF: /s5/t
|
|
|
|
!REF: /s5/x
|
|
|
|
allocate(t(1)::x)
|
|
|
|
!REF: /s5/y
|
|
|
|
allocate(real::y)
|
|
|
|
end subroutine
|
|
|
|
|
2019-09-13 14:03:06 +08:00
|
|
|
!DEF: /s6 (Subroutine) Subprogram
|
2018-10-18 22:55:48 +08:00
|
|
|
subroutine s6
|
|
|
|
!DEF: /s6/j ObjectEntity INTEGER(8)
|
|
|
|
integer(kind=8) j
|
|
|
|
!DEF: /s6/a ObjectEntity INTEGER(4)
|
|
|
|
integer :: a(5) = 1
|
|
|
|
!DEF: /s6/Block1/i ObjectEntity INTEGER(4)
|
2020-02-12 04:14:04 +08:00
|
|
|
!DEF: /s6/Block1/j (LocalityLocal) HostAssoc INTEGER(8)
|
2020-08-17 22:00:04 +08:00
|
|
|
!DEF: /s6/Block1/k (Implicit, LocalityLocalInit) HostAssoc INTEGER(4)
|
2019-09-13 14:03:06 +08:00
|
|
|
!DEF: /s6/Block1/a (LocalityShared) HostAssoc INTEGER(4)
|
2019-06-27 05:51:58 +08:00
|
|
|
do concurrent(integer::i=1:5)local(j)local_init(k)shared(a)
|
2019-09-12 07:53:26 +08:00
|
|
|
!REF: /s6/Block1/a
|
2018-10-18 22:55:48 +08:00
|
|
|
!REF: /s6/Block1/i
|
|
|
|
!REF: /s6/Block1/j
|
|
|
|
a(i) = j+1
|
|
|
|
end do
|
|
|
|
end subroutine
|
2019-02-07 09:18:02 +08:00
|
|
|
|
2019-09-13 14:03:06 +08:00
|
|
|
!DEF: /s7 (Subroutine) Subprogram
|
2019-02-07 09:18:02 +08:00
|
|
|
subroutine s7
|
|
|
|
!DEF: /s7/one PARAMETER ObjectEntity REAL(4)
|
|
|
|
real, parameter :: one = 1.0
|
|
|
|
!DEF: /s7/z ObjectEntity COMPLEX(4)
|
|
|
|
!REF: /s7/one
|
|
|
|
complex :: z = (one, -one)
|
|
|
|
end subroutine
|
|
|
|
|
2019-09-13 14:03:06 +08:00
|
|
|
!DEF: /s8 (Subroutine) Subprogram
|
2019-02-07 09:18:02 +08:00
|
|
|
subroutine s8
|
|
|
|
!DEF: /s8/one PARAMETER ObjectEntity REAL(4)
|
|
|
|
real, parameter :: one = 1.0
|
2020-06-19 08:17:04 +08:00
|
|
|
!DEF: /s8/y (InDataStmt) ObjectEntity REAL(4)
|
|
|
|
!DEF: /s8/z (InDataStmt) ObjectEntity REAL(4)
|
2019-02-07 09:18:02 +08:00
|
|
|
real y(10), z(10)
|
|
|
|
!REF: /s8/y
|
2019-09-13 14:03:06 +08:00
|
|
|
!DEF: /s8/ImpliedDos1/i (Implicit) ObjectEntity INTEGER(4)
|
2019-02-07 09:18:02 +08:00
|
|
|
!REF: /s8/z
|
2019-09-13 14:03:06 +08:00
|
|
|
!DEF: /s8/ImpliedDos2/i (Implicit) ObjectEntity INTEGER(4)
|
2020-01-15 03:11:15 +08:00
|
|
|
!DEF: /s8/x (Implicit, InDataStmt) ObjectEntity REAL(4)
|
2019-02-07 09:18:02 +08:00
|
|
|
!REF: /s8/one
|
|
|
|
data (y(i),i=1,10),(z(i),i=1,10),x/21*one/
|
|
|
|
end subroutine
|