Merge "Tests for Enum#len"

am: 2267c72423

Change-Id: I03b433676863f511d28bb51d591aada772403392
This commit is contained in:
Steven Moreland 2018-11-06 15:19:32 -08:00 committed by android-build-merger
commit 0e878f8b10

View file

@ -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