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

@@ -30,7 +30,7 @@ fn void MyEnum.hello(MyEnum *myenum)
{
io::println("Hello from MyEnum");
}
fn void main()
fn int main()
{
Foo f;
Bar b;
@@ -38,6 +38,7 @@ fn void main()
f.hello();
b.hello();
a.hello();
return 0;
}
// #expect: foo.ll
@@ -60,7 +61,7 @@ define void @foo.MyEnum__hello(i32* %0)
%1 = call i32 @"std::io.println"(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i32 0, i32 0))
ret void
define void @main()
define i32 @main()
entry:
%f = alloca i64, align 8
%b = alloca i32, align 4
@@ -71,4 +72,4 @@ entry:
call void @foo.Foo__hello(i64* %f)
call void @foo.Bar__hello(i32* %b)
call void @foo.MyEnum__hello(i32* %a)
ret void
ret i32 0

View File

@@ -18,20 +18,21 @@ module abc;
import foo;
import baz;
fn void main()
fn int main()
{
Bar bar;
bar.test();
return 0;
}
// #expect: abc.ll
declare void @foo.Bar__test(%Bar*)
define void @main()
define i32 @main()
entry:
%bar = alloca %Bar, align 4
%0 = bitcast %Bar* %bar to i32*
store i32 0, i32* %0, align 4
call void @foo.Bar__test(%Bar* %bar)
ret void
ret i32 0