]> git.ipfire.org Git - thirdparty/gcc.git/blob - libgomp/testsuite/libgomp.oacc-fortran/derivedtype-2.f95
OpenACC 2.6 deep copy: Fortran execution tests
[thirdparty/gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / derivedtype-2.f95
1 ! { dg-do run }
2
3 program main
4 implicit none
5
6 type tnest
7 integer :: ia, ib, ic
8 end type tnest
9
10 type mytype
11 type(tnest) :: nest
12 integer :: a, b, c
13 end type mytype
14
15 type(mytype) :: myvar
16 integer :: i
17
18 myvar%a = 0
19 myvar%b = 0
20 myvar%c = 0
21 myvar%nest%ia = 0
22 myvar%nest%ib = 0
23 myvar%nest%ic = 0
24
25 !$acc enter data copyin(myvar%nest)
26
27 !$acc parallel present(myvar%nest)
28 myvar%nest%ia = 4
29 myvar%nest%ib = 5
30 myvar%nest%ic = 6
31 !$acc end parallel
32
33 !$acc exit data copyout(myvar%nest)
34
35 if (myvar%a .ne. 0) stop 1
36 if (myvar%b .ne. 0) stop 2
37 if (myvar%c .ne. 0) stop 3
38 if (myvar%nest%ia .ne. 4) stop 4
39 if (myvar%nest%ib .ne. 5) stop 5
40 if (myvar%nest%ic .ne. 6) stop 6
41 end program main