mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
44 lines
603 B
C
44 lines
603 B
C
// #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(%Foo* %0) #0 {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
// #expect: baz.ll
|
|
|
|
define void @foob_Foo_test2(%Foo* %0, i32 %1) #0 {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
define void @baz_main() #0 {
|
|
entry:
|
|
%f = alloca %Foo, align 4
|
|
%0 = bitcast %Foo* %f to i32*
|
|
store i32 0, i32* %0, align 4
|
|
call void @foob_Foo_test(%Foo* %f)
|
|
call void @foob_Foo_test2(%Foo* %f, i32 123)
|
|
ret void
|
|
}
|