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:
Thomas Koenig 2024-11-16 14:49:25 +01:00
parent 4b8c5b337e
commit 66096151af
2 changed files with 13 additions and 0 deletions

View file

@ -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;

View 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