Commit 9b9e4cd6 by Jakub Jelinek Committed by Jakub Jelinek

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
parent ec14aed2
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
......
......@@ -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++;
......
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.
......
! { dg-options "-fopenmp" }
program condinc1
logical l
l = .false.
!$ include 'condinc1.inc'
stop 2
end
! { dg-options "-fno-openmp" }
program condinc2
logical l
l = .true.
C$ include 'condinc1.inc'
return
end
! { dg-options "-fopenmp" }
program condinc3
logical l
l = .false.
!$ include 'condinc1.inc'
stop 2
end
! { dg-options "-fno-openmp" }
program condinc4
logical l
l = .true.
!$ include 'condinc1.inc'
return
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment