Files
c3c/test/test_suite/methods/extension_method_in_other_modules.c3t
2022-07-20 12:22:03 +02:00

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
}