function main(): i32 {
.0:
stack_alloc [i8 x 1], %0:ptr
store 1000:i8, %0:ptr
ret 0:i32
}
Of course you can't store 1000 in an i8, so this should wrap the integer around correctly 232.
(In fact clang actually warns about this, and gives this
C:\helix\.\testsuite\f.c:4:15: warning: implicit conversion from 'int' to 'u8' (aka 'unsigned char') changes value from
1000 to 232 [-Wconstant-conversion]
u8 my_byte = 1000;
~~~~~~~ ^~~~
Given this C code
the following IR is generated
Of course you can't store 1000 in an i8, so this should wrap the integer around correctly 232.
(In fact clang actually warns about this, and gives this