c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / fmt_f_default_field_width_1.f90
bloba2b14b7fee62b095de90d8af66439e5fa961f84e
1 ! { dg-do run }
2 ! { dg-options "-cpp -fdec" }
4 ! Test case for the default field widths enabled by the -fdec-format-defaults flag.
6 ! This feature is not part of any Fortran standard, but it is supported by the
7 ! Oracle Fortran compiler and others.
10 program test
11 implicit none
12 character(50) :: buffer
14 real(4) :: real_4
15 real(8) :: real_8
16 #ifdef __GFC_REAL_16__
17 real(16) :: real_16
18 #endif
19 integer :: len
20 character(*), parameter :: fmt = "(A, F, A)"
22 real_4 = 4.18
23 write(buffer, fmt) ':',real_4,':'
24 print *,buffer
25 if (buffer.ne.": 4.1799998:") stop 1
27 real_4 = 0.00000018
28 write(buffer, fmt) ':',real_4,':'
29 print *,buffer
30 if (buffer.ne.": 0.0000002:") stop 2
32 real_8 = 4.18
33 write(buffer, fmt) ':',real_8,':'
34 print *,buffer
35 len = len_trim(buffer)
36 if (len /= 27) stop 3
38 #ifdef __GFC_REAL_16__
39 real_16 = 4.18
40 write(buffer, fmt) ':',real_16,':'
41 print *,buffer
42 len = len_trim(buffer)
43 if (len /= 44) stop 4
44 #endif
45 end