[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / OpenACC / acc-routine-validity.f90
blob83583fcabf8f79e9a70d405ebd000c36fc734b10
1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc
3 ! Check OpenACC clause validity for the following construct and directive:
4 ! 2.15.1 routine
6 module openacc_routine_validity
7 implicit none
9 !$acc routine(sub3) seq
11 !$acc routine(fct2) vector
13 !ERROR: At least one of GANG, SEQ, VECTOR, WORKER clause must appear on the ROUTINE directive
14 !$acc routine(sub3)
16 !ERROR: ROUTINE directive without name must appear within the specification part of a subroutine or function definition, or within an interface body for a subroutine or function in an interface block
17 !$acc routine seq
19 !ERROR: No function or subroutine declared for 'dummy'
20 !$acc routine(dummy) seq
22 contains
24 subroutine sub1(a)
25 real :: a(:)
26 !ERROR: At least one of GANG, SEQ, VECTOR, WORKER clause must appear on the ROUTINE directive
27 !$acc routine
28 end subroutine sub1
30 subroutine sub2(a)
31 real :: a(:)
32 !ERROR: Clause NOHOST is not allowed after clause DEVICE_TYPE on the ROUTINE directive
33 !$acc routine seq device_type(*) nohost
34 end subroutine sub2
36 subroutine sub3(a)
37 real :: a(:)
38 end subroutine sub3
40 subroutine sub4(a)
41 real :: a(:)
42 !$acc routine seq
43 end subroutine sub4
45 subroutine sub5(a)
46 real :: a(:)
47 !$acc routine(sub5) seq
48 end subroutine sub5
50 function fct1(a)
51 integer :: fct1
52 real :: a(:)
53 !$acc routine vector nohost
54 end function fct1
56 function fct2(a)
57 integer :: fct2
58 real :: a(:)
59 end function fct2
61 function fct3(a)
62 integer :: fct3
63 real :: a(:)
64 !$acc routine seq bind(fct2)
65 end function fct3
67 function fct4(a)
68 integer :: fct4
69 real :: a(:)
70 !$acc routine seq bind("_fct4")
71 end function fct4
73 subroutine sub6(a)
74 real :: a(:)
75 !ERROR: No function or subroutine declared for 'dummy_sub'
76 !$acc routine seq bind(dummy_sub)
77 end subroutine sub6
79 end module openacc_routine_validity