mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- 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.
29 lines
661 B
Plaintext
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
|
|
}
|
|
|