25 lines
538 B
Plaintext
25 lines
538 B
Plaintext
//ww:compile
|
|
// migrated from test/wcc/697_samemod_prefer.c: bare-leaf `read` binds same-module first; compile-only (unmangled TEXT read labels still collapse in the linker).
|
|
package mod1;
|
|
export fn read(x: i32) i32 = {
|
|
return x + 100i32;
|
|
};
|
|
export fn caller() i32 = {
|
|
return read(1i32);
|
|
};
|
|
package mod2;
|
|
export fn read(x: str) i32 = {
|
|
return x.len + 200i32;
|
|
};
|
|
export fn caller() i32 = {
|
|
return read("ok");
|
|
};
|
|
package main;
|
|
import mod1;
|
|
import mod2;
|
|
fn main() i32 = {
|
|
let _ = mod1.caller();
|
|
let _ = mod2.caller();
|
|
return 0i32;
|
|
};
|