summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/enum_6.f90
blob: 1c7c027a351b51e945b9711ba2cbf48944de304d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
! { dg-do compile }
! Program to test ENUM parsing errors 

program main
  implicit none
  integer :: i = 1

  enum, bind (c)
    enumerator :: sun, mon = 2    
    i = 2  ! { dg-error "Unexpected" }  
    enumerator :: wed = 1    
  end enum       

  i = 1

  enum, bind (c)  ! { dg-error "Unexpected" } 
    enumerator :: red, black = 2  ! { dg-error "ENUM definition statement expected" }
    enumerator :: blue = 1  ! { dg-error "ENUM definition statement expected" }
  end enum  ! { dg-error "Expecting END PROGRAM" }

end program main