Debian Codegraph @

gcc/testsuite/gfortran.dg/gomp/allocate-8.f90

raw
1 ! { dg-additional-options "-fdump-tree-original" }
2
3 module m
4 use iso_c_binding
5 !use omp_lib, only: omp_allocator_handle_kind
6 implicit none
7 integer, parameter :: omp_allocator_handle_kind = c_intptr_t
8 integer :: a = 0, b = 42, c = 0
9
10 contains
11 integer(omp_allocator_handle_kind) function get_alloc()
12 allocatable :: get_alloc
13 get_alloc = 2_omp_allocator_handle_kind
14 end
15 subroutine foo ()
16 !$omp scope private (a) firstprivate (b) reduction (+: c) allocate ( get_alloc() : a , b , c)
17 if (b /= 42) &
18 error stop
19 a = 36
20 b = 15
21 c = c + 1
22 !$omp end scope
23 end
24 end
25
26 ! { dg-final { scan-tree-dump "omp scope private\\(a\\) firstprivate\\(b\\) reduction\\(\\+:c\\) allocate\\(allocator\\(D\\.\[0-9\]+\\):a\\) allocate\\(allocator\\(D\\.\[0-9\]+\\):b\\) allocate\\(allocator\\(D\\.\[0-9\]+\\):c\\)" "original" } }
27
28 ! { dg-final { scan-tree-dump-times "D\\.\[0-9\]+ = get_alloc \\(\\);\[\n\r\]+ *D\\.\[0-9\]+ = \\*D\\.\[0-9\]+;\[\n\r\]+ *__builtin_free \\(\\(void \\*\\) D\\.\[0-9\]+\\);" 1 "original" } }
29