Debian Codegraph @

flang/test/Semantics/OpenMP/allocate07.f90

raw
1 ! REQUIRES: openmp_runtime
2
3 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
4 ! OpenMP Version 5.0
5 ! 2.11.3 allocate Directive
6 ! A type parameter inquiry cannot appear in an allocate directive.
7
8 subroutine allocate()
9 use omp_lib
10 type my_type(kind_param, len_param)
11 INTEGER, KIND :: kind_param
12 INTEGER, LEN :: len_param
13 INTEGER :: array(10)
14 end type
15
16 type(my_type(2, 4)) :: my_var
17 INTEGER(KIND=4) :: x
18 CHARACTER(LEN=32) :: w
19 INTEGER, DIMENSION(:), ALLOCATABLE :: y
20
21 !ERROR: A type parameter inquiry cannot appear on the ALLOCATE directive
22 !$omp allocate(x%KIND)
23
24 !ERROR: A type parameter inquiry cannot appear on the ALLOCATE directive
25 !$omp allocate(w%LEN)
26
27 !ERROR: A type parameter inquiry cannot appear on the ALLOCATE directive
28 !$omp allocate(y%KIND)
29
30 !ERROR: A type parameter inquiry cannot appear on the ALLOCATE directive
31 !$omp allocate(my_var%kind_param)
32
33 !ERROR: A type parameter inquiry cannot appear on the ALLOCATE directive
34 !$omp allocate(my_var%len_param)
35
36 end subroutine allocate
37