Files
c3c/test/test_suite/constants/constants.c3t

39 lines
782 B
Plaintext

const char AA = ~cast(0 as char);
const char BB = 200 ;
const uint CC = ~cast(0 as uint);
const uint DD = FOO;
const FOO = ~cast(0 as uint);
uint x = AA;
uint z = CC;
char w = cast(FOO as char);
ushort v = cast(FOO as ushort);
uint z2 = DD;
func void test()
{
int xx = FOO;
uint* yy = &&FOO;
}
// #expect: constants.ll
@AA = protected constant i8 -1
@BB = protected constant i8 -56
@CC = protected constant i32 -1
@DD = protected constant i32 -1
@x = protected global i32 255
@z = protected global i32 -1
@w = protected global i8 -1
@v = protected global i16 -1
@z2 = protected global i32 -1
entry:
%xx = alloca i32
%yy = alloca i32*
%taddr = alloca i32
store i32 -1, i32* %xx
store i32 -1, i32* %taddr
store i32* %taddr, i32** %yy
ret void