new file mode 100644
@@ -0,0 +1,6 @@
+/* { dg-require-effective-target fopenmp } */
+/* { dg-do preprocess } */
+
+#ifdef _OPENMP
+# error _OPENMP defined
+#endif
new file mode 100644
@@ -0,0 +1,7 @@
+/* { dg-require-effective-target fopenmp } */
+/* { dg-options "-fno-openmp" } */
+/* { dg-do preprocess } */
+
+#ifdef _OPENMP
+# error _OPENMP defined
+#endif
new file mode 100644
@@ -0,0 +1,11 @@
+/* { dg-require-effective-target fopenmp } */
+/* { dg-options "-fopenmp" } */
+/* { dg-do preprocess } */
+
+#ifndef _OPENMP
+# error _OPENMP not defined
+#endif
+
+#if _OPENMP != 201107
+# error _OPENMP defined to wrong value
+#endif
new file mode 100644
@@ -0,0 +1,7 @@
+! { dg-require-effective-target fopenmp }
+! { dg-options "-cpp" }
+! { dg-do preprocess }
+
+#ifdef _OPENMP
+# error _OPENMP defined
+#endif
new file mode 100644
@@ -0,0 +1,7 @@
+! { dg-require-effective-target fopenmp }
+! { dg-options "-cpp -fno-openmp" }
+! { dg-do preprocess }
+
+#ifdef _OPENMP
+# error _OPENMP defined
+#endif
new file mode 100644
@@ -0,0 +1,11 @@
+! { dg-require-effective-target fopenmp }
+! { dg-options "-cpp -fopenmp" }
+! { dg-do preprocess }
+
+#ifndef _OPENMP
+# error _OPENMP not defined
+#endif
+
+#if _OPENMP != 201107
+# error _OPENMP defined to wrong value
+#endif
new file mode 100644
@@ -0,0 +1,9 @@
+! { dg-do run }
+
+ program main
+ implicit none
+ include "omp_lib.h"
+
+ if (openmp_version .ne. 201107) call abort;
+
+ end program main
new file mode 100644
@@ -0,0 +1,9 @@
+! { dg-do run }
+
+program main
+ use omp_lib
+ implicit none
+
+ if (openmp_version .ne. 201107) call abort;
+
+end program main
libgomp/
* configure.ac: Typo fix.
* configure: Regenerate.
---
libgomp/configure | 2 +-
libgomp/configure.ac | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
@@ -238,7 +238,7 @@ fi
# See if we support thread-local storage.
GCC_CHECK_TLS
-# See what sort of export controls are availible.
+# See what sort of export controls are available.
LIBGOMP_CHECK_ATTRIBUTE_VISIBILITY
LIBGOMP_CHECK_ATTRIBUTE_DLLEXPORT
LIBGOMP_CHECK_ATTRIBUTE_ALIAS
gcc/
* tree.h (OMP_CLAUSE_CODE): Remove duplicate definition.
---
gcc/tree.h | 3 ---
1 file changed, 3 deletions(-)
@@ -1351,9 +1351,6 @@ extern void protected_set_expr_location (tree, location_t);
#define OMP_CLAUSE_SET_CODE(NODE, CODE) \
((OMP_CLAUSE_CHECK (NODE))->omp_clause.code = (CODE))
-#define OMP_CLAUSE_CODE(NODE) \
- (OMP_CLAUSE_CHECK (NODE))->omp_clause.code
-
#define OMP_CLAUSE_OPERAND(NODE, I) \
OMP_CLAUSE_ELT_CHECK (NODE, I)
libgomp/
* testsuite/libgomp.c/lib-1.c (main): Add missing error check.
* testsuite/libgomp.fortran/lib1.f90: Likewise.
* testsuite/libgomp.fortran/lib2.f: Likewise.
* testsuite/libgomp.fortran/lib3.f: Likewise.
---
libgomp/testsuite/libgomp.c/lib-1.c | 2 ++
libgomp/testsuite/libgomp.fortran/lib1.f90 | 1 +
libgomp/testsuite/libgomp.fortran/lib2.f | 1 +
libgomp/testsuite/libgomp.fortran/lib3.f | 1 +
4 files changed, 5 insertions(+)
@@ -85,6 +85,8 @@ main (void)
l = ! omp_in_parallel ();
#pragma omp parallel reduction (|:l) if (1)
l = ! omp_in_parallel ();
+ if (l)
+ abort ();
e = omp_get_wtime ();
if (d > e)
@@ -66,6 +66,7 @@
!$omp parallel reduction (.or.:l) if (.true.)
l = .not. omp_in_parallel ()
!$omp end parallel
+ if (l) call abort
e = omp_get_wtime ()
if (d .gt. e) call abort
@@ -66,6 +66,7 @@ C$OMP END PARALLEL
C$OMP PARALLEL REDUCTION (.OR.:L) IF (.TRUE.)
L = .NOT. OMP_IN_PARALLEL ()
C$OMP END PARALLEL
+ IF (L) CALL ABORT
E = OMP_GET_WTIME ()
IF (D .GT. E) CALL ABORT
@@ -66,6 +66,7 @@ C$OMP END PARALLEL
C$OMP PARALLEL REDUCTION (.OR.:L) IF (.TRUE.)
L = .NOT. OMP_IN_PARALLEL ()
C$OMP END PARALLEL
+ IF (L) CALL ABORT
E = OMP_GET_WTIME ()
IF (D .GT. E) CALL ABORT
libgomp/
* libgomp.texi (Runtime Library Routines): C linkage, don't throw
exceptions.
---
libgomp/libgomp.texi | 2 ++
1 file changed, 2 insertions(+)
@@ -132,6 +132,8 @@ three parts:
Control threads, processors and the parallel environment.
+They have C linkage, and don't throw exceptions.
+
@menu
* omp_get_active_level:: Number of active parallel regions
* omp_get_ancestor_thread_num:: Ancestor thread ID
contrib/
* gcc_update (files_and_dependencies): Fix rule for
libgomp/testsuite/Makefile.in.
---
contrib/gcc_update | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -139,7 +139,7 @@ libcpp/Makefile.in: libcpp/configure.ac libcpp/aclocal.m4
libcpp/configure: libcpp/configure.ac libcpp/aclocal.m4
libgomp/aclocal.m4: libgomp/configure.ac libgomp/acinclude.m4
libgomp/Makefile.in: libgomp/Makefile.am libgomp/aclocal.m4
-libgomp/testsuite/Makefile.in: libgomp/Makefile.am libgomp/aclocal.m4
+libgomp/testsuite/Makefile.in: libgomp/testsuite/Makefile.am libgomp/aclocal.m4
libgomp/configure: libgomp/configure.ac libgomp/aclocal.m4
libgomp/config.h.in: libgomp/configure.ac libgomp/aclocal.m4
libitm/aclocal.m4: libitm/configure.ac libitm/acinclude.m4
libgomp/
* Makefile.am (omp_lib.mod): Streamline rule.
* Makefile.in: Regenerate.
---
libgomp/Makefile.am | 2 +-
libgomp/Makefile.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
@@ -76,7 +76,7 @@ LINK = $(LIBTOOL) --tag CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
omp_lib_kinds.mod: omp_lib.mod
:
omp_lib.mod: omp_lib.f90
- $(FC) $(FCFLAGS) -fsyntax-only omp_lib.f90
+ $(FC) $(FCFLAGS) -fsyntax-only $<
fortran.lo: libgomp_f.h
fortran.o: libgomp_f.h
env.lo: libgomp_f.h