Simplify comparison of attrs in IPA ICF.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / map-1.f90
blob47859508c8f748782a8dbcaf5d9b09ef73e1e224
1 program map
2 integer, parameter :: n = 20, c = 10
3 integer :: i, a(n), b(n)
5 a(:) = 0
6 b(:) = 0
8 ! COPY
10 !$acc parallel copy (a)
11 !$acc loop
12 do i = 1, n
13 a(i) = i
14 end do
15 !$acc end parallel
17 do i = 1, n
18 b(i) = i
19 end do
21 call check (a, b, n)
23 ! COPYOUT
25 a(:) = 0
27 !$acc parallel copyout (a)
28 !$acc loop
29 do i = 1, n
30 a(i) = i
31 end do
32 !$acc end parallel
34 do i = 1, n
35 if (a(i) .ne. b(i)) STOP 1
36 end do
37 call check (a, b, n)
39 ! COPYIN
41 a(:) = 0
43 !$acc parallel copyout (a) copyin (b)
44 !$acc loop
45 do i = 1, n
46 a(i) = i
47 end do
48 !$acc end parallel
50 call check (a, b, n)
52 ! PRESENT_OR_COPY
54 !$acc parallel pcopy (a)
55 !$acc loop
56 do i = 1, n
57 a(i) = i
58 end do
59 !$acc end parallel
61 call check (a, b, n)
63 ! PRESENT_OR_COPYOUT
65 a(:) = 0
67 !$acc parallel pcopyout (a)
68 !$acc loop
69 do i = 1, n
70 a(i) = i
71 end do
72 !$acc end parallel
74 call check (a, b, n)
76 ! PRESENT_OR_COPYIN
78 a(:) = 0
80 !$acc parallel pcopyout (a) pcopyin (b)
81 !$acc loop
82 do i = 1, n
83 a(i) = i
84 end do
85 !$acc end parallel
87 call check (a, b, n)
88 end program map
90 subroutine check (a, b, n)
91 integer :: n, a(n), b(n)
92 integer :: i
94 do i = 1, n
95 if (a(i) .ne. b(i)) STOP 2
96 end do
97 end subroutine check