1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
2 ! Test 15.5.2.7 constraints and restrictions for POINTER dummy arguments.
9 real, pointer, contiguous
, intent(in
) :: p(:)
15 real, pointer, intent(in
) :: p(:)
22 !PORTABILITY: CONTIGUOUS entity 'a01' should be an array pointer, assumed-shape, or assumed-rank
23 real, pointer, contiguous
:: a01
! C830
24 real, pointer :: a02(:)
25 real, target
:: a03(10)
26 real :: a04(10) ! not TARGET
27 !PORTABILITY: CONTIGUOUS entity 'scalar' should be an array pointer, assumed-shape, or assumed-rank
28 real, contiguous
:: scalar
30 !WARNING: Target of CONTIGUOUS pointer association is not known to be contiguous
32 !ERROR: CONTIGUOUS pointer may not be associated with a discontiguous target
36 !ERROR: Actual argument associated with POINTER dummy argument 'p=' must also be POINTER unless INTENT(IN)
38 !ERROR: Actual argument associated with POINTER dummy argument 'p=' must also be POINTER unless INTENT(IN)
40 !ERROR: An array section with a vector subscript may not be a pointer target
41 call s03(a03([1,2,4]))
42 !ERROR: A coindexed object may not be a pointer target
43 call s03(coarray(:)[1])
44 !ERROR: Target associated with dummy argument 'p=' must be a designator or a call to a pointer-valued function
46 !ERROR: In assignment to object dummy argument 'p=', the target 'a04' is not an object with POINTER or TARGET attributes