re PR fortran/29097 (!$ include 'omp_lib.h' does not work)

PR fortran/29097
	* scanner.c (include_line): Handle conditional include.

	* testsuite/libgomp.fortran/condinc1.f: New test.
	* testsuite/libgomp.fortran/condinc2.f: New test.
	* testsuite/libgomp.fortran/condinc3.f90: New test.
	* testsuite/libgomp.fortran/condinc4.f90: New test.
	* testsuite/libgomp.fortran/condinc1.inc: New file.

From-SVN: r117234
This commit is contained in:
Jakub Jelinek 2006-09-26 20:06:55 +02:00 committed by Jakub Jelinek
parent ec14aed23b
commit 9b9e4cd6a9
8 changed files with 63 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2006-09-26 Jakub Jelinek <jakub@redhat.com>
PR fortran/29097
* scanner.c (include_line): Handle conditional include.
2006-09-25 Tobias Schluter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/21203

View File

@ -1212,8 +1212,26 @@ static bool
include_line (char *line)
{
char quote, *c, *begin, *stop;
c = line;
if (gfc_option.flag_openmp)
{
if (gfc_current_form == FORM_FREE)
{
while (*c == ' ' || *c == '\t')
c++;
if (*c == '!' && c[1] == '$' && (c[2] == ' ' || c[2] == '\t'))
c += 3;
}
else
{
if ((*c == '!' || *c == 'c' || *c == 'C' || *c == '*')
&& c[1] == '$' && (c[2] == ' ' || c[2] == '\t'))
c += 3;
}
}
while (*c == ' ' || *c == '\t')
c++;

View File

@ -1,3 +1,12 @@
2006-09-26 Jakub Jelinek <jakub@redhat.com>
PR fortran/29097
* testsuite/libgomp.fortran/condinc1.f: New test.
* testsuite/libgomp.fortran/condinc2.f: New test.
* testsuite/libgomp.fortran/condinc3.f90: New test.
* testsuite/libgomp.fortran/condinc4.f90: New test.
* testsuite/libgomp.fortran/condinc1.inc: New file.
2006-09-18 Tom Tromey <tromey@redhat.com>
* configure: Rebuilt.

View File

@ -0,0 +1,7 @@
! { dg-options "-fopenmp" }
program condinc1
logical l
l = .false.
!$ include 'condinc1.inc'
stop 2
end

View File

@ -0,0 +1,2 @@
if (l) stop 3
return

View File

@ -0,0 +1,7 @@
! { dg-options "-fno-openmp" }
program condinc2
logical l
l = .true.
C$ include 'condinc1.inc'
return
end

View File

@ -0,0 +1,7 @@
! { dg-options "-fopenmp" }
program condinc3
logical l
l = .false.
!$ include 'condinc1.inc'
stop 2
end

View File

@ -0,0 +1,7 @@
! { dg-options "-fno-openmp" }
program condinc4
logical l
l = .true.
!$ include 'condinc1.inc'
return
end