Files
c3c/test/test_suite/subarrays/slice_offset_neg_end.c3t

20 lines
565 B
Plaintext

func void test()
{
int[3] x = { 1, 2, 3 };
int[] y = x[1..^1];
}
// #expect: slice_offset_neg_end.ll
%x = alloca [3 x i32], align 4
%y = alloca %"int[]", align 8
%0 = bitcast [3 x i32]* %x to i8*
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %0, i8* align 4 bitcast ([3 x i32]* @.__const to i8*), i32 12, i1 false)
%1 = bitcast [3 x i32]* %x to i32*
%offset = getelementptr inbounds i32, i32* %1, i64 1
%2 = insertvalue %"int[]" undef, i32* %offset, 0
%3 = insertvalue %"int[]" %2, i64 2, 1
store %"int[]" %3, %"int[]"* %y, align 8