summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/enum_8.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/enum_8.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/enum_8.f9015
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/enum_8.f90 b/gcc/testsuite/gfortran.dg/enum_8.f90
new file mode 100644
index 000000000..819c58708
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/enum_8.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! Program to test the initialisation range of enumerators
+! and kind values check
+
+program main
+ implicit none
+ enum, bind (c)
+ enumerator :: pp, qq = 4294967295, rr ! { dg-error "too big for its kind" }
+ end enum ! { dg-error "has no ENUMERATORS" }
+
+ enum, bind (c)
+ enumerator :: p , q = 4294967299_8, r ! { dg-error "Arithmetic overflow" }
+ end enum ! { dg-error "has no ENUMERATORS" }
+
+end program main