]> oss.titaniummirror.com Git - msp430-gcc.git/blobdiff - libgomp/testsuite/libgomp.fortran/threadprivate1.f90
Imported gcc-4.4.3
[msp430-gcc.git] / libgomp / testsuite / libgomp.fortran / threadprivate1.f90
diff --git a/libgomp/testsuite/libgomp.fortran/threadprivate1.f90 b/libgomp/testsuite/libgomp.fortran/threadprivate1.f90
new file mode 100644 (file)
index 0000000..3216142
--- /dev/null
@@ -0,0 +1,21 @@
+! { dg-do run }
+! { dg-require-effective-target tls_runtime }
+
+module threadprivate1
+  double precision :: d
+!$omp threadprivate (d)
+end module threadprivate1
+
+!$ use omp_lib
+  use threadprivate1
+  logical :: l
+  l = .false.
+!$omp parallel num_threads (4) reduction (.or.:l)
+  d = omp_get_thread_num () + 6.5
+!$omp barrier
+  if (d .ne. omp_get_thread_num () + 6.5) l = .true.
+!$omp end parallel
+  if (l) call abort ()
+end
+
+! { dg-final { cleanup-modules "threadprivate1" } }