[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / resolve93.f90
blob5454267136dfc3eb7983934204265925abe71e0e
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 subroutine s1()
4 character(10) str
5 character(10) str1
6 !ERROR: Cannot reference function 'str' as data
7 print *, str(1:9), str(7)
8 block
9 character(10) str2
10 character(10) str3
11 !ERROR: Cannot reference function 'str1' as data
12 print *, str1(1:9), str1(7)
13 !ERROR: 'str2' is not an array
14 print *, str2(1:9), str2(7)
15 !ERROR: Cannot reference function 'str3' as data
16 print *, str3(7), str3(1:9)
17 end block
18 end subroutine s1
20 subroutine s2()
21 character(10) func
22 !ERROR: Cannot reference function 'func' as data
23 print *, func(7), func(1:9)
24 end subroutine s2
26 subroutine s3()
27 real(8) :: func
28 !ERROR: Cannot reference function 'func' as data
29 print *, func(7), func(1:6)
30 end subroutine s3
32 subroutine s4()
33 real(8) :: local
34 real(8) :: local1
35 !ERROR: Cannot reference function 'local' as data
36 print *, local(1:6), local(7)
37 !ERROR: Cannot reference function 'local1' as data
38 print *, local1(7), local1(1:6)
39 end subroutine s4
41 subroutine s5(arg)
42 integer :: iVar
43 external :: arg
44 iVar = loc(arg)
45 end subroutine s5