w6c+selfhost: same-module preference for bare-leaf lookup
This commit is contained in:
20
test/wcc/data/samemodprefer/pos.ww
Normal file
20
test/wcc/data/samemodprefer/pos.ww
Normal file
@@ -0,0 +1,20 @@
|
||||
// Positive case: two modules each export `read` with DIFFERENT
|
||||
// signatures (mod1: i32 → i32, mod2: str → i32). Each module also
|
||||
// exports a `caller` that invokes bare `read(...)` with its own arg
|
||||
// type. The bare-leaf inside mod1 must bind to mod1.read; inside mod2
|
||||
// to mod2.read. If preference doesn't kick in and the bare lookup
|
||||
// picks the other module's `read`, the build fails with a signature
|
||||
// mismatch at check-time. The driver test asserts that this fixture
|
||||
// builds successfully.
|
||||
//
|
||||
// We don't assert runtime exit codes here because cgen still emits
|
||||
// unmangled `TEXT read` labels for both modules and the linker
|
||||
// collapses them — that's a separate codegen sweep, orthogonal to the
|
||||
// resolver fix this test pins.
|
||||
|
||||
use mod1;
|
||||
use mod2;
|
||||
|
||||
fn main() i32 = {
|
||||
return 0i32;
|
||||
};
|
||||
Reference in New Issue
Block a user