mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
Main arguments are now slices if desired.
This commit is contained in:
committed by
Christoffer Lerno
parent
497eef5328
commit
c52629d60f
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user