1 ! { dg-additional-options "-fdump-tree-gimple" }
5 implicit none (type, external)
6 integer(c_intptr_t
) :: intptr
8 ! { dg-final { scan-tree-dump-not "__builtin_stack_save" "gimple" } }
9 ! { dg-final { scan-tree-dump-not "__builtin_alloca" "gimple" } }
10 ! { dg-final { scan-tree-dump-not "__builtin_stack_restore" "gimple" } }
12 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_alloc \\(" 5 "gimple" } }
13 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_free \\(" 5 "gimple" } }
18 integer :: result
, n
, i
21 !$omp target map(tofrom: result) firstprivate(n)
23 integer :: var
, var2(n
)
24 !$omp allocate(var,var2) align(128) allocator(omp_low_lat_mem_alloc)
26 ! { dg-final { scan-tree-dump-times "var\\.\[0-9\]+ = __builtin_GOMP_alloc \\(128, 4, 5\\);" 1 "gimple" } } */
27 ! { dg-final { scan-tree-dump-times "var2 = __builtin_GOMP_alloc \\(128, D\\.\[0-9\]+, 5\\);" 1 "gimple" } } */
29 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_free \\(var\\.\[0-9\]+, 0B\\);" 1 "gimple" } } */
30 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_free \\(var2, 0B\\);" 1 "gimple" } } */
32 if (mod(transfer(loc(var
), intptr
), 128_c_intptr_t
) /= 0) &
34 if (mod(transfer(loc(var2
), intptr
), 128_c_intptr_t
) /= 0) &
44 !$omp parallel loop reduction(+:result)
46 result
= result
+ var
+ var2(i
)
49 if (result
/= (3*5 + 33 + 34 + 35)) &
57 integer :: scalar
, array(5), i
59 !$omp allocate(scalar, array, s)
60 ! { dg-final { scan-tree-dump-times "scalar\\.\[0-9\]+ = __builtin_GOMP_alloc \\(4, 4, 0B\\);" 1 "gimple" } }
61 ! { dg-final { scan-tree-dump-times "array\\.\[0-9\]+ = __builtin_GOMP_alloc \\(4, 20, 0B\\);" 1 "gimple" } }
62 ! { dg-final { scan-tree-dump-times "s\\.\[0-9\]+ = __builtin_GOMP_alloc \\(4, 8, 0B\\);" 1 "gimple" } }
63 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_free \\(scalar\\.\[0-9\]+, 0B\\);" 1 "gimple" } }
64 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_free \\(array\\.\[0-9\]+, 0B\\);" 1 "gimple" } }
65 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_free \\(s\\.\[0-9\]+, 0B\\);" 1 "gimple" } }
71 !$omp parallel firstprivate(scalar) firstprivate(array) firstprivate(s)
75 if (any (array
/= [1,2,3,4,5])) &
77 array
= [10,20,30,40,50]
78 if (s
%a
/= 11 .or
. s
%b
/= 56) &
86 if (any (array
/= [1,2,3,4,5])) &
88 if (s
%a
/= 11 .or
. s
%b
/= 56) &
91 !$omp target defaultmap(firstprivate : scalar) defaultmap(none : aggregate) defaultmap(none : pointer)
100 !$omp target defaultmap(none : scalar) defaultmap(firstprivate : aggregate) defaultmap(none : pointer) private(i)
101 if (any (array
/= [1,2,3,4,5])) &
108 if (any(array
/= [1,2,3,4,5])) &
110 !$omp target defaultmap(none : scalar) defaultmap(firstprivate : aggregate) defaultmap(none : pointer)
111 if (s
%a
/= 11 .or
. s
%b
/= 56) &
116 if (s
%a
/= 11 .or
. s
%b
/= 56) &