Files
c3c/test/test_suite/vector/vector_from_hex.c3t
Christoffer Lerno 4512c6446d - Empty struct after @if processing was not detected, causing a crash instead of an error.
- Comparing an uint and int[<4>] was incorrectly assumed to be uint compared to int, causing a crash instead of an error.
- When an `int[*][6]` was given too few values, the compiler would assert instead of giving an error.
2026-01-19 15:01:08 +01:00

29 lines
661 B
Plaintext

// #target: macos-x64
module test;
char[<*>] fooy = x'dead';
char[<*>] fooy2 = { 0xde, 0xad };
fn void main()
{
char x = fooy[0];
char x2 = fooy2[0];
}
/* #expect: test.ll
@test.fooy = local_unnamed_addr global [2 x i8] c"\DE\AD", align 2
@test.fooy2 = local_unnamed_addr global <2 x i8> <i8 -34, i8 -83>, align 2
define void @test.main() #0 {
entry:
%x = alloca i8, align 1
%x2 = alloca i8, align 1
%0 = load <2 x i8>, ptr @test.fooy, align 2
%1 = extractelement <2 x i8> %0, i64 0
store i8 %1, ptr %x, align 1
%2 = load <2 x i8>, ptr @test.fooy2, align 2
%3 = extractelement <2 x i8> %2, i64 0
store i8 %3, ptr %x2, align 1
ret void
}