|
|
93e26d |
2018-12-03 Fritz Reese <fritzoreese@gmail.com>
|
|
|
93e26d |
Mark Eggleston <mark.eggleston@codethink.co.uk>
|
|
|
93e26d |
|
|
|
93e26d |
PR fortran/87919
|
|
|
93e26d |
* options.c (SET_FLAG, SET_BITFLAG, SET_BITFLAG2): New macros.
|
|
|
93e26d |
(set_dec_flags): Set/unset DEC and std flags according to value.
|
|
|
93e26d |
(set_init_local_zero): New helper for -finit-local-zero flag group.
|
|
|
93e26d |
(gfc_init_options): Fix disabling of init flags, array temporaries
|
|
|
93e26d |
check, and dec flags when value is zero (from -fno-*).
|
|
|
93e26d |
|
|
|
93e26d |
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
|
|
|
93e26d |
index e59ba31ba7b..b35bed32974 100644
|
|
|
93e26d |
--- a/gcc/fortran/options.c
|
|
|
93e26d |
+++ b/gcc/fortran/options.c
|
|
|
93e26d |
@@ -32,6 +32,20 @@ along with GCC; see the file COPYING3. If not see
|
|
|
93e26d |
|
|
|
93e26d |
gfc_option_t gfc_option;
|
|
|
93e26d |
|
|
|
93e26d |
+#define SET_FLAG(flag, condition, on_value, off_value) \
|
|
|
93e26d |
+ do \
|
|
|
93e26d |
+ { \
|
|
|
93e26d |
+ if (condition) \
|
|
|
93e26d |
+ flag = (on_value); \
|
|
|
93e26d |
+ else \
|
|
|
93e26d |
+ flag = (off_value); \
|
|
|
93e26d |
+ } while (0)
|
|
|
93e26d |
+
|
|
|
93e26d |
+#define SET_BITFLAG2(m) m
|
|
|
93e26d |
+
|
|
|
93e26d |
+#define SET_BITFLAG(flag, condition, value) \
|
|
|
93e26d |
+ SET_BITFLAG2 (SET_FLAG (flag, condition, (flag | (value)), (flag & ~(value))))
|
|
|
93e26d |
+
|
|
|
93e26d |
|
|
|
93e26d |
/* Set flags that control warnings and errors for different
|
|
|
93e26d |
Fortran standards to their default values. Keep in sync with
|
|
|
93e26d |
@@ -47,30 +61,55 @@ set_default_std_flags (void)
|
|
|
93e26d |
gfc_option.warn_std = GFC_STD_F95_DEL | GFC_STD_LEGACY;
|
|
|
93e26d |
}
|
|
|
93e26d |
|
|
|
93e26d |
-
|
|
|
93e26d |
-/* Set all the DEC extension flags. */
|
|
|
93e26d |
+/* Set (or unset) the DEC extension flags. */
|
|
|
93e26d |
|
|
|
93e26d |
static void
|
|
|
93e26d |
set_dec_flags (int value)
|
|
|
93e26d |
{
|
|
|
93e26d |
+ /* Set (or unset) other DEC compatibility extensions. */
|
|
|
93e26d |
+ SET_BITFLAG (flag_dollar_ok, value, value);
|
|
|
93e26d |
+ SET_BITFLAG (flag_cray_pointer, value, value);
|
|
|
93e26d |
+ SET_BITFLAG (flag_dec_structure, value, value);
|
|
|
93e26d |
+ SET_BITFLAG (flag_dec_intrinsic_ints, value, value);
|
|
|
93e26d |
+ SET_BITFLAG (flag_dec_static, value, value);
|
|
|
93e26d |
+ SET_BITFLAG (flag_dec_math, value, value);
|
|
|
93e26d |
+ SET_BITFLAG (flag_dec_include, value, value);
|
|
|
93e26d |
+}
|
|
|
93e26d |
+
|
|
|
93e26d |
+/* Finalize DEC flags. */
|
|
|
93e26d |
+
|
|
|
93e26d |
+static void
|
|
|
93e26d |
+post_dec_flags (int value)
|
|
|
93e26d |
+{
|
|
|
93e26d |
+ /* Don't warn for legacy code if -fdec is given; however, setting -fno-dec
|
|
|
93e26d |
+ does not force these warnings. We make one final determination on this
|
|
|
93e26d |
+ at the end because -std= is always set first; thus, we can avoid
|
|
|
93e26d |
+ clobbering the user's desired standard settings in gfc_handle_option
|
|
|
93e26d |
+ e.g. when -fdec and -fno-dec are both given. */
|
|
|
93e26d |
if (value)
|
|
|
93e26d |
{
|
|
|
93e26d |
- /* Allow legacy code without warnings. */
|
|
|
93e26d |
gfc_option.allow_std |= GFC_STD_F95_OBS | GFC_STD_F95_DEL
|
|
|
93e26d |
- | GFC_STD_GNU | GFC_STD_LEGACY;
|
|
|
93e26d |
+ | GFC_STD_GNU | GFC_STD_LEGACY;
|
|
|
93e26d |
gfc_option.warn_std &= ~(GFC_STD_LEGACY | GFC_STD_F95_DEL);
|
|
|
93e26d |
}
|
|
|
93e26d |
-
|
|
|
93e26d |
- /* Set other DEC compatibility extensions. */
|
|
|
93e26d |
- flag_dollar_ok |= value;
|
|
|
93e26d |
- flag_cray_pointer |= value;
|
|
|
93e26d |
- flag_dec_structure |= value;
|
|
|
93e26d |
- flag_dec_intrinsic_ints |= value;
|
|
|
93e26d |
- flag_dec_static |= value;
|
|
|
93e26d |
- flag_dec_math |= value;
|
|
|
93e26d |
- flag_dec_include |= value;
|
|
|
93e26d |
}
|
|
|
93e26d |
|
|
|
93e26d |
+/* Enable (or disable) -finit-local-zero. */
|
|
|
93e26d |
+
|
|
|
93e26d |
+static void
|
|
|
93e26d |
+set_init_local_zero (int value)
|
|
|
93e26d |
+{
|
|
|
93e26d |
+ gfc_option.flag_init_integer_value = 0;
|
|
|
93e26d |
+ gfc_option.flag_init_character_value = (char)0;
|
|
|
93e26d |
+
|
|
|
93e26d |
+ SET_FLAG (gfc_option.flag_init_integer, value, GFC_INIT_INTEGER_ON,
|
|
|
93e26d |
+ GFC_INIT_INTEGER_OFF);
|
|
|
93e26d |
+ SET_FLAG (gfc_option.flag_init_logical, value, GFC_INIT_LOGICAL_FALSE,
|
|
|
93e26d |
+ GFC_INIT_LOGICAL_OFF);
|
|
|
93e26d |
+ SET_FLAG (gfc_option.flag_init_character, value, GFC_INIT_CHARACTER_ON,
|
|
|
93e26d |
+ GFC_INIT_CHARACTER_OFF);
|
|
|
93e26d |
+ SET_FLAG (flag_init_real, value, GFC_INIT_REAL_ZERO, GFC_INIT_REAL_OFF);
|
|
|
93e26d |
+}
|
|
|
93e26d |
|
|
|
93e26d |
/* Return language mask for Fortran options. */
|
|
|
93e26d |
|
|
|
93e26d |
diff --git a/gcc/testsuite/gfortran.dg/array_temporaries_5.f90 b/gcc/testsuite/gfortran.dg/array_temporaries_5.f90
|
|
|
93e26d |
new file mode 100644
|
|
|
93e26d |
index 00000000000..dd147ba38ed
|
|
|
93e26d |
--- /dev/null
|
|
|
93e26d |
+++ b/gcc/testsuite/gfortran.dg/array_temporaries_5.f90
|
|
|
93e26d |
@@ -0,0 +1,10 @@
|
|
|
93e26d |
+! { dg-do run }
|
|
|
93e26d |
+! { dg-options "-fcheck-array-temporaries -fno-check-array-temporaries" }
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! PR fortran/87919
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Ensure -fno-check-array-temporaries disables array temporary checking.
|
|
|
93e26d |
+!
|
|
|
93e26d |
+
|
|
|
93e26d |
+! Note that 'include' drops the dg-output check from the original test case.
|
|
|
93e26d |
+include 'array_temporaries_2.f90'
|
|
|
93e26d |
diff --git a/gcc/testsuite/gfortran.dg/dec_bitwise_ops_3.f90 b/gcc/testsuite/gfortran.dg/dec_bitwise_ops_3.f90
|
|
|
93e26d |
new file mode 100644
|
|
|
93e26d |
index 00000000000..c28cf81fc04
|
|
|
93e26d |
--- /dev/null
|
|
|
93e26d |
+++ b/gcc/testsuite/gfortran.dg/dec_bitwise_ops_3.f90
|
|
|
93e26d |
@@ -0,0 +1,29 @@
|
|
|
93e26d |
+! { dg-do compile }
|
|
|
93e26d |
+! { dg-options "-std=legacy -fdec -fno-dec" }
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! PR fortran/87919
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Make sure -fno-dec disables bitwise ops and check for the right errors.
|
|
|
93e26d |
+! -std=legacy is added to avoid the .XOR. extension warning.
|
|
|
93e26d |
+!
|
|
|
93e26d |
+
|
|
|
93e26d |
+include 'dec_bitwise_ops_1.f90'
|
|
|
93e26d |
+
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 33 }
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 34 }
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 35 }
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 46 }
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 47 }
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 48 }
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 59 }
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 60 }
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 61 }
|
|
|
93e26d |
+! { dg-error "Operand of .not. operator" " " { target *-*-* } 72 }
|
|
|
93e26d |
+! { dg-error "Operand of .not. operator" " " { target *-*-* } 73 }
|
|
|
93e26d |
+! { dg-error "Operand of .not. operator" " " { target *-*-* } 74 }
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 85 }
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 86 }
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 87 }
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 98 }
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 99 }
|
|
|
93e26d |
+! { dg-error "Operands of logical operator" " " { target *-*-* } 100 }
|
|
|
93e26d |
diff --git a/gcc/testsuite/gfortran.dg/dec_d_lines_3.f b/gcc/testsuite/gfortran.dg/dec_d_lines_3.f
|
|
|
93e26d |
new file mode 100644
|
|
|
93e26d |
index 00000000000..2df4341c0e4
|
|
|
93e26d |
--- /dev/null
|
|
|
93e26d |
+++ b/gcc/testsuite/gfortran.dg/dec_d_lines_3.f
|
|
|
93e26d |
@@ -0,0 +1,14 @@
|
|
|
93e26d |
+! { dg-do compile }
|
|
|
93e26d |
+! { dg-options "-ffixed-form -fdec -fno-dec" }
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! PR fortran/87919
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Ensure -fno-dec disables -fdec, leaving d-lines as code by default.
|
|
|
93e26d |
+!
|
|
|
93e26d |
+
|
|
|
93e26d |
+include 'dec_d_lines_2.f'
|
|
|
93e26d |
+
|
|
|
93e26d |
+! { dg-error "character in statement label" " " { target *-*-*} 6 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" " " { target *-*-*} 6 }
|
|
|
93e26d |
+! { dg-error "character in statement label" " " { target *-*-*} 7 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" " " { target *-*-*} 7 }
|
|
|
93e26d |
diff --git a/gcc/testsuite/gfortran.dg/dec_exp_4.f90 b/gcc/testsuite/gfortran.dg/dec_exp_4.f90
|
|
|
93e26d |
new file mode 100644
|
|
|
93e26d |
index 00000000000..9d8b10db6a7
|
|
|
93e26d |
--- /dev/null
|
|
|
93e26d |
+++ b/gcc/testsuite/gfortran.dg/dec_exp_4.f90
|
|
|
93e26d |
@@ -0,0 +1,12 @@
|
|
|
93e26d |
+! { dg-do compile }
|
|
|
93e26d |
+! { dg-options "-fdec -fno-dec" }
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! PR fortran/87919
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Make sure -fno-dec disables -fdec as with dec_exp_2.
|
|
|
93e26d |
+!
|
|
|
93e26d |
+
|
|
|
93e26d |
+include 'dec_exp_2.f90'
|
|
|
93e26d |
+
|
|
|
93e26d |
+! { dg-error "Missing exponent" "" { target *-*-* } 9 }
|
|
|
93e26d |
+! { dg-error "Missing exponent" "" { target *-*-* } 11 }
|
|
|
93e26d |
diff --git a/gcc/testsuite/gfortran.dg/dec_exp_5.f90 b/gcc/testsuite/gfortran.dg/dec_exp_5.f90
|
|
|
93e26d |
new file mode 100644
|
|
|
93e26d |
index 00000000000..faf3a9b306b
|
|
|
93e26d |
--- /dev/null
|
|
|
93e26d |
+++ b/gcc/testsuite/gfortran.dg/dec_exp_5.f90
|
|
|
93e26d |
@@ -0,0 +1,11 @@
|
|
|
93e26d |
+! { dg-do run "xfail *-*-*" }
|
|
|
93e26d |
+! { dg-options "-fdec -fno-dec" }
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! PR fortran/87919
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Make sure -fno-dec disables -fdec as with dec_exp_3.
|
|
|
93e26d |
+!
|
|
|
93e26d |
+
|
|
|
93e26d |
+include 'dec_exp_3.f90'
|
|
|
93e26d |
+
|
|
|
93e26d |
+! { XFAIL "Bad real number" "" { target *-*-* } 13 }
|
|
|
93e26d |
diff --git a/gcc/testsuite/gfortran.dg/dec_io_7.f90 b/gcc/testsuite/gfortran.dg/dec_io_7.f90
|
|
|
93e26d |
new file mode 100644
|
|
|
93e26d |
index 00000000000..4a931c15fe7
|
|
|
93e26d |
--- /dev/null
|
|
|
93e26d |
+++ b/gcc/testsuite/gfortran.dg/dec_io_7.f90
|
|
|
93e26d |
@@ -0,0 +1,20 @@
|
|
|
93e26d |
+! { dg-do compile }
|
|
|
93e26d |
+! { dg-options "-fdec -fno-dec" }
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! PR fortran/87919
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Make sure -fno-dec rejects -fdec I/O specifiers as with dec_io_1.
|
|
|
93e26d |
+!
|
|
|
93e26d |
+
|
|
|
93e26d |
+include 'dec_io_1.f90'
|
|
|
93e26d |
+
|
|
|
93e26d |
+! { dg-error "is a DEC extension" "" { target *-*-* } 12 }
|
|
|
93e26d |
+! { dg-error "is a DEC extension" "" { target *-*-* } 24 }
|
|
|
93e26d |
+! { dg-error "is a DEC extension" "" { target *-*-* } 58 }
|
|
|
93e26d |
+! { dg-error "is a DEC extension" "" { target *-*-* } 64 }
|
|
|
93e26d |
+! { dg-error "is a DEC extension" "" { target *-*-* } 68 }
|
|
|
93e26d |
+! { dg-error "is a DEC extension" "" { target *-*-* } 74 }
|
|
|
93e26d |
+! { dg-error "is a DEC extension" "" { target *-*-* } 78 }
|
|
|
93e26d |
+! { dg-error "is a DEC extension" "" { target *-*-* } 84 }
|
|
|
93e26d |
+! { dg-error "is a DEC extension" "" { target *-*-* } 90 }
|
|
|
93e26d |
+! { dg-error "is a DEC extension" "" { target *-*-* } 96 }
|
|
|
93e26d |
diff --git a/gcc/testsuite/gfortran.dg/dec_structure_24.f90 b/gcc/testsuite/gfortran.dg/dec_structure_24.f90
|
|
|
93e26d |
new file mode 100644
|
|
|
93e26d |
index 00000000000..02842b315dc
|
|
|
93e26d |
--- /dev/null
|
|
|
93e26d |
+++ b/gcc/testsuite/gfortran.dg/dec_structure_24.f90
|
|
|
93e26d |
@@ -0,0 +1,32 @@
|
|
|
93e26d |
+! { dg-do compile }
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! PR fortran/87919
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Should fail to compile without the -fdec or -fdec-structure options.
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Contributed by Mark Eggleston <mark.eggleston@codethink.com>
|
|
|
93e26d |
+
|
|
|
93e26d |
+include 'dec_structure_1.f90'
|
|
|
93e26d |
+
|
|
|
93e26d |
+! { dg-error "-fdec-structure" " " { target *-*-* } 14 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 19 }
|
|
|
93e26d |
+! { dg-error "-fdec-structure" " " { target *-*-* } 21 }
|
|
|
93e26d |
+! { dg-error "-fdec-structure" " " { target *-*-* } 22 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" " " { target *-*-* } 25 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" " " { target *-*-* } 26 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" " " { target *-*-* } 27 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" " " { target *-*-* } 28 }
|
|
|
93e26d |
+! { dg-error "is not a variable" " " { target *-*-* } 30 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 32 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 34 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 36 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 38 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 40 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 42 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 44 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 46 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 48 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 50 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 52 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 54 }
|
|
|
93e26d |
+! { dg-error "function result" " " { target *-*-* } 29 }
|
|
|
93e26d |
diff --git a/gcc/testsuite/gfortran.dg/dec_structure_25.f90 b/gcc/testsuite/gfortran.dg/dec_structure_25.f90
|
|
|
93e26d |
new file mode 100644
|
|
|
93e26d |
index 00000000000..a64d85a88a4
|
|
|
93e26d |
--- /dev/null
|
|
|
93e26d |
+++ b/gcc/testsuite/gfortran.dg/dec_structure_25.f90
|
|
|
93e26d |
@@ -0,0 +1,11 @@
|
|
|
93e26d |
+! { dg-do run }
|
|
|
93e26d |
+! { dg-options "-fdec" }
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! PR fortran/87919
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Should compile and run with the -fdec option.
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Contributed by Mark Eggleston <mark.eggleston@codethink.com>
|
|
|
93e26d |
+!
|
|
|
93e26d |
+
|
|
|
93e26d |
+include 'dec_structure_1.f90'
|
|
|
93e26d |
diff --git a/gcc/testsuite/gfortran.dg/dec_structure_26.f90 b/gcc/testsuite/gfortran.dg/dec_structure_26.f90
|
|
|
93e26d |
new file mode 100644
|
|
|
93e26d |
index 00000000000..7829103b995
|
|
|
93e26d |
--- /dev/null
|
|
|
93e26d |
+++ b/gcc/testsuite/gfortran.dg/dec_structure_26.f90
|
|
|
93e26d |
@@ -0,0 +1,34 @@
|
|
|
93e26d |
+! { dg-do compile }
|
|
|
93e26d |
+! { dg-options "-fdec -fno-dec-structure" }
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! PR fortran/87919
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Should fail to compile with -fdec and -fno-dec-structure.
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Contributed by Mark Eggleston <mark.eggleston@codethink.com>
|
|
|
93e26d |
+!
|
|
|
93e26d |
+
|
|
|
93e26d |
+include 'dec_structure_1.f90'
|
|
|
93e26d |
+
|
|
|
93e26d |
+! { dg-error "-fdec-structure" " " { target *-*-* } 14 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 19 }
|
|
|
93e26d |
+! { dg-error "-fdec-structure" " " { target *-*-* } 21 }
|
|
|
93e26d |
+! { dg-error "-fdec-structure" " " { target *-*-* } 22 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" " " { target *-*-* } 25 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" " " { target *-*-* } 26 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" " " { target *-*-* } 27 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" " " { target *-*-* } 28 }
|
|
|
93e26d |
+! { dg-error "is not a variable" " " { target *-*-* } 30 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 32 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 34 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 36 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 38 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 40 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 42 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 44 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 46 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 48 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 50 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 52 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 54 }
|
|
|
93e26d |
+! { dg-error "function result" " " { target *-*-* } 29 }
|
|
|
93e26d |
diff --git a/gcc/testsuite/gfortran.dg/dec_structure_27.f90 b/gcc/testsuite/gfortran.dg/dec_structure_27.f90
|
|
|
93e26d |
new file mode 100644
|
|
|
93e26d |
index 00000000000..1257365deb8
|
|
|
93e26d |
--- /dev/null
|
|
|
93e26d |
+++ b/gcc/testsuite/gfortran.dg/dec_structure_27.f90
|
|
|
93e26d |
@@ -0,0 +1,34 @@
|
|
|
93e26d |
+! { dg-do compile }
|
|
|
93e26d |
+! { dg-options "-fdec-structure -fno-dec-structure" }
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! PR fortran/87919
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Should fail to compile with -fdec-structure and -fno-dec-structure.
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Contributed by Mark Eggleston <mark.eggleston@codethink.com>
|
|
|
93e26d |
+!
|
|
|
93e26d |
+
|
|
|
93e26d |
+include 'dec_structure_1.f90'
|
|
|
93e26d |
+
|
|
|
93e26d |
+! { dg-error "-fdec-structure" " " { target *-*-* } 14 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 19 }
|
|
|
93e26d |
+! { dg-error "-fdec-structure" " " { target *-*-* } 21 }
|
|
|
93e26d |
+! { dg-error "-fdec-structure" " " { target *-*-* } 22 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" " " { target *-*-* } 25 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" " " { target *-*-* } 26 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" " " { target *-*-* } 27 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" " " { target *-*-* } 28 }
|
|
|
93e26d |
+! { dg-error "is not a variable" " " { target *-*-* } 30 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 32 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 34 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 36 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 38 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 40 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 42 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 44 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 46 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 48 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 50 }
|
|
|
93e26d |
+! { dg-error "Bad character" " " { target *-*-* } 52 }
|
|
|
93e26d |
+! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 54 }
|
|
|
93e26d |
+! { dg-error "function result" " " { target *-*-* } 29 }
|
|
|
93e26d |
diff --git a/gcc/testsuite/gfortran.dg/dec_type_print_3.f90 b/gcc/testsuite/gfortran.dg/dec_type_print_3.f90
|
|
|
93e26d |
new file mode 100644
|
|
|
93e26d |
index 00000000000..f766bdf0022
|
|
|
93e26d |
--- /dev/null
|
|
|
93e26d |
+++ b/gcc/testsuite/gfortran.dg/dec_type_print_3.f90
|
|
|
93e26d |
@@ -0,0 +1,21 @@
|
|
|
93e26d |
+! { dg-do compile }
|
|
|
93e26d |
+! { dg-options "-fdec -fno-dec" }
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! PR fortran/87919
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Ensure that -fno-dec disables the usage of TYPE as an alias for PRINT.
|
|
|
93e26d |
+!
|
|
|
93e26d |
+
|
|
|
93e26d |
+include 'dec_type_print.f90'
|
|
|
93e26d |
+
|
|
|
93e26d |
+! { dg-error "Invalid character in name" "" { target *-*-* } 52 }
|
|
|
93e26d |
+! { dg-error "Invalid character in name" "" { target *-*-* } 53 }
|
|
|
93e26d |
+! { dg-error "Invalid character in name" "" { target *-*-* } 54 }
|
|
|
93e26d |
+! { dg-error "Invalid character in name" "" { target *-*-* } 55 }
|
|
|
93e26d |
+! { dg-error "Invalid character in name" "" { target *-*-* } 56 }
|
|
|
93e26d |
+! { dg-error "Invalid character in name" "" { target *-*-* } 57 }
|
|
|
93e26d |
+! { dg-error "Invalid character in name" "" { target *-*-* } 58 }
|
|
|
93e26d |
+! { dg-error "Unclassifiable statement" "" { target *-*-* } 59 }
|
|
|
93e26d |
+! { dg-error "conflicts with PROCEDURE" "" { target *-*-* } 60 }
|
|
|
93e26d |
+! { dg-error "Cannot assign to a named constant" "" { target *-*-* } 80 }
|
|
|
93e26d |
+
|
|
|
93e26d |
diff --git a/gcc/testsuite/gfortran.dg/init_flag_20.f90 b/gcc/testsuite/gfortran.dg/init_flag_20.f90
|
|
|
93e26d |
new file mode 100644
|
|
|
93e26d |
index 00000000000..6f15c1ace0d
|
|
|
93e26d |
--- /dev/null
|
|
|
93e26d |
+++ b/gcc/testsuite/gfortran.dg/init_flag_20.f90
|
|
|
93e26d |
@@ -0,0 +1,15 @@
|
|
|
93e26d |
+! { dg-do compile }
|
|
|
93e26d |
+! { dg-options "-fbackslash -finit-local-zero -fno-init-local-zero -fdump-tree-original" }
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! PR fortran/87919
|
|
|
93e26d |
+!
|
|
|
93e26d |
+! Make sure -fno-init-local-zero disables -finit-local-zero.
|
|
|
93e26d |
+!
|
|
|
93e26d |
+
|
|
|
93e26d |
+include 'init_flag_1.f90'
|
|
|
93e26d |
+
|
|
|
93e26d |
+! Make sure no initialization code is generated.
|
|
|
93e26d |
+! { dg-final { scan-tree-dump-times "r\[1-4] *= *\[0\{]" 0 "original" } }
|
|
|
93e26d |
+! { dg-final { scan-tree-dump-times "l\[12] *= *\[0\{]" 0 "original" } }
|
|
|
93e26d |
+! { dg-final { scan-tree-dump-times "i\[1-4] *= *\[0\{]" 0 "original" } }
|
|
|
93e26d |
+! { dg-final { scan-tree-dump-times "memmove *\[(]\[^,]*c\[1-4]" 0 "original" } }
|