[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / OpenACC / acc-shutdown-validity.f90
blobde40963f99e048640b38ee517458a8182f239d10
1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc
3 ! Check OpenACC clause validity for the following construct and directive:
4 ! 2.14.2 Shutdown
6 program openacc_shutdown_validity
8 implicit none
10 integer :: i, j
11 integer, parameter :: N = 256
12 logical :: ifCondition = .TRUE.
13 real(8), dimension(N) :: a
15 !$acc parallel
16 !ERROR: Directive SHUTDOWN may not be called within a compute region
17 !$acc shutdown
18 !$acc end parallel
20 !$acc serial
21 !ERROR: Directive SHUTDOWN may not be called within a compute region
22 !$acc shutdown
23 !$acc end serial
25 !$acc kernels
26 !ERROR: Directive SHUTDOWN may not be called within a compute region
27 !$acc shutdown
28 !$acc end kernels
30 !$acc parallel
31 !$acc loop
32 do i = 1, N
33 !ERROR: Directive SHUTDOWN may not be called within a compute region
34 !$acc shutdown
35 a(i) = 3.14
36 end do
37 !$acc end parallel
39 !$acc serial
40 !$acc loop
41 do i = 1, N
42 !ERROR: Directive SHUTDOWN may not be called within a compute region
43 !$acc shutdown
44 a(i) = 3.14
45 end do
46 !$acc end serial
48 !$acc kernels
49 !$acc loop
50 do i = 1, N
51 !ERROR: Directive SHUTDOWN may not be called within a compute region
52 !$acc shutdown
53 a(i) = 3.14
54 end do
55 !$acc end kernels
57 !$acc parallel loop
58 do i = 1, N
59 !ERROR: Directive SHUTDOWN may not be called within a compute region
60 !$acc shutdown
61 a(i) = 3.14
62 end do
64 !$acc serial loop
65 do i = 1, N
66 !ERROR: Directive SHUTDOWN may not be called within a compute region
67 !$acc shutdown
68 a(i) = 3.14
69 end do
71 !$acc kernels loop
72 do i = 1, N
73 !ERROR: Directive SHUTDOWN may not be called within a compute region
74 !$acc shutdown
75 a(i) = 3.14
76 end do
78 !$acc shutdown
79 !$acc shutdown if(.TRUE.)
80 !$acc shutdown if(ifCondition)
81 !$acc shutdown device_num(1)
82 !$acc shutdown device_num(i)
83 !$acc shutdown device_type(i)
84 !$acc shutdown device_type(2, i, j)
85 !$acc shutdown device_num(i) device_type(i, j) if(ifCondition)
87 !ERROR: At most one IF clause can appear on the SHUTDOWN directive
88 !$acc shutdown if(.TRUE.) if(ifCondition)
90 !ERROR: At most one DEVICE_NUM clause can appear on the SHUTDOWN directive
91 !$acc shutdown device_num(1) device_num(i)
93 !ERROR: At most one DEVICE_TYPE clause can appear on the SHUTDOWN directive
94 !$acc shutdown device_type(2) device_type(i, j)
96 end program openacc_shutdown_validity