Linker errors when shadowing @local with public function #2198

This commit is contained in:
Christoffer Lerno
2025-06-18 02:07:07 +02:00
parent eb75d8f82a
commit a55f56a88f
9 changed files with 83 additions and 15 deletions

View File

@@ -0,0 +1,50 @@
// #target: macos-x64
module mod;
fn void call_foo() => foo();
fn void foo() @local {}
module mod;
fn void foo() @local {}
macro test() => foo();
module test;
import mod;
fn void main() {
mod::call_foo();
mod::test();
}
/* #expect: test.ll
define void @test.main() #0 {
entry:
call void @mod.call_foo()
call void @mod.foo.
ret void
}
declare void @mod.call_foo() #0
declare void @mod.foo
/* #expect: mod.ll
define void @mod.call_foo()
entry:
call void @mod.foo.
ret void
define internal void @mod.foo.
entry:
ret void
}
define void @mod.foo.
entry:
ret void
}

View File

@@ -25,7 +25,7 @@ fn int main(String[] args)
}
/* #expect: test.ll
define internal i64 @test.load_corpus2(ptr %0, i64 %1, ptr %2, i64 %3) #0 {
define internal i64 @test.load_corpus2
entry:
%code = alloca %"char[]", align 8
%path = alloca %"char[]", align 8