Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / OpenMP / copying.f90
blobf95227fd2ce4c70a5155d6b37200bd75be615a35
1 ! RUN: %python %S/../test_errors.py %s %flang -fopenmp -Werror
2 ! OpenMP Version 5.0
3 ! 2.19.4.4 firstprivate Clause
4 ! 2.19.4.5 lastprivate Clause
5 ! 2.19.6.1 copyin Clause
6 ! 2.19.6.2 copyprivate Clause
7 ! If the list item is a polymorphic variable with the allocatable attribute,
8 ! the behavior is unspecified.
10 subroutine firstprivate()
11 class(*), allocatable, save :: x
13 !PORTABILITY: If a polymorphic variable with allocatable attribute 'x' is in FIRSTPRIVATE clause, the behavior is unspecified
14 !$omp parallel firstprivate(x)
15 call sub()
16 !$omp end parallel
18 end
20 subroutine lastprivate()
21 class(*), allocatable, save :: x
23 !PORTABILITY: If a polymorphic variable with allocatable attribute 'x' is in LASTPRIVATE clause, the behavior is unspecified
24 !$omp do lastprivate(x)
25 do i = 1, 10
26 call sub()
27 enddo
28 !$omp end do
30 end
32 subroutine copyin()
33 class(*), allocatable, save :: x
34 !$omp threadprivate(x)
36 !PORTABILITY: If a polymorphic variable with allocatable attribute 'x' is in COPYIN clause, the behavior is unspecified
37 !$omp parallel copyin(x)
38 call sub()
39 !$omp end parallel
41 end
43 subroutine copyprivate()
44 class(*), allocatable, save :: x
45 !$omp threadprivate(x)
47 !PORTABILITY: If a polymorphic variable with allocatable attribute 'x' is in COPYPRIVATE clause, the behavior is unspecified
48 !$omp single copyprivate(x)
49 call sub()
50 !$omp end single
52 end