[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / modfile34.f90
blobb035662a93d235ba0df2552b7e49fb187175a9c4
1 ! RUN: %S/test_modfile.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 ! Test resolution of type-bound generics.
5 module m1
6 type :: t
7 contains
8 procedure, pass(x) :: add1 => add
9 procedure, nopass :: add2 => add
10 procedure :: add_real
11 generic :: g => add1, add2, add_real
12 end type
13 contains
14 integer(8) pure function add(x, y)
15 class(t), intent(in) :: x, y
16 end
17 integer(8) pure function add_real(x, y)
18 class(t), intent(in) :: x
19 real, intent(in) :: y
20 end
21 subroutine test1(x, y, z)
22 type(t) :: x, y
23 real :: z(x%add1(y))
24 end
25 subroutine test1p(x, y, z)
26 class(t) :: x, y
27 real :: z(x%add1(y))
28 end
29 subroutine test2(x, y, z)
30 type(t) :: x, y
31 real :: z(x%g(y))
32 end
33 subroutine test2p(x, y, z)
34 class(t) :: x, y
35 real :: z(x%g(y))
36 end
37 subroutine test3(x, y, z)
38 type(t) :: x, y
39 real :: z(x%g(y, x))
40 end
41 subroutine test3p(x, y, z)
42 class(t) :: x, y
43 real :: z(x%g(y, x))
44 end
45 subroutine test4(x, y, z)
46 type(t) :: x
47 real :: y
48 real :: z(x%g(y))
49 end
50 subroutine test4p(x, y, z)
51 class(t) :: x
52 real :: y
53 real :: z(x%g(y))
54 end
55 end
57 !Expect: m1.mod
58 !module m1
59 ! type :: t
60 ! contains
61 ! procedure, pass(x) :: add1 => add
62 ! procedure, nopass :: add2 => add
63 ! procedure :: add_real
64 ! generic :: g => add1
65 ! generic :: g => add2
66 ! generic :: g => add_real
67 ! end type
68 !contains
69 ! pure function add(x, y)
70 ! class(t), intent(in) :: x
71 ! class(t), intent(in) :: y
72 ! integer(8) :: add
73 ! end
74 ! pure function add_real(x, y)
75 ! class(t), intent(in) :: x
76 ! real(4), intent(in) :: y
77 ! integer(8) :: add_real
78 ! end
79 ! subroutine test1(x, y, z)
80 ! type(t) :: x
81 ! type(t) :: y
82 ! real(4) :: z(1_8:add(x, y))
83 ! end
84 ! subroutine test1p(x,y,z)
85 ! class(t)::x
86 ! class(t)::y
87 ! real(4)::z(1_8:x%add1(y))
88 ! end
89 ! subroutine test2(x, y, z)
90 ! type(t) :: x
91 ! type(t) :: y
92 ! real(4)::z(1_8:add(x,y))
93 ! end
94 ! subroutine test2p(x,y,z)
95 ! class(t)::x
96 ! class(t)::y
97 ! real(4) :: z(1_8:x%add1(y))
98 ! end
99 ! subroutine test3(x, y, z)
100 ! type(t) :: x
101 ! type(t) :: y
102 ! real(4)::z(1_8:add(y,x))
103 ! end
104 ! subroutine test3p(x,y,z)
105 ! class(t)::x
106 ! class(t)::y
107 ! real(4) :: z(1_8:x%add2(y, x))
108 ! end
109 ! subroutine test4(x, y, z)
110 ! type(t) :: x
111 ! real(4) :: y
112 ! real(4)::z(1_8:add_real(x,y))
113 ! end
114 ! subroutine test4p(x,y,z)
115 ! class(t)::x
116 ! real(4)::y
117 ! real(4) :: z(1_8:x%add_real(y))
118 ! end
119 !end