authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-06-19 15:29:53+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-06-19 15:29:53+02:00
logd004f775ce4a288c03d6986518bc6fe423c99e3c
treeb3702f5509f142cc215d71d8e7d3e303c1513549
parent10083cc23e66a62a85d642faf7891b9ef3a6cdde
parente6d26bf962b75b4f0dc200d56fa5776e39f5a18e

Merge pull request 'fix C ABI lowering for x32 + re-enable tests' (#35848) from alexrp/zig:x32-abi-tests into master

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35848

2 files changed, 10 insertions(+), 10 deletions(-)

src/codegen/llvm/FuncGen.zig+3-3
......@@ -6663,7 +6663,7 @@ const ParamTypeIterator = struct {
66636663 .async => {
66646664 @panic("TODO implement async function lowering in the LLVM backend");
66656665 },
6666 .x86_64_sysv => return it.nextSystemV(ty),
6666 .x86_64_sysv, .x86_64_x32 => return it.nextSystemV(ty),
66676667 .x86_64_win => return it.nextWin64(ty),
66686668 .x86_stdcall => {
66696669 it.zig_index += 1;
......@@ -6940,7 +6940,7 @@ pub fn firstParamSRet(fn_info: InternPool.Key.FuncType, zcu: *Zcu, target: *cons
69406940
69416941 return switch (fn_info.cc) {
69426942 .auto => returnTypeByRef(zcu, target, return_type),
6943 .x86_64_sysv => firstParamSRetSystemV(return_type, zcu, target),
6943 .x86_64_sysv, .x86_64_x32 => firstParamSRetSystemV(return_type, zcu, target),
69446944 .x86_64_win => x86_64_abi.classifyWindows(return_type, zcu, target, .ret) == .memory,
69456945 .x86_sysv, .x86_win => isByRef(return_type, zcu),
69466946 .x86_stdcall => !isScalar(zcu, return_type),
......@@ -6999,7 +6999,7 @@ pub fn lowerFnRetTy(o: *Object, fn_info: InternPool.Key.FuncType) Allocator.Erro
69996999 switch (fn_info.cc) {
70007000 .@"inline" => unreachable,
70017001 .auto => return if (returnTypeByRef(zcu, target, return_type)) .void else o.lowerType(return_type),
7002 .x86_64_sysv => return lowerSystemVFnRetTy(o, fn_info),
7002 .x86_64_sysv, .x86_64_x32 => return lowerSystemVFnRetTy(o, fn_info),
70037003 .x86_64_win => return lowerWin64FnRetTy(o, fn_info),
70047004 .x86_stdcall => return if (isScalar(zcu, return_type)) o.lowerType(return_type) else .void,
70057005 .x86_fastcall => return lowerX86FastcallFnRetTy(o, zcu, return_type),
test/tests.zig+7-7
......@@ -1991,13 +1991,13 @@ const c_abi_targets = blk: {
19911991 },
19921992 .use_llvm = true,
19931993 },
1994 // .{
1995 // .target = .{
1996 // .cpu_arch = .x86_64,
1997 // .os_tag = .linux,
1998 // .abi = .muslx32,
1999 // },
2000 // },
1994 .{
1995 .target = .{
1996 .cpu_arch = .x86_64,
1997 .os_tag = .linux,
1998 .abi = .muslx32,
1999 },
2000 },
20012001
20022002 // WASI Targets
20032003