summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/data_value_1.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/data_value_1.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/data_value_1.f9016
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/data_value_1.f90 b/gcc/testsuite/gfortran.dg/data_value_1.f90
new file mode 100644
index 000000000..cb3e4c3ec
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/data_value_1.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+! Test the fix for PR40402, in which it was not detected that X
+! is not a constant and so the DATA statement did not have
+! a constant value expression.
+!
+! Modified dg-error for PR41807
+!
+! Contributed by Philippe Marguinaud <philippe.marguinaud@meteo.fr>
+!
+ TYPE POINT
+ REAL :: X
+ ENDTYPE
+ TYPE(POINT) :: P
+ DATA P / POINT(1.+X) / ! { dg-error "non-constant initialization" }
+ print *, p
+ END