Debian Codegraph @

gcc/testsuite/gfortran.dg/gomp/declare-target-5.f90

raw
1 subroutine foo()
2 !$omp declare target to(foo) device_type(bar) ! { dg-error "Expected HOST, NOHOST or ANY" }
3 end
4
5 subroutine bar()
6 !$omp declare target to(bar) device_type(nohost)
7 !$omp declare target to(bar) device_type(host) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" }
8 end
9
10 module mymod_one
11 implicit none
12 integer :: a, b, c, d, e ,f
13 integer :: m, n, o, p, q, r
14 common /block1/ m, n
15 common /block2/ o, p
16 common /block3/ q, r
17 !$omp declare target to(a) device_type(nohost)
18 !$omp declare target to(b) device_type(any)
19 !$omp declare target to(c) device_type(host)
20 !$omp declare target link(d) device_type(nohost)
21 !$omp declare target link(e) device_type(any)
22 !$omp declare target link(f) device_type(host)
23
24 !$omp declare target to(c) device_type(host)
25 !$omp declare target link(d) device_type(nohost)
26 end module
27
28 module mtest
29 use mymod_one ! { dg-error "Cannot change attributes of USE-associated symbol" }
30 implicit none
31
32 !$omp declare target to(a) device_type(any) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" }
33 !$omp declare target to(b) device_type(host) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" }
34 !$omp declare target to(c) device_type(nohost) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" }
35 !$omp declare target link(d) device_type(host) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" }
36 !$omp declare target link(e) device_type(nohost) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" }
37 !$omp declare target link(f) device_type(any) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" }
38 end module
39
40 module mymod
41 implicit none
42 integer :: a, b, c, d, e ,f
43 integer :: m, n, o, p, q, r
44 common /block1/ m, n
45 common /block2/ o, p
46 common /block3/ q, r
47 !$omp declare target to(a) device_type(nohost)
48 !$omp declare target to(b) device_type(any)
49 !$omp declare target to(c) device_type(host)
50 !$omp declare target link(d) device_type(nohost)
51 !$omp declare target link(e) device_type(any)
52 !$omp declare target link(f) device_type(host)
53
54 !$omp declare target to(c) device_type(host)
55 !$omp declare target link(d) device_type(nohost)
56
57 !$omp declare target to(a) device_type(any) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" }
58 !$omp declare target to(b) device_type(host) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" }
59 !$omp declare target to(c) device_type(nohost) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" }
60 !$omp declare target link(d) device_type(host) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" }
61 !$omp declare target link(e) device_type(nohost) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" }
62 !$omp declare target link(f) device_type(any) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" }
63 end