97 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenacc2 3! Check OpenACC clause validity for the following construct and directive:4! 2.14.2 Shutdown5 6program openacc_shutdown_validity7 8 implicit none9 10 integer :: i, j11 integer, parameter :: N = 25612 logical :: ifCondition = .TRUE.13 real(8), dimension(N) :: a14 15 !$acc parallel16 !ERROR: Directive SHUTDOWN may not be called within a compute region17 !$acc shutdown18 !$acc end parallel19 20 !$acc serial21 !ERROR: Directive SHUTDOWN may not be called within a compute region22 !$acc shutdown23 !$acc end serial24 25 !$acc kernels26 !ERROR: Directive SHUTDOWN may not be called within a compute region27 !$acc shutdown28 !$acc end kernels29 30 !$acc parallel31 !$acc loop32 do i = 1, N33 !ERROR: Directive SHUTDOWN may not be called within a compute region34 !$acc shutdown35 a(i) = 3.14d036 end do37 !$acc end parallel38 39 !$acc serial40 !$acc loop41 do i = 1, N42 !ERROR: Directive SHUTDOWN may not be called within a compute region43 !$acc shutdown44 a(i) = 3.14d045 end do46 !$acc end serial47 48 !$acc kernels49 !$acc loop50 do i = 1, N51 !ERROR: Directive SHUTDOWN may not be called within a compute region52 !$acc shutdown53 a(i) = 3.14d054 end do55 !$acc end kernels56 57 !$acc parallel loop58 do i = 1, N59 !ERROR: Directive SHUTDOWN may not be called within a compute region60 !$acc shutdown61 a(i) = 3.14d062 end do63 64 !$acc serial loop65 do i = 1, N66 !ERROR: Directive SHUTDOWN may not be called within a compute region67 !$acc shutdown68 a(i) = 3.14d069 end do70 71 !$acc kernels loop72 do i = 1, N73 !ERROR: Directive SHUTDOWN may not be called within a compute region74 !$acc shutdown75 a(i) = 3.14d076 end do77 78 !$acc shutdown79 !$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(*)84 !$acc shutdown device_type(*, default, host)85 !$acc shutdown device_num(i) device_type(default, host) if(ifCondition)86 87 !ERROR: At most one IF clause can appear on the SHUTDOWN directive88 !$acc shutdown if(.TRUE.) if(ifCondition)89 90 !ERROR: At most one DEVICE_NUM clause can appear on the SHUTDOWN directive91 !$acc shutdown device_num(1) device_num(i)92 93 ! OK94 !$acc shutdown device_type(*) device_type(host, default)95 96end program openacc_shutdown_validity97