summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/gomp/pr44085.f90
blob: db8fbbc9544f0d0a628a8a1406adccb3b39e2f5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
! PR middle-end/44085
! { dg-do compile }
! { dg-require-effective-target tls_native }
! { dg-options "-fopenmp" }

  integer, save :: thr1, thr2
  integer :: thr3, thr4
  common /thrs/ thr3, thr4
!$omp threadprivate (thr1, thr2, /thrs/)

!$omp task untied		! { dg-error "enclosing task" }
  thr1 = thr1 + 1		! { dg-error "used in untied task" }
  thr2 = thr2 + 2		! { dg-error "used in untied task" }
  thr3 = thr3 + 3		! { dg-error "used in untied task" }
  thr4 = thr4 + 4		! { dg-error "used in untied task" }
!$omp end task

!$omp task
  thr1 = thr1 + 1
  thr2 = thr2 + 2
  thr3 = thr3 + 3
  thr4 = thr4 + 4
!$omp end task

  end