Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e878f8b authored by Steven Moreland's avatar Steven Moreland Committed by android-build-merger
Browse files

Merge "Tests for Enum#len"

am: 2267c724

Change-Id: I03b433676863f511d28bb51d591aada772403392
parents 27584f23 2267c724
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -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