1! PR middle-end/44085
2! { dg-do compile }
3! { dg-require-effective-target tls_native }
4! { dg-options "-fopenmp" }
5
6  integer, save :: thr1, thr2
7  integer :: thr3, thr4
8  common /thrs/ thr3, thr4
9!$omp threadprivate (thr1, thr2, /thrs/)
10
11!$omp task untied		! { dg-error "enclosing task" }
12  thr1 = thr1 + 1		! { dg-error "used in untied task" }
13  thr2 = thr2 + 2		! { dg-error "used in untied task" }
14  thr3 = thr3 + 3		! { dg-error "used in untied task" }
15  thr4 = thr4 + 4		! { dg-error "used in untied task" }
16!$omp end task
17
18!$omp task
19  thr1 = thr1 + 1
20  thr2 = thr2 + 2
21  thr3 = thr3 + 3
22  thr4 = thr4 + 4
23!$omp end task
24
25  end
26