Files
c3c/test/test_suite/enumerations/compile_time.c3t
2021-05-23 23:55:10 +02:00

20 lines
576 B
Plaintext

enum MyEnum : short
{
HELO = 12,
WORLD = 14,
BYE = -5
}
int myenum_max = MyEnum.max;
int myenum_min = MyEnum.min;
int myenum_elements = MyEnum.elements;
int myenum_alignof = MyEnum.alignof;
int myenum_sizeof = MyEnum.sizeof;
// #expect: compile_time.ll
@compile_time.myenum_max = protected global i32 14, align 4
@compile_time.myenum_min = protected global i32 -5, align 4
@compile_time.myenum_elements = protected global i32 3, align 4
@compile_time.myenum_alignof = protected global i32 2, align 4
@compile_time.myenum_sizeof = protected global i32 2, align 4