mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
41 lines
478 B
C
41 lines
478 B
C
module foo;
|
|
|
|
struct Bar
|
|
{
|
|
int x;
|
|
}
|
|
|
|
module baz;
|
|
import foo;
|
|
import std::io;
|
|
|
|
fn void foo::Bar.test(Bar *bar)
|
|
{
|
|
io::printn("Inside of baz::Bar.test");
|
|
}
|
|
|
|
module abc;
|
|
import foo;
|
|
import baz;
|
|
|
|
fn int main()
|
|
{
|
|
Bar bar;
|
|
bar.test();
|
|
return 0;
|
|
}
|
|
|
|
/* #expect: abc.ll
|
|
|
|
%Bar = type { i32 }
|
|
|
|
define i32 @main() #0 {
|
|
entry:
|
|
%bar = alloca %Bar, align 4
|
|
store i32 0, ptr %bar, align 4
|
|
call void @foo.Bar.test(ptr %bar)
|
|
ret i32 0
|
|
}
|
|
|
|
declare void @foo.Bar.test(ptr)
|