mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
40 lines
491 B
C
40 lines
491 B
C
module foo;
|
|
|
|
struct Bar
|
|
{
|
|
int x;
|
|
}
|
|
|
|
module baz;
|
|
import foo;
|
|
import std::io;
|
|
|
|
fn void foo::Bar.test(Bar *bar)
|
|
{
|
|
io::println("Inside of baz::Bar.test");
|
|
}
|
|
|
|
module abc;
|
|
import foo;
|
|
import baz;
|
|
|
|
fn int main()
|
|
{
|
|
Bar bar;
|
|
bar.test();
|
|
return 0;
|
|
}
|
|
|
|
// #expect: abc.ll
|
|
|
|
|
|
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 i32 0
|
|
|
|
declare void @foo.Bar__test(%Bar*)
|