+2007-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/31764
+ * simplify.c (gfc_simplify_new_line): NEW_LINE can be simplified
+ even for non constant arguments.
+
2007-05-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
{
gfc_expr *result;
- if (e->expr_type != EXPR_CONSTANT)
- return NULL;
-
result = gfc_constant_result (BT_CHARACTER, e->ts.kind, &e->where);
-
result->value.character.string = gfc_getmem (2);
-
result->value.character.length = 1;
result->value.character.string[0] = '\n';
result->value.character.string[1] = '\0'; /* For debugger */
+2007-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/31764
+ * gfortran.dg/new_line.f90: Add new checks.
+
2007-05-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/31201
! Checks Fortran 2003's new_line intrinsic function
! PR fortran/28585
program new_line_check
- implicit none
- if(achar(10) /= new_line('a')) call abort()
+ implicit none
+ character(len=10) :: a1
+ character(len=10) :: a2(2)
+ character(len=10), parameter :: a3 = "1234567890"
+ character(len=10), parameter :: a4(2) = "1234567890"
+ character(len=10), parameter :: a5(2) = repeat("1234567890",2)
+
+ if(achar(10) /= new_line('a')) call abort
+
+ if (iachar(new_line(a1)) /= 10) call abort
+ if (iachar(new_line(a2)) /= 10) call abort
+ if (iachar(new_line(a3)) /= 10) call abort
+ if (iachar(new_line(a4)) /= 10) call abort
+ if (iachar(new_line(a5)) /= 10) call abort
+
end program new_line_check