mirror of
https://github.com/ziglang/zig.git
synced 2025-12-14 02:03:08 +00:00
Zig allows multiple extern functions with the same name, and the backends have to handle this possibility. For LLVM, we keep a sparse map of collisions, and then resolve them in flushModule(). This introduces some technical debt that will have to be resolved when adding incremental compilation support to the LLVM backend.
23 lines
665 B
Zig
23 lines
665 B
Zig
const A = extern struct {
|
|
field: c_int,
|
|
};
|
|
|
|
extern fn issue529(?*A) void;
|
|
|
|
comptime {
|
|
_ = @import("529_other_file_2.zig");
|
|
}
|
|
|
|
const builtin = @import("builtin");
|
|
|
|
test "issue 529 fixed" {
|
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
|
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
|
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
|
|
|
@import("529_other_file.zig").issue529(null);
|
|
issue529(null);
|
|
}
|