[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / expr-errors01.f90
blob31aa92c26c52ff50f0e8d5599a49324251faccaf
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 ! C1003 - can't parenthesize function call returning procedure pointer
4 module m1
5 type :: dt
6 procedure(frpp), pointer, nopass :: pp
7 end type dt
8 contains
9 subroutine boring
10 end subroutine boring
11 function frpp
12 procedure(boring), pointer :: frpp
13 frpp => boring
14 end function frpp
15 subroutine tests
16 procedure(boring), pointer :: mypp
17 type(dt) :: dtinst
18 mypp => boring ! legal
19 mypp => (boring) ! legal, not a function reference
20 !ERROR: A function reference that returns a procedure pointer may not be parenthesized
21 mypp => (frpp()) ! C1003
22 mypp => frpp() ! legal, not parenthesized
23 dtinst%pp => frpp
24 mypp => dtinst%pp() ! legal
25 !ERROR: A function reference that returns a procedure pointer may not be parenthesized
26 mypp => (dtinst%pp())
27 end subroutine tests
28 end module m1