coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / gomp / allocatable_components_1.f90
blobbc06cc8662ccabbdd1964b65602f7e5a7c8e0d8c
1 ! { dg-do compile }
3 ! PR fortran/32467
4 ! Derived types with allocatable components
7 MODULE test_allocatable_components
8 type :: t
9 integer, allocatable :: a(:)
10 end type
12 CONTAINS
13 SUBROUTINE test_copyin()
14 TYPE(t), SAVE :: a
16 !$omp threadprivate(a)
17 !$omp parallel copyin(a)
18 ! do something
19 !$omp end parallel
20 END SUBROUTINE
22 SUBROUTINE test_copyprivate()
23 TYPE(t) :: a
25 !$omp single
26 ! do something
27 !$omp end single copyprivate (a)
28 END SUBROUTINE
30 SUBROUTINE test_firstprivate
31 TYPE(t) :: a
33 !$omp parallel firstprivate(a)
34 ! do something
35 !$omp end parallel
36 END SUBROUTINE
38 SUBROUTINE test_lastprivate
39 TYPE(t) :: a
40 INTEGER :: i
42 !$omp parallel do lastprivate(a)
43 DO i = 1, 1
44 END DO
45 !$omp end parallel do
46 END SUBROUTINE
48 SUBROUTINE test_reduction
49 TYPE(t) :: a(10)
50 INTEGER :: i
52 !$omp parallel do reduction(+: a) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" }
53 DO i = 1, SIZE(a)
54 END DO
55 !$omp end parallel do
56 END SUBROUTINE
57 END MODULE