This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Updated BYTE patch


Another updated patch:

2005-10-09  Asher Langton  <langton2@llnl.gov>
	* decl.c (match_type_spec) : Added BYTE type

2005-10-09 Asher Langton <langton2@llnl.gov>

	gfortran.dg/byte_1.f90: New
	gfortran.dg/byte_2.f90: New
Index: decl.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fortran/decl.c,v
retrieving revision 1.41
diff -c -3 -p -r1.41 decl.c
*** decl.c	25 Aug 2005 11:57:19 -0000	1.41
--- decl.c	10 Oct 2005 04:53:53 -0000
*************** match_type_spec (gfc_typespec * ts, int 
*** 1367,1372 ****
--- 1367,1382 ----
  
    gfc_clear_ts (ts);
  
+   if (gfc_match (" byte") == MATCH_YES)
+     {
+       if (gfc_notify_std(GFC_STD_GNU, "Extension: BYTE type at %C") 
+ 	  == FAILURE)
+ 	return MATCH_ERROR;
+       ts->type = BT_INTEGER;
+       ts->kind = 1;
+       return MATCH_YES;
+     }
+ 
    if (gfc_match (" integer") == MATCH_YES)
      {
        ts->type = BT_INTEGER;
! { dg-do compile }
! { dg-options "-std=f95" }
program testbyte
  integer(1) :: ii = 7
  call foo(ii)
end program testbyte

subroutine foo(ii)
  integer(1) ii
  byte b          ! { dg-error "BYTE type" }
  b = ii
  call bar(ii,b)
end subroutine foo

subroutine bar(ii,b)
  integer (1) ii
  byte b          ! { dg-error "BYTE type" }
  if (b.ne.ii) then
!     print *,"Failed"
     call abort
  end if
end subroutine bar
! { dg-do run }
! { dg-options "-std=gnu" }
program testbyte
  integer(1) :: ii = 7
  call foo(ii)
end program testbyte

subroutine foo(ii)
  integer(1) ii
  byte b
  b = ii
  call bar(ii,b)
end subroutine foo

subroutine bar(ii,b)
  integer (1) ii
  byte b
  if (b.ne.ii) then
!     print *,"Failed"
     call abort
  end if
end subroutine bar

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]