2 ! { dg-additional-options "-fdump-tree-original" }
5 !$omp declare target device_type (any) ! { dg-warning "OMP DECLARE TARGET directive at .1. with only DEVICE_TYPE clause is ignored" }
9 !$omp declare target to (f2) device_type (any)
13 !$omp declare target device_type (any) to (f3)
17 !$omp declare target device_type (host) to (f4)
21 !$omp declare target device_type (nohost) to (f5)
25 !$omp declare target enter (f6) device_type (any)
29 ! device_type is ignored for variables in OpenMP 5.0
30 ! but TR8 and later apply those rules to variables as well
32 integer :: a
, b(4), c
, d
34 integer :: m
, n
, o
, p
, q
, r
, s
, t
, u
, v
, w
, x
42 !$omp declare target to(a) device_type(nohost)
43 !$omp declare target to(b) device_type(host)
44 !$omp declare target to(c) device_type(any)
45 ! Fails in ME with "Error: wrong number of arguments specified for 'omp declare target link' attribute"
46 ! !$omp declare target link(e) device_type(nohost)
47 ! !$omp declare target link(f) device_type(host)
48 ! !$omp declare target link(g) device_type(any)
50 !$omp declare target to(/block1/) device_type(nohost)
51 !$omp declare target to(/block2/) device_type(host)
52 !$omp declare target to(/block3/) device_type(any)
53 !$omp declare target link(/block4/) device_type(nohost)
54 !$omp declare target link(/block5/) device_type(host)
55 !$omp declare target link(/block6/) device_type(any)
58 !$omp declare target to (s1) device_type (any)
61 !$omp declare target to (s2) device_type (nohost)
64 !$omp declare target to (s3) device_type (host)
72 private
:: s1
, s2
, s3
, a
, b
, c
, d
, e
, f
, g
73 public
:: m
, n
, o
, p
, q
, r
, s
, t
, u
, v
, w
, x
76 ! { dg-final { scan-tree-dump-times "omp declare target" 8 "original" } }
77 ! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target \\(device_type\\(" 8 "original" } }
78 ! { dg-final { scan-tree-dump-not "__attribute__\\(\\(omp declare target \[^\n\r\]*\[\n\r\]void f1" "original" } }
79 ! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target \\(device_type\\(any\\)\\)\\)\\)\[\n\r]__attribute__\[^\n\r]+\[\n\r]void f2" 1 "original" } }
80 ! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target \\(device_type\\(any\\)\\)\\)\\)\[\n\r]__attribute__\[^\n\r]+\[\n\r\]void f3" 1 "original" } }
81 ! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target \\(device_type\\(host\\)\\)\\)\\)\[\n\r]__attribute__\[^\n\r]+\[\n\r\]void f4" 1 "original" } }
82 ! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target \\(device_type\\(nohost\\)\\)\\)\\)\[\n\r]__attribute__\[^\n\r]+\[\n\r\]void f5" 1 "original" } }
83 ! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target \\(device_type\\(any\\)\\)\\)\\)\[\n\r]__attribute__\[^\n\r]+\[\n\r]void f6" 1 "original" } }
84 ! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target \\(device_type\\(any\\)\\)\\)\\)\[\n\r]__attribute__\[^\n\r]+\[\n\r\]void s1" 1 "original" } }
85 ! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target \\(device_type\\(nohost\\)\\)\\)\\)\[\n\r]__attribute__\[^\n\r]+\[\n\r\]void s2" 1 "original" } }
86 ! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target \\(device_type\\(host\\)\\)\\)\\)\[\n\r]__attribute__\[^\n\r]+\[\n\r\]void s3" 1 "original" } }