[AMDGPU] Test codegen'ing True16 additions.
[llvm-project.git] / flang / test / Semantics / declarations06.f90
blob532b0461d391e621271fc6ee1c8ee54d869d6324
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! A CLASS() entity must be a dummy argument, allocatable,
3 ! or object pointer. Don't get confused with procedure pointers.
4 module m
5 type t
6 end type
7 !ERROR: CLASS entity 'v1' must be a dummy argument, allocatable, or object pointer
8 class(t) v1
9 class(t), allocatable :: v2 ! ok
10 class(t), pointer :: v3 ! ok
11 !ERROR: CLASS entity 'p1' must be a dummy argument, allocatable, or object pointer
12 procedure(cf1) :: p1
13 procedure(cf2) :: p2
14 procedure(cf3) :: p3
15 !ERROR: CLASS entity 'pp1' must be a dummy argument, allocatable, or object pointer
16 procedure(cf1), pointer :: pp1
17 procedure(cf2), pointer :: pp2
18 procedure(cf3), pointer :: pp3
19 contains
20 !ERROR: CLASS entity 'cf1' must be a dummy argument, allocatable, or object pointer
21 class(t) function cf1()
22 end
23 class(t) function cf2()
24 allocatable cf2 ! ok
25 end
26 class(t) function cf3()
27 pointer cf3 ! ok
28 end
29 subroutine test(d1,d2,d3)
30 class(t) d1 ! ok
31 !ERROR: CLASS entity 'd2' must be a dummy argument, allocatable, or object pointer
32 class(t), external :: d2
33 !ERROR: CLASS entity 'd3' must be a dummy argument, allocatable, or object pointer
34 class(t), external, pointer :: d3
35 end
36 end