1 ! RUN: %python %S/test_errors.py %s %flang_fc1
8 subroutine test(assumedType
, poly
, nclen
)
9 type(*), target
:: assumedType
10 class(*), target
:: poly
14 !PORTABILITY: Procedure pointer 'pptr' should not have an ELEMENTAL intrinsic as its interface
15 procedure(sin
), pointer :: pptr
16 real, target
:: arr(3)
17 type(hasLen(1)), target
:: clen
18 type(hasLen(*)), target
:: nclen
19 character(2), target
:: ch
20 !ERROR: C_LOC() argument must be a data pointer or target
21 cp
= c_loc(notATarget
)
22 !ERROR: C_LOC() argument must be a data pointer or target
24 !ERROR: C_LOC() argument must be contiguous
25 cp
= c_loc(arr(1:3:2))
26 !ERROR: C_LOC() argument may not be a zero-sized array
28 !ERROR: C_LOC() argument must have an intrinsic type, assumed type, or non-polymorphic derived type with no non-constant length parameter
31 !ERROR: C_LOC() argument must have an intrinsic type, assumed type, or non-polymorphic derived type with no non-constant length parameter
33 !ERROR: C_LOC() argument may not be zero-length character
35 !WARNING: C_LOC() argument has non-interoperable intrinsic type, kind, or length
37 cp
= c_loc(ch(1:1)) ! ok)
38 !ERROR: PRIVATE name '__address' is only accessible within module '__fortran_builtins'
40 !ERROR: PRIVATE name '__address' is only accessible within module '__fortran_builtins'
42 !ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches operand types TYPE(c_ptr) and TYPE(c_funptr)
44 !ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches operand types TYPE(c_funptr) and TYPE(c_ptr)