Main arguments are now slices if desired.

This commit is contained in:
Christoffer Lerno
2021-12-16 23:31:27 +01:00
committed by Christoffer Lerno
parent 497eef5328
commit c52629d60f
66 changed files with 421 additions and 139 deletions

View File

@@ -1,10 +1,11 @@
// #target: x64-darwin
module foo;
fn void main()
fn int main()
{
char[2] x = "ab";
char[*] y = "abc";
return 0;
}
/* #expect: foo.ll
@@ -12,7 +13,7 @@ fn void main()
@.str = private constant [3 x i8] c"ab\00", align 1
@.str.1 = private constant [4 x i8] c"abc\00", align 1
define void @main() #0 {
define i32 @main() #0 {
entry:
%x = alloca [2 x i8], align 1
%y = alloca [3 x i8], align 1
@@ -20,5 +21,5 @@ entry:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %0, i8* align 8 getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i32 2, i1 false)
%1 = bitcast [3 x i8]* %y to i8*
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 8 getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i32 3, i1 false)
ret void
ret i32 0
}