1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
3 ! Tests valid and invalid NULL initializers
7 !ERROR: No explicit type declared for 'null'
14 integer, pointer :: p
=> null()
19 integer, pointer :: p
=> null()
24 integer, pointer :: p
=> null()
29 !ERROR: Pointer initializer must be intrinsic NULL()
30 integer, pointer :: p
=> null()
34 !ERROR: Symbol 'null' cannot have both INTRINSIC and EXTERNAL attributes
35 integer, pointer :: p
=> null()
41 function null() result(p
)
45 !ERROR: Pointer initializer must be intrinsic NULL()
46 integer, pointer :: p
=> null()
50 integer, pointer :: p
=> null()
52 !ERROR: 'null' is already declared in this scoping unit
53 function null() result(p
)
63 integer, pointer :: foo
68 use m9a
, renamed
=> null
, null
=> foo
69 integer, pointer :: p
=> renamed()
70 !ERROR: Pointer initializer must be intrinsic NULL()
71 integer, pointer :: q
=> null()
72 integer, pointer :: d1
, d2
74 !ERROR: An initial data target must be a designator with constant subscripts