Files
c3c/test/test_suite/methods/extension_method_in_other_modules.c3t
2023-02-20 17:48:47 +01:00

43 lines
562 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(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
}