mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Linker errors when shadowing @local with public function #2198
This commit is contained in:
50
test/test_suite/globals/linking_locals.c3t
Normal file
50
test/test_suite/globals/linking_locals.c3t
Normal 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
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user