Debian Codegraph @

gcc/testsuite/gfortran.dg/goacc/pr109622-5.f90

raw
1 ! { dg-do compile }
2
3 implicit none
4
5 type t
6 integer :: foo
7 character(len=8) :: bar
8 integer :: qux(5)
9 end type t
10
11 type(t) :: var
12
13 var%foo = 3
14 var%bar = "HELLOOMP"
15 var%qux = (/ 1, 2, 3, 4, 5 /)
16
17 !$acc enter data copyin(var)
18
19 !$acc enter data attach(var%foo)
20 ! { dg-error "'attach' clause argument must be ALLOCATABLE or a POINTER" "" { target *-*-* } .-1 }
21 !$acc enter data attach(var%bar)
22 ! { dg-error "'attach' clause argument must be ALLOCATABLE or a POINTER" "" { target *-*-* } .-1 }
23 !$acc enter data attach(var%qux)
24 ! { dg-error "'attach' clause argument must be ALLOCATABLE or a POINTER" "" { target *-*-* } .-1 }
25
26 !$acc serial
27 var%foo = 5
28 var%bar = "GOODBYE!"
29 var%qux = (/ 6, 7, 8, 9, 10 /)
30 !$acc end serial
31
32 !$acc exit data detach(var%qux)
33 ! { dg-error "'detach' clause argument must be ALLOCATABLE or a POINTER" "" { target *-*-* } .-1 }
34 !$acc exit data detach(var%bar)
35 ! { dg-error "'detach' clause argument must be ALLOCATABLE or a POINTER" "" { target *-*-* } .-1 }
36 !$acc exit data detach(var%foo)
37 ! { dg-error "'detach' clause argument must be ALLOCATABLE or a POINTER" "" { target *-*-* } .-1 }
38
39 !$acc exit data copyout(var)
40
41 if (var%foo.ne.5) stop 1
42 if (var%bar.ne."GOODBYE!") stop 2
43
44 end