[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Evaluate / rewrite02.f90
blobe1eebe55134e5183d59f4c42c3d3c6be5dd7f696
1 ! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s
2 ! Tests handling of easily-misparsed substrings and substring
3 ! type parameter inquiries.
4 subroutine foo(j)
5 integer, intent(in) :: j
6 character*4 sc, ac(1)
7 type t
8 character*4 sc, ac(1)
9 end type
10 type(t) st, at(1)
11 !CHECK: PRINT *, sc(1_8:int(j,kind=8))
12 print *, sc(1:j)
13 !CHECK: PRINT *, ac(1_8)(1_8:int(j,kind=8))
14 print *, ac(1)(1:j)
15 !CHECK: PRINT *, st%sc(1_8:int(j,kind=8))
16 print *, st%sc(1:j)
17 !CHECK: PRINT *, st%ac(1_8)(1_8:int(j,kind=8))
18 print *, st%ac(1)(1:j)
19 !CHECK: PRINT *, at(1_8)%sc(1_8:int(j,kind=8))
20 print *, at(1)%sc(1:j)
21 !CHECK: PRINT *, at(1_8)%ac(1_8)(1_8:int(j,kind=8))
22 print *, at(1)%ac(1)(1:j)
23 !CHECK: PRINT *, 1_4
24 print *, sc(1:j)%kind
25 !CHECK: PRINT *, 1_4
26 print *, ac(1)(1:j)%kind
27 !CHECK: PRINT *, 1_4
28 print *, st%sc(1:j)%kind
29 !CHECK: PRINT *, 1_4
30 print *, st%ac(1)(1:j)%kind
31 !CHECK: PRINT *, 1_4
32 print *, at(1)%sc(1:j)%kind
33 !CHECK: PRINT *, 1_4
34 print *, at(1)%ac(1)(1:j)%kind
35 !CHECK: PRINT *, int(max(0_8,int(j,kind=8)-1_8+1_8),kind=4)
36 print *, sc(1:j)%len
37 !CHECK: PRINT *, int(max(0_8,int(j,kind=8)-1_8+1_8),kind=4)
38 print *, ac(1)(1:j)%len
39 !CHECK: PRINT *, int(max(0_8,int(j,kind=8)-1_8+1_8),kind=4)
40 print *, st%sc(1:j)%len
41 !CHECK: PRINT *, int(max(0_8,int(j,kind=8)-1_8+1_8),kind=4)
42 print *, st%ac(1)(1:j)%len
43 !CHECK: PRINT *, int(max(0_8,int(j,kind=8)-1_8+1_8),kind=4)
44 print *, at(1)%sc(1:j)%len
45 !CHECK: PRINT *, int(max(0_8,int(j,kind=8)-1_8+1_8),kind=4)
46 print *, at(1)%ac(1)(1:j)%len
47 end