File: modfile27.f90

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,696 kB
  • sloc: cpp: 7,438,781; ansic: 1,393,871; asm: 1,012,926; python: 241,771; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 8,596; ml: 5,082; perl: 4,730; makefile: 3,591; awk: 3,523; javascript: 2,251; xml: 892; fortran: 672
file content (45 lines) | stat: -rw-r--r-- 1,641 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
! RUN: %python %S/test_modfile.py %s %flang_fc1
! Test folding of combined array references and structure component
! references.

module m1
  type :: t1
    integer :: ia1(2)
  end type t1
  type(t1), parameter :: t1x1(*) = [t1::t1(ia1=[1,2]),t1(ia1=[3,4])]
  logical, parameter :: t1check1 = t1x1(2)%ia1(1) == 3
  logical, parameter :: t1check2 = all(t1x1(1)%ia1 == [1,2])
  logical, parameter :: t1check3 = all(t1x1(:)%ia1(1) == [1,3])
  type :: t2
    type(t1) :: dta1(2)
  end type t2
  type(t2), parameter :: t2x1(*) = &
    [t2 :: t2(dta1=[t1::t1x1]), &
           t2(dta1=[t1::t1(ia1=[5,6]),t1(ia1=[7,8])])]
  logical, parameter :: t2check1 = t2x1(1)%dta1(2)%ia1(2) == 4
  logical, parameter :: t2check2 = &
    all(t2x1(2)%dta1(2)%ia1(:) == [7,8])
  logical, parameter :: t2check3 = &
    all(t2x1(1)%dta1(:)%ia1(2) == [2,4])
  logical, parameter :: t2check4 = &
    all(t2x1(:)%dta1(1)%ia1(2) == [2,6])
end module m1
!Expect: m1.mod
!module m1
!type::t1
!integer(4)::ia1(1_8:2_8)
!end type
!type(t1),parameter::t1x1(1_8:*)=[t1::t1(ia1=[INTEGER(4)::1_4,2_4]),t1(ia1=[INTEGER(4)::3_4,4_4])]
!logical(4),parameter::t1check1=.true._4
!logical(4),parameter::t1check2=.true._4
!intrinsic::all
!logical(4),parameter::t1check3=.true._4
!type::t2
!type(t1)::dta1(1_8:2_8)
!end type
!type(t2),parameter::t2x1(1_8:*)=[t2::t2(dta1=[t1::t1(ia1=[INTEGER(4)::1_4,2_4]),t1(ia1=[INTEGER(4)::3_4,4_4])]),t2(dta1=[t1::t1(ia1=[INTEGER(4)::5_4,6_4]),t1(ia1=[INTEGER(4)::7_4,8_4])])]
!logical(4),parameter::t2check1=.true._4
!logical(4),parameter::t2check2=.true._4
!logical(4),parameter::t2check3=.true._4
!logical(4),parameter::t2check4=.true._4
!end