mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
38 lines
521 B
Plaintext
38 lines
521 B
Plaintext
module foo;
|
|
|
|
struct Bar
|
|
{
|
|
int x;
|
|
}
|
|
|
|
module baz;
|
|
import foo;
|
|
import std::io;
|
|
|
|
func void foo::Bar.test(Bar *bar)
|
|
{
|
|
io::println("Inside of baz::Bar.test");
|
|
}
|
|
|
|
module abc;
|
|
import foo;
|
|
import baz;
|
|
|
|
func void main()
|
|
{
|
|
Bar bar;
|
|
bar.test();
|
|
}
|
|
|
|
// #expect: abc.ll
|
|
|
|
declare void @foo.Bar__test(%Bar*)
|
|
|
|
define void @main()
|
|
entry:
|
|
%bar = alloca %Bar, align 4
|
|
%0 = bitcast %Bar* %bar to i8*
|
|
call void @llvm.memset.p0i8.i64(i8* align 4 %0, i8 0, i64 4, i1 false)
|
|
call void @foo.Bar__test(%Bar* %bar)
|
|
ret void
|