authorgravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2023-11-05 23:36:11-05:00
committergravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2023-11-05 23:36:11-05:00
log50e2fb8fd0e1aae5fc3123d6f26d7420d4baa41c
treea702af215eae124d4289d1ac5364571a101228b8
parent8c0e0cd3535d4e59a01dc49f9b93c922ca63114f

cbe: fixup __asm style exports, re-enable 12680 on macos now that alias isn't used


2 files changed, 4 insertions(+), 7 deletions(-)

lib/zig.h+4-2
......@@ -194,9 +194,11 @@ typedef char bool;
194194#endif /*_M_X64 */
195195#else /* _MSC_VER */
196196#if __APPLE__
197#define zig_export(sig, symbol, name) __asm("_" name " = _" #symbol)
197#define zig_export(sig, symbol, name) zig_extern sig;\
198 __asm("_" name " = _" #symbol)
198199#else /* __APPLE__ */
199#define zig_export(sig, symbol, name) __asm(name " = " #symbol)
200#define zig_export(sig, symbol, name) zig_extern sig;\
201 __asm(name " = " #symbol)
200202#endif /* __APPLE__ */
201203#endif /* _MSC_VER */
202204
test/behavior/bugs/12680.zig-5
......@@ -12,11 +12,6 @@ test "export a function twice" {
1212 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1313 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf) return error.SkipZigTest;
1414
15 if (builtin.os.tag == .macos and builtin.zig_backend == .stage2_c) {
16 // TODO: test.c: error: aliases are not supported on darwin
17 return error.SkipZigTest;
18 }
19
2015 // If it exports the function correctly, `test_func` and `testFunc` will points to the same address.
2116 try expectEqual(test_func(), other_file.testFunc());
2217}