Handle unsigned constants for module I/O.
gcc/fortran/ChangeLog: * module.cc (mio_expr): Handle BT_UNSIGNED. gcc/testsuite/ChangeLog: * gfortran.dg/unsigned_42.f90: New test.
This commit is contained in:
parent
4b8c5b337e
commit
66096151af
2 changed files with 13 additions and 0 deletions
|
@ -3925,6 +3925,7 @@ mio_expr (gfc_expr **ep)
|
|||
switch (e->ts.type)
|
||||
{
|
||||
case BT_INTEGER:
|
||||
case BT_UNSIGNED:
|
||||
mio_gmp_integer (&e->value.integer);
|
||||
break;
|
||||
|
||||
|
|
12
gcc/testsuite/gfortran.dg/unsigned_42.f90
Normal file
12
gcc/testsuite/gfortran.dg/unsigned_42.f90
Normal file
|
@ -0,0 +1,12 @@
|
|||
! { dg-do compile }
|
||||
! { dg-options "-funsigned" }
|
||||
module mytype
|
||||
integer, parameter :: uk = selected_unsigned_kind(12)
|
||||
end module mytype
|
||||
|
||||
module foo
|
||||
use mytype
|
||||
implicit none
|
||||
unsigned(uk), parameter :: seed0 = 1u_uk
|
||||
unsigned(uk), protected :: x_ = seed0
|
||||
end module foo
|
Loading…
Add table
Reference in a new issue