Files
c3c/test/test_suite/cast/cast_narrow_alias.c3t
Christoffer Lerno 8b49e6c14d Rename def to alias.
2025-03-13 11:22:27 +01:00

27 lines
563 B
Plaintext

// #target: macos-x64
module abc;
alias UInt8 = char;
fn void main()
{
UInt8 x = 17;
UInt8 y = 5;
UInt8 z = (x >> y) & 0x1;
}
/* #expect: abc.ll
entry:
%x = alloca i8, align 1
%y = alloca i8, align 1
%z = alloca i8, align 1
store i8 17, ptr %x, align 1
store i8 5, ptr %y, align 1
%0 = load i8, ptr %x, align 1
%zext = zext i8 %0 to i32
%1 = load i8, ptr %y, align 1
%zext1 = zext i8 %1 to i32
%lshr = lshr i32 %zext, %zext1
%2 = freeze i32 %lshr
%and = and i32 %2, 1
%trunc = trunc i32 %and to i8
store i8 %trunc, ptr %z, align 1