xref: /llvm-project/flang/test/Semantics/resolve60.f90 (revision 502e7690c3c9698a6982a490f6bf92b0fd24d10f)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2! Testing 7.6 enum
3
4  ! OK
5  enum, bind(C)
6    enumerator :: red, green
7    enumerator blue, pink
8    enumerator yellow
9    enumerator :: purple = 2
10  end enum
11
12  integer(yellow) anint4
13
14  enum, bind(C)
15    enumerator :: square, cicrle
16    !ERROR: 'square' is already declared in this scoping unit
17    enumerator square
18  end enum
19
20  dimension :: apple(4)
21  real :: peach
22
23  enum, bind(C)
24    !ERROR: 'apple' is already declared in this scoping unit
25    enumerator :: apple
26    enumerator :: pear
27    !ERROR: 'peach' is already declared in this scoping unit
28    enumerator :: peach
29    !ERROR: 'red' is already declared in this scoping unit
30    enumerator :: red
31  end enum
32
33  enum, bind(C)
34    !ERROR: Enumerator value could not be computed from the given expression
35    !WARNING: INTEGER(4) division by zero
36    !ERROR: Must be a constant value
37    enumerator :: wrong = 0/0
38  end enum
39
40end
41