mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
43 lines
562 B
Plaintext
43 lines
562 B
Plaintext
// #target: macos-x64
|
|
module foob;
|
|
struct Foo
|
|
{
|
|
int x;
|
|
}
|
|
fn void Foo.test(Foo* f)
|
|
{}
|
|
|
|
module baz;
|
|
import foob;
|
|
fn void Foo.test2(Foo* f, int x)
|
|
{}
|
|
fn void main()
|
|
{
|
|
Foo f;
|
|
f.test();
|
|
f.test2(123);
|
|
}
|
|
|
|
/* #expect: foob.ll
|
|
|
|
define void @foob.Foo.test(ptr %0) #0 {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
// #expect: baz.ll
|
|
|
|
define void @foob.Foo.test2(ptr %0, i32 %1) #0 {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
define void @baz.main() #0 {
|
|
entry:
|
|
%f = alloca %Foo, align 4
|
|
store i32 0, ptr %f, align 4
|
|
call void @foob.Foo.test(ptr %f)
|
|
call void @foob.Foo.test2(ptr %f, i32 123)
|
|
ret void
|
|
}
|