+2019-05-23 Mark Eggleston <mark.eggleston@codethink.com>
+
+ * gfortran.dg/fmt_f_default_field_width_1.f90: Hide REAL(16) behind
+ __GFC_REAL_16__. Add -cpp to dg-options.
+ * gfortran.dg/fmt_f_default_field_width_2.f90: Ditto.
+ * gfortran.dg/fmt_f_default_field_width_3.f90: Ditto.
+ * gfortran.dg/fmt_g_default_field_width_1.f90: Ditto.
+ * gfortran.dg/fmt_g_default_field_width_2.f90: Ditto.
+ * gfortran.dg/fmt_g_default_field_width_3.f90: Ditto.
+
2019-05-23 Bill Schmidt <wschmidt@linux.ibm.com>
* gcc.target/powerpc/cpu-future.c: New test.
! { dg-do run }
-! { dg-options -fdec }
+! { dg-options "-cpp -fdec" }
!
! Test case for the default field widths enabled by the -fdec-format-defaults flag.
!
!
program test
+ implicit none
character(50) :: buffer
real(4) :: real_4
real(8) :: real_8
+#ifdef __GFC_REAL_16__
real(16) :: real_16
+#endif
integer :: len
character(*), parameter :: fmt = "(A, F, A)"
len = len_trim(buffer)
if (len /= 27) stop 3
+#ifdef __GFC_REAL_16__
real_16 = 4.18
write(buffer, fmt) ':',real_16,':'
print *,buffer
len = len_trim(buffer)
if (len /= 44) stop 4
+#endif
end
! { dg-do run }
-! { dg-options -fdec-format-defaults }
+! { dg-options "-cpp -fdec-format-defaults" }
!
! Test case for the default field widths enabled by the -fdec-format-defaults flag.
!
!
program test
+ implicit none
character(50) :: buffer
real(4) :: real_4
real(8) :: real_8
+#ifdef __GFC_REAL_16__
real(16) :: real_16
+#endif
integer :: len
character(*), parameter :: fmt = "(A, F, A)"
len = len_trim(buffer)
if (len /= 27) stop 3
+#ifdef __GFC_REAL_16__
real_16 = 4.18
write(buffer, fmt) ':',real_16,':'
print *,buffer
len = len_trim(buffer)
if (len /= 44) stop 4
+#endif
end
! { dg-do compile }
-! { dg-options "-fdec -fno-dec-format-defaults" }
+! { dg-options "-cpp -fdec -fno-dec-format-defaults" }
!
! Test case for the default field widths not enabled.
!
!
program test
+ implicit none
character(50) :: buffer
real*4 :: real_4
real*8 :: real_8
+#ifdef __GFC_REAL_16__
real*16 :: real_16
+#endif
integer :: len
character(*), parameter :: fmt = "(A, F, A)"
real_8 = 4.18
write(buffer, fmt) ':',real_8,':' ! { dg-error "Nonnegative width required" }
+#ifdef __GFC_REAL_16__
real_16 = 4.18
write(buffer, fmt) ':',real_16,':' ! { dg-error "Nonnegative width required" }
+#endif
end
! { dg-do run }
-! { dg-options -fdec }
+! { dg-options "-cpp -fdec" }
!
! Test case for the default field widths enabled by the -fdec-format-defaults flag.
!
!
program test
+ implicit none
character(50) :: buffer
real(4) :: real_4
real(8) :: real_8
+#ifdef __GFC_REAL_16__
real(16) :: real_16
+#endif
integer :: len
character(*), parameter :: fmt = "(A, G, A)"
len = len_trim(buffer)
if (len /= 27) stop 4
+#ifdef __GFC_REAL_16__
real_16 = 4.18
write(buffer, fmt) ':',real_16,':'
print *,buffer
len = len_trim(buffer)
if (len /= 44) stop 5
+#endif
end
! { dg-do run }
-! { dg-options -fdec-format-defaults }
+! { dg-options "-cpp -fdec-format-defaults" }
!
! Test case for the default field widths enabled by the -fdec-format-defaults flag.
!
!
program test
+ implicit none
character(50) :: buffer
real(4) :: real_4
real(8) :: real_8
+#ifdef __GFC_REAL_16__
real(16) :: real_16
+#endif
integer :: len
character(*), parameter :: fmt = "(A, G, A)"
len = len_trim(buffer)
if (len /= 27) stop 4
+#ifdef __GFC_REAL_16__
real_16 = 4.18
write(buffer, fmt) ':',real_16,':'
print *,buffer
len = len_trim(buffer)
if (len /= 44) stop 5
+#endif
end
! { dg-do compile }
-! { dg-options "-fdec -fno-dec-format-defaults" }
+! { dg-options "-cpp -fdec -fno-dec-format-defaults" }
!
! Test case for the default field widths not enabled.
!
!
program test
+ implicit none
character(50) :: buffer
real(4) :: real_4
real(8) :: real_8
+#ifdef __GFC_REAL_16__
real(16) :: real_16
+#endif
integer :: len
character(*), parameter :: fmt = "(A, G, A)"
real_8 = 4.18
write(buffer, fmt) ':',real_8,':' ! { dg-error "Positive width required" }
+#ifdef __GFC_REAL_16__
real_16 = 4.18
write(buffer, fmt) ':',real_16,':' ! { dg-error "Positive width required" }
+#endif
end