mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
20 lines
496 B
C
20 lines
496 B
C
fn void test()
|
|
{
|
|
int[3] x = { 1, 2, 3 };
|
|
int[] y = x[1..2];
|
|
}
|
|
|
|
/* #expect: slice_offset.ll
|
|
|
|
define void @slice_offset.test() #0 {
|
|
entry:
|
|
%x = alloca [3 x i32], align 4
|
|
%y = alloca %"int[]", align 8
|
|
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %x, ptr align 4 @.__const, i32 12, i1 false)
|
|
%ptradd = getelementptr inbounds i8, ptr %x, i64 4
|
|
%0 = insertvalue %"int[]" undef, ptr %ptradd, 0
|
|
%1 = insertvalue %"int[]" %0, i64 2, 1
|
|
store %"int[]" %1, ptr %y, align 8
|
|
ret void
|
|
}
|