diff --git a/tests/expression/1.0/IExpression.hal b/tests/expression/1.0/IExpression.hal index 2db9f617ce..36aed608a7 100644 --- a/tests/expression/1.0/IExpression.hal +++ b/tests/expression/1.0/IExpression.hal @@ -147,6 +147,28 @@ interface IExpression { logand4 = (0 && 1) == 0, }; + // Tests for enum tags + enum NoElements : uint32_t {}; + enum OneElement : uint32_t {A}; + enum TwoElement : uint32_t {A,B}; + enum TwoCollidingElements : uint32_t {A=1,B=1}; + enum ThreeFromInheritance : TwoElement {C}; + enum ThreeFromDoubleInheritance : ThreeFromInheritance {}; + enum ThreeCollidingFromInheritance : TwoCollidingElements {C}; + + enum EnumTagTest : uint32_t { + a = NoElements#len == 0, + b = OneElement#len == 1, + c = TwoElement#len == 2, + d = TwoCollidingElements#len == 2, + e = ThreeFromInheritance#len == 3, + f = ThreeFromDoubleInheritance#len == 3, + g = ThreeCollidingFromInheritance#len == 3, + + // fine to reference current enum as well + h = EnumTagTest#len == 8, + }; + enum Grayscale : int8_t { WHITE = 126, GRAY, // 127