[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / OpenACC / acc-shutdown-validity.f90
blob31fa3c9daf3daf2d69ce3659e1eaec9f56a52312
1 ! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
2 ! REQUIRES: shell
4 ! Check OpenACC clause validity for the following construct and directive:
5 ! 2.14.2 Shutdown
7 program openacc_shutdown_validity
9 implicit none
11 integer :: i, j
12 integer, parameter :: N = 256
13 logical :: ifCondition = .TRUE.
14 real(8), dimension(N) :: a
16 !$acc parallel
17 !ERROR: Directive SHUTDOWN may not be called within a compute region
18 !$acc shutdown
19 !$acc end parallel
21 !$acc serial
22 !ERROR: Directive SHUTDOWN may not be called within a compute region
23 !$acc shutdown
24 !$acc end serial
26 !$acc kernels
27 !ERROR: Directive SHUTDOWN may not be called within a compute region
28 !$acc shutdown
29 !$acc end kernels
31 !$acc parallel
32 !$acc loop
33 do i = 1, N
34 !ERROR: Directive SHUTDOWN may not be called within a compute region
35 !$acc shutdown
36 a(i) = 3.14
37 end do
38 !$acc end parallel
40 !$acc serial
41 !$acc loop
42 do i = 1, N
43 !ERROR: Directive SHUTDOWN may not be called within a compute region
44 !$acc shutdown
45 a(i) = 3.14
46 end do
47 !$acc end serial
49 !$acc kernels
50 !$acc loop
51 do i = 1, N
52 !ERROR: Directive SHUTDOWN may not be called within a compute region
53 !$acc shutdown
54 a(i) = 3.14
55 end do
56 !$acc end kernels
58 !$acc parallel loop
59 do i = 1, N
60 !ERROR: Directive SHUTDOWN may not be called within a compute region
61 !$acc shutdown
62 a(i) = 3.14
63 end do
65 !$acc serial loop
66 do i = 1, N
67 !ERROR: Directive SHUTDOWN may not be called within a compute region
68 !$acc shutdown
69 a(i) = 3.14
70 end do
72 !$acc kernels loop
73 do i = 1, N
74 !ERROR: Directive SHUTDOWN may not be called within a compute region
75 !$acc shutdown
76 a(i) = 3.14
77 end do
79 !$acc shutdown
80 !$acc shutdown if(.TRUE.)
81 !$acc shutdown if(ifCondition)
82 !$acc shutdown device_num(1)
83 !$acc shutdown device_num(i)
84 !$acc shutdown device_type(i)
85 !$acc shutdown device_type(2, i, j)
86 !$acc shutdown device_num(i) device_type(i, j) if(ifCondition)
88 !ERROR: At most one IF clause can appear on the SHUTDOWN directive
89 !$acc shutdown if(.TRUE.) if(ifCondition)
91 !ERROR: At most one DEVICE_NUM clause can appear on the SHUTDOWN directive
92 !$acc shutdown device_num(1) device_num(i)
94 !ERROR: At most one DEVICE_TYPE clause can appear on the SHUTDOWN directive
95 !$acc shutdown device_type(2) device_type(i, j)
97 end program openacc_shutdown_validity