Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / pointer01.f90
blobb6a66b61fe25e221c2192b3f1c53f534695d32f5
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 module m
3 real mobj
4 contains
5 subroutine msubr
6 end subroutine
7 end module
8 program main
9 use m
10 !PORTABILITY: Name 'main' declared in a main program should not have the same name as the main program
11 pointer main
12 !ERROR: Cannot change POINTER attribute on use-associated 'mobj'
13 pointer mobj
14 !ERROR: Cannot change POINTER attribute on use-associated 'msubr'
15 pointer msubr
16 !ERROR: 'inner' cannot have the POINTER attribute
17 pointer inner
18 real obj
19 !ERROR: 'ip' may not have both the POINTER and PARAMETER attributes
20 integer, parameter :: ip = 123
21 pointer ip
22 type dt; end type
23 !ERROR: 'dt' cannot have the POINTER attribute
24 pointer dt
25 interface generic
26 subroutine extsub
27 end subroutine
28 end interface
29 !ERROR: 'generic' cannot have the POINTER attribute
30 pointer generic
31 namelist /nml/ obj
32 !ERROR: 'nml' cannot have the POINTER attribute
33 pointer nml
34 contains
35 subroutine inner
36 end subroutine
37 end