Merge "Tests for Enum#len"

This commit is contained in:
Steven Moreland 2018-11-06 22:55:49 +00:00 committed by Gerrit Code Review
commit 2267c72423

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