]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gfortran.dg/char4_iunit_1.f03
re PR libfortran/48852 (Invalid spaces in list-directed output of complex constants)
[thirdparty/gcc.git] / gcc / testsuite / gfortran.dg / char4_iunit_1.f03
1 ! { dg-do run }
2 ! { dg-add-options ieee }
3 ! { dg-skip-if "NaN not supported" { spu-*-* } { "*" } { "" } }
4 ! PR37077 Implement Internal Unit I/O for character KIND=4
5 ! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
6 program char4_iunit_1
7 implicit none
8 character(kind=4,len=44) :: string
9 integer(kind=4) :: i,j
10 real(kind=4) :: inf, nan, large
11
12 large = huge(large)
13 inf = 2 * large
14 nan = 0
15 nan = nan / nan
16
17 string = 4_"123456789x"
18 write(string,'(a11)') 4_"abcdefg"
19 if (string .ne. 4_" abcdefg ") call abort
20 write(string,*) 12345
21 if (string .ne. 4_" 12345 ") call abort
22 write(string, '(i6,5x,i8,a5)') 78932, 123456, "abc"
23 if (string .ne. 4_" 78932 123456 abc ") call abort
24 write(string, *) .true., .false. , .true.
25 if (string .ne. 4_" T F T ") call abort
26 write(string, *) 1.2345e-06, 4.2846e+10_8
27 if (string .ne. 4_" 1.23450002E-06 42846000000.000000 ") call abort
28 write(string, *) nan, inf
29 if (string .ne. 4_" NaN Infinity ") call abort
30 write(string, '(10x,f3.1,3x,f9.1)') nan, inf
31 if (string .ne. 4_" NaN Infinity ") call abort
32 write(string, *) (1.2, 3.4 )
33 if (string .ne. 4_" (1.20000005,3.40000010)") call abort
34 end program char4_iunit_1