PR fortran/29759
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Nov 2006 19:42:55 +0000 (19:42 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Nov 2006 19:42:55 +0000 (19:42 +0000)
* fortran/scanner.c (skip_free_comments): Clear openmp_flag
before returning true.

* gfortran.dg/gomp/pr29759.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118773 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/scanner.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/gomp/pr29759.f90 [new file with mode: 0644]

index 3cd8b11..2ba9e87 100644 (file)
@@ -1,3 +1,9 @@
+2006-11-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/29759
+       * fortran/scanner.c (skip_free_comments): Clear openmp_flag
+       before returning true.
+
 2006-11-12  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
        PR fortran/26994
index 9d0ba2a..b054904 100644 (file)
@@ -392,6 +392,7 @@ skip_free_comments (void)
                    {
                      gfc_current_locus = old_loc;
                      next_char ();
+                     openmp_flag = 0;
                      return true;
                    }
                }
index 88f8c59..b058a6d 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/29759
+       * gfortran.dg/gomp/pr29759.f90: New test.
+
 2006-11-13  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/29518
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr29759.f90 b/gcc/testsuite/gfortran.dg/gomp/pr29759.f90
new file mode 100644 (file)
index 0000000..19a19c9
--- /dev/null
@@ -0,0 +1,42 @@
+! PR fortran/29759
+! { dg-do compile }
+
+PROGRAM test_omp
+!$OMP PARALLEL &
+!$OMP NUM_THREADS(2)
+!$OMP END PARALLEL
+
+!$OMP PARALLEL &
+!$OMP & NUM_THREADS(2)
+!$OMP END PARALLEL
+
+!$OMP PARALLEL &
+!
+!$OMP NUM_THREADS(2)
+!$OMP END PARALLEL
+
+!$OMP PARALLEL &
+!
+!$OMP & NUM_THREADS(2)
+!$OMP END PARALLEL
+
+
+!$OMP PARALLEL &               ! { dg-error "Unclassifiable OpenMP" }
+!$    NUM_THREADS(2)           ! { dg-error "Unclassifiable" }
+!$OMP END PARALLEL             ! { dg-error "Unexpected" }
+
+!$OMP PARALLEL &               ! { dg-error "Unclassifiable OpenMP" }
+!$    & NUM_THREADS(2)         ! { dg-error "Unclassifiable" }
+!$OMP END PARALLEL             ! { dg-error "Unexpected" }
+
+!$OMP PARALLEL &               ! { dg-error "Unclassifiable OpenMP" }
+!
+!$    NUM_THREADS(2)           ! { dg-error "Unclassifiable" }
+!$OMP END PARALLEL             ! { dg-error "Unexpected" }
+
+!$OMP PARALLEL &               ! { dg-error "Unclassifiable OpenMP" }
+!
+!$    & NUM_THREADS(2)         ! { dg-error "Unclassifiable" }
+!$OMP END PARALLEL             ! { dg-error "Unexpected" }
+
+END PROGRAM