summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/enum_2.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/enum_2.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/enum_2.f9015
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/enum_2.f90 b/gcc/testsuite/gfortran.dg/enum_2.f90
new file mode 100644
index 000000000..8f7aea1f0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/enum_2.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! Program to test ENUM parsing errors
+
+program main
+ implicit none
+ enum, bind (c)
+ enumerator :: red, black
+ integer :: x ! { dg-error "Unexpected data declaration" }
+ enumerator blue = 1 ! { dg-error "Syntax error in ENUMERATOR definition" }
+ end enum
+
+ red = 42 ! { dg-error "variable definition context" }
+
+ enumerator :: sun ! { dg-error "ENUM" }
+end program main