authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2026-06-27 02:05:27-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2026-07-27 14:43:52-04:00
log092f019be98b9cba5ecdc9a2b1a14ba107479a41
tree336e60c055f7e464dfaee11e564997255593f7a0
parent6aed49f6baad85fc4a509f4c631da8c623e7c28f

llvm: implement placeholder powerpc64le c abi logic

This was honestly easier than disabling most of the tests.

4 files changed, 172 insertions(+), 152 deletions(-)

src/codegen/llvm/FuncGen.zig+61-50
......@@ -6987,25 +6987,12 @@ const ParamTypeIterator = struct {
69876987 .async => {
69886988 @panic("TODO implement async function lowering in the LLVM backend");
69896989 },
6990 .x86_64_sysv, .x86_64_x32 => return try it.next_x86_64_sysv(ty),
6991 .x86_64_win => return it.next_x86_64_win(ty),
6992 .x86_stdcall => {
6993 it.zig_index += 1;
6994 it.llvm_index += 1;
6995
6996 if (isScalar(zcu, ty)) {
6997 return .byval;
6998 } else {
6999 it.byval_attr = true;
7000 return .byref;
7001 }
7002 },
70036990 .aarch64_aapcs, .aarch64_aapcs_darwin, .aarch64_aapcs_win => {
70046991 it.zig_index += 1;
70056992 it.llvm_index += 1;
70066993 switch (aarch64_c_abi.classifyType(ty, zcu)) {
70076994 .memory => return .byref_mut,
7008 .float_array => |len| return Lowering{ .float_array = len },
6995 .float_array => |len| return .{ .float_array = len },
70096996 .byval => return .byval,
70106997 .integer => {
70116998 it.types_buffer[0..1].* = .{.i64};
......@@ -7013,7 +7000,7 @@ const ParamTypeIterator = struct {
70137000 it.types_len = 1;
70147001 return .multiple_llvm_types;
70157002 },
7016 .double_integer => return Lowering{ .i64_array = 2 },
7003 .double_integer => return .{ .i64_array = 2 },
70177004 }
70187005 },
70197006 .arm_aapcs, .arm_aapcs_vfp => {
......@@ -7025,8 +7012,8 @@ const ParamTypeIterator = struct {
70257012 return .byref;
70267013 },
70277014 .byval => return .byval,
7028 .i32_array => |size| return Lowering{ .i32_array = size },
7029 .i64_array => |size| return Lowering{ .i64_array = size },
7015 .i32_array => |size| return .{ .i32_array = size },
7016 .i64_array => |size| return .{ .i64_array = size },
70307017 }
70317018 },
70327019 .mips_o32 => {
......@@ -7038,9 +7025,19 @@ const ParamTypeIterator = struct {
70387025 return .byref;
70397026 },
70407027 .byval => return .byval,
7041 .i32_array => |size| return Lowering{ .i32_array = size },
7028 .i32_array => |size| return .{ .i32_array = size },
70427029 }
70437030 },
7031 .powerpc64_elf_v2 => {
7032 it.zig_index += 1;
7033 it.llvm_index += 1;
7034 if (isByRef(ty, zcu)) return switch (ty.abiSize(zcu)) {
7035 1...8 => .abi_sized_int,
7036 9...64 => |abi_size| .{ .i64_array = @intCast(@divCeil(abi_size, 8)) },
7037 else => .byref,
7038 };
7039 return .byval; // TODO
7040 },
70447041 .riscv64_lp64, .riscv32_ilp32 => {
70457042 it.zig_index += 1;
70467043 it.llvm_index += 1;
......@@ -7048,7 +7045,7 @@ const ParamTypeIterator = struct {
70487045 .memory => return .byref_mut,
70497046 .byval => return .byval,
70507047 .integer => return .abi_sized_int,
7051 .double_integer => return Lowering{ .i64_array = 2 },
7048 .double_integer => return .{ .i64_array = 2 },
70527049 .fields => {
70537050 it.types_len = 0;
70547051 var field_it: InternPool.LoadedStructType.RuntimeOrderIterator = if (zcu.typeToStruct(ty)) |loaded_struct|
......@@ -7108,6 +7105,19 @@ const ParamTypeIterator = struct {
71087105 return .byref;
71097106 },
71107107 },
7108 .x86_stdcall => {
7109 it.zig_index += 1;
7110 it.llvm_index += 1;
7111
7112 if (isScalar(zcu, ty)) {
7113 return .byval;
7114 } else {
7115 it.byval_attr = true;
7116 return .byref;
7117 }
7118 },
7119 .x86_64_sysv, .x86_64_x32 => return try it.next_x86_64_sysv(ty),
7120 .x86_64_win => return it.next_x86_64_win(ty),
71117121 // TODO investigate other callconvs
71127122 else => {
71137123 it.zig_index += 1;
......@@ -7294,7 +7304,7 @@ pub fn fnReturnStrat(o: *Object, cc: std.lang.CallingConvention, ret_ty: Type) A
72947304 const zcu = o.zcu;
72957305 ret_ty.assertHasLayout(zcu);
72967306 if (!ret_ty.hasRuntimeBits(zcu)) return .void;
7297 switch (cc) {
7307 return switch (cc) {
72987308 .@"inline" => unreachable,
72997309 .auto => {
73007310 // Match the c calling convention in some cases to avoid llvm bugs.
......@@ -7307,36 +7317,31 @@ pub fn fnReturnStrat(o: *Object, cc: std.lang.CallingConvention, ret_ty: Type) A
73077317 33...64 => .{ .mem_cast = .double },
73087318 else => .by_val,
73097319 };
7310
7311 if (isByRef(ret_ty, zcu)) return .sret;
7312 return .by_val;
7320 return if (isByRef(ret_ty, zcu)) .sret else .by_val;
73137321 },
7314 .x86_64_sysv, .x86_64_x32 => return fnReturnStrat_x86_64_sysv(o, ret_ty),
7315 .x86_64_win => return fnReturnStrat_x86_64_win(o, ret_ty),
7316 .x86_stdcall => if (isScalar(zcu, ret_ty)) {
7317 assert(!isByRef(ret_ty, zcu));
7318 return .by_val;
7319 } else return .sret,
7320 .x86_fastcall => return fnReturnStrat_x86_fastcall(o, zcu, ret_ty),
7321 .x86_sysv, .x86_win => return if (isByRef(ret_ty, zcu)) .sret else .by_val,
73227322 .aarch64_aapcs, .aarch64_aapcs_darwin, .aarch64_aapcs_win => switch (aarch64_c_abi.classifyType(ret_ty, zcu)) {
7323 .memory => return .sret,
7324 .float_array, .byval => return .forceByVal(o, ret_ty),
7325 .integer => return .{ .mem_cast = .i64 },
7326 .double_integer => return .{ .mem_cast = try o.builder.arrayType(2, .i64) },
7323 .memory => .sret,
7324 .float_array, .byval => .forceByVal(o, ret_ty),
7325 .integer => .{ .mem_cast = .i64 },
7326 .double_integer => .{ .mem_cast = try o.builder.arrayType(2, .i64) },
73277327 },
73287328 .arm_aapcs, .arm_aapcs_vfp => switch (arm_c_abi.classifyType(ret_ty, zcu, .ret)) {
7329 .memory, .i64_array => return .sret,
7330 .i32_array => |len| return if (len == 1) .{ .mem_cast = .i32 } else .sret,
7331 .byval => return .forceByVal(o, ret_ty),
7329 .memory, .i64_array => .sret,
7330 .i32_array => |len| if (len == 1) .{ .mem_cast = .i32 } else .sret,
7331 .byval => .forceByVal(o, ret_ty),
73327332 },
73337333 .mips_o32 => switch (mips_c_abi.classifyType(ret_ty, zcu, .ret)) {
7334 .memory, .i32_array => return .sret,
7335 .byval => return .forceByVal(o, ret_ty),
7334 .memory, .i32_array => .sret,
7335 .byval => .forceByVal(o, ret_ty),
73367336 },
7337 .powerpc64_elf_v2 => if (isByRef(ret_ty, zcu)) switch (ret_ty.abiSize(zcu)) {
7338 1...8 => .{ .mem_cast = try o.builder.intType(@intCast(ret_ty.abiSize(zcu) * 8)) },
7339 9...16 => .{ .mem_cast = try o.builder.structType(.normal, &.{ .i64, .i64 }) },
7340 else => .sret,
7341 } else .by_val, // TODO
73377342 .riscv64_lp64, .riscv32_ilp32 => switch (riscv_c_abi.classifyType(ret_ty, zcu)) {
7338 .memory => return .sret,
7339 .integer => return .{ .mem_cast = try o.builder.intType(@intCast(ret_ty.abiSize(zcu) * 8)) },
7343 .memory => .sret,
7344 .integer => .{ .mem_cast = try o.builder.intType(@intCast(ret_ty.abiSize(zcu) * 8)) },
73407345 .double_integer => {
73417346 const integer: Builder.Type = switch (zcu.getTarget().cpu.arch) {
73427347 .riscv64, .riscv64be => .i64,
......@@ -7345,7 +7350,7 @@ pub fn fnReturnStrat(o: *Object, cc: std.lang.CallingConvention, ret_ty: Type) A
73457350 };
73467351 return .{ .mem_cast = try o.builder.structType(.normal, &.{ integer, integer }) };
73477352 },
7348 .byval => return .forceByVal(o, ret_ty),
7353 .byval => .forceByVal(o, ret_ty),
73497354 .fields => {
73507355 var types_len: usize = 0;
73517356 var types: [8]Builder.Type = undefined;
......@@ -7358,7 +7363,7 @@ pub fn fnReturnStrat(o: *Object, cc: std.lang.CallingConvention, ret_ty: Type) A
73587363 return .{ .mem_cast = try o.builder.structType(.normal, types[0..types_len]) };
73597364 },
73607365 },
7361 .s390x_sysv, .s390x_sysv_vx => return switch (s390x_c_abi.classifyType(ret_ty, .ret, zcu)) {
7366 .s390x_sysv, .s390x_sysv_vx => switch (s390x_c_abi.classifyType(ret_ty, .ret, zcu)) {
73627367 .none => .void,
73637368 .double_or_float, .vector, .simple => .by_val,
73647369 .simple_aggregate => unreachable,
......@@ -7368,14 +7373,20 @@ pub fn fnReturnStrat(o: *Object, cc: std.lang.CallingConvention, ret_ty: Type) A
73687373 .direct => |scalar_ty| if (scalar_ty.toIntern() == ret_ty.toIntern()) {
73697374 assert(!isByRef(ret_ty, zcu));
73707375 return .by_val;
7371 } else {
7372 return .{ .mem_cast = try o.lowerType(scalar_ty, .as_value) };
7373 },
7374 .indirect => return .sret,
7376 } else .{ .mem_cast = try o.lowerType(scalar_ty, .as_value) },
7377 .indirect => .sret,
73757378 },
7379 .x86_stdcall => if (isScalar(zcu, ret_ty)) {
7380 assert(!isByRef(ret_ty, zcu));
7381 return .by_val;
7382 } else .sret,
7383 .x86_fastcall => fnReturnStrat_x86_fastcall(o, zcu, ret_ty),
7384 .x86_sysv, .x86_win => if (isByRef(ret_ty, zcu)) .sret else .by_val,
7385 .x86_64_sysv, .x86_64_x32 => fnReturnStrat_x86_64_sysv(o, ret_ty),
7386 .x86_64_win => fnReturnStrat_x86_64_win(o, ret_ty),
73767387 // TODO investigate other callconvs
7377 else => return .forceByVal(o, ret_ty),
7378 }
7388 else => .forceByVal(o, ret_ty),
7389 };
73797390}
73807391
73817392fn fnReturnStrat_x86_fastcall(o: *Object, zcu: *Zcu, ty: Type) Allocator.Error!FnReturnStrat {
test/behavior/vector.zig-1
......@@ -736,7 +736,6 @@ test "vector reduce operation" {
736736 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
737737 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
738738 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
739 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isPowerPC()) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/195562
740739
741740 const S = struct {
742741 fn testReduce(comptime op: std.builtin.ReduceOp, x: anytype, expected: anytype) !void {
test/c_abi/cfuncs.c+7-7
......@@ -77,7 +77,7 @@ static void assert_or_panic(bool ok) {
7777# define ZIG_NO_COMPLEX
7878#endif
7979
80#ifdef ZIG_PPC32
80#ifdef __powerpc__
8181# define ZIG_NO_COMPLEX
8282#endif
8383
......@@ -15571,7 +15571,7 @@ void run_c_tests(void) {
1557115571#if !(defined(__i386__) && defined(_WIN32))
1557215572#ifndef __loongarch__
1557315573#ifndef ZIG_MIPS64
15574#ifndef __powerpc__
15574#ifndef ZIG_PPC32
1557515575 {
1557615576 struct Struct_i32_i32 s = {1, 2};
1557715577 zig_struct_i32_i32(s);
......@@ -15584,7 +15584,7 @@ void run_c_tests(void) {
1558415584#ifndef __hexagon__
1558515585#ifndef __loongarch__
1558615586#ifndef ZIG_MIPS64
15587#ifndef __powerpc__
15587#ifndef ZIG_PPC32
1558815588 {
1558915589 struct BigStruct s = {1, 2, 3, 4, 5};
1559015590 zig_big_struct(s);
......@@ -15616,7 +15616,7 @@ void run_c_tests(void) {
1561615616#ifndef __i386__
1561715617#ifndef __loongarch__
1561815618#ifndef ZIG_MIPS64
15619#ifndef __powerpc__
15619#ifndef ZIG_PPC32
1562015620 {
1562115621 struct SplitStructInts s = {1234, 100, 1337};
1562215622 zig_split_struct_ints(s);
......@@ -15630,7 +15630,7 @@ void run_c_tests(void) {
1563015630#ifndef __hexagon__
1563115631#ifndef __loongarch__
1563215632#ifndef ZIG_MIPS64
15633#ifndef __powerpc__
15633#ifndef ZIG_PPC32
1563415634 {
1563515635 struct MedStructMixed s = {1234, 100.0f, 1337.0f};
1563615636 zig_med_struct_mixed(s);
......@@ -15644,7 +15644,7 @@ void run_c_tests(void) {
1564415644#ifndef __i386__
1564515645#ifndef __loongarch__
1564615646#ifndef ZIG_MIPS64
15647#ifndef __powerpc__
15647#ifndef ZIG_PPC32
1564815648 {
1564915649 struct SplitStructMixed s = {1234, 100, 1337.0f};
1565015650 zig_split_struct_mixed(s);
......@@ -15658,7 +15658,7 @@ void run_c_tests(void) {
1565815658#ifndef __hexagon__
1565915659#ifndef __loongarch__
1566015660#ifndef ZIG_MIPS64
15661#ifndef __powerpc__
15661#ifndef ZIG_PPC32
1566215662 {
1566315663 struct BigStruct s = {30, 31, 32, 33, 34};
1566415664 struct BigStruct res = zig_big_struct_both(s);
test/c_abi/main.zig+104-94
......@@ -161,7 +161,7 @@ extern fn c_cmultf(a: ComplexFloat, b: ComplexFloat) ComplexFloat;
161161extern fn c_cmultd(a: ComplexDouble, b: ComplexDouble) ComplexDouble;
162162
163163const complex_abi_compatible = builtin.cpu.arch != .x86 and !builtin.cpu.arch.isMIPS() and
164 !builtin.cpu.arch.isArm() and !builtin.cpu.arch.isPowerPC32() and !builtin.cpu.arch.isRISCV() and
164 !builtin.cpu.arch.isArm() and !builtin.cpu.arch.isPowerPC() and !builtin.cpu.arch.isRISCV() and
165165 builtin.cpu.arch != .hexagon and
166166 builtin.cpu.arch != .s390x and
167167 !(builtin.cpu.arch.isLoongArch() and builtin.abi.float() == .soft);
......@@ -15384,7 +15384,7 @@ test "struct u8, u8" {
1538415384 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1538515385 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
1538615386 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
15387 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
15387 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1538815388 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
1538915389
1539015390 const s = c_ret_struct_u8_u8();
......@@ -15418,7 +15418,7 @@ test "struct u8, u8, u8" {
1541815418 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1541915419 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
1542015420 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
15421 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
15421 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1542215422 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
1542315423
1542415424 const s = c_ret_struct_u8_u8_u8();
......@@ -15455,7 +15455,7 @@ test "struct u8, u8, u8, u8" {
1545515455 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1545615456 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
1545715457 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
15458 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
15458 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1545915459 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
1546015460
1546115461 const s = c_ret_struct_u8_u8_u8_u8();
......@@ -15516,7 +15516,7 @@ test "struct u16, u16" {
1551615516 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1551715517 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
1551815518 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
15519 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
15519 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1552015520 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
1552115521
1552215522 const s = c_ret_struct_u16_u16();
......@@ -15550,7 +15550,7 @@ test "struct u16, u16, u16" {
1555015550 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1555115551 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
1555215552 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
15553 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
15553 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1555415554 if (builtin.cpu.arch.isRiscv32()) return error.SkipZigTest;
1555515555 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
1555615556
......@@ -15588,7 +15588,7 @@ test "struct u16, u16, u16, u16" {
1558815588 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1558915589 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
1559015590 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
15591 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
15591 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1559215592 if (builtin.cpu.arch.isRiscv32()) return error.SkipZigTest;
1559315593 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
1559415594
......@@ -15649,7 +15649,7 @@ extern fn c_test_struct_u32_u32() void;
1564915649test "struct u32, u32" {
1565015650 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
1565115651 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
15652 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
15652 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1565315653 if (builtin.cpu.arch.isRiscv32()) return error.SkipZigTest;
1565415654 if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest;
1565515655
......@@ -15684,7 +15684,7 @@ test "struct u32, u32, u32" {
1568415684 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1568515685 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
1568615686 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
15687 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
15687 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1568815688
1568915689 const s = c_ret_struct_u32_u32_u32();
1569015690 try expect(s.a == 8);
......@@ -15720,7 +15720,7 @@ test "struct u32, u32, u32, u32" {
1572015720 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1572115721 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
1572215722 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
15723 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
15723 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1572415724
1572515725 const s = c_ret_struct_u32_u32_u32_u32();
1572615726 try expect(s.a == 10);
......@@ -15866,7 +15866,7 @@ extern fn c_test_struct_u64_u64_u64() void;
1586615866test "struct u64, u64, u64" {
1586715867 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1586815868 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
15869 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
15869 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1587015870
1587115871 const s = c_ret_struct_u64_u64_u64();
1587215872 try expect(s.a == 8);
......@@ -15901,7 +15901,7 @@ extern fn c_test_struct_u64_u64_u64_u64() void;
1590115901test "struct u64, u64, u64, u64" {
1590215902 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1590315903 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
15904 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
15904 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1590515905
1590615906 const s = c_ret_struct_u64_u64_u64_u64();
1590715907 try expect(s.a == 10);
......@@ -15930,7 +15930,7 @@ extern fn c_test_struct_f32() void;
1593015930
1593115931test "struct f32" {
1593215932 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
15933 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
15933 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1593415934 if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest;
1593515935
1593615936 const s = c_ret_struct_f32();
......@@ -16173,7 +16173,7 @@ test "struct {f32, f32}, f32" {
1617316173 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1617416174 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
1617516175 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16176 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16176 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1617716177
1617816178 const s = c_ret_struct_f32f32_f32();
1617916179 try expect(s.a.b == 1.0);
......@@ -16206,7 +16206,7 @@ test "struct f32, {f32, f32}" {
1620616206 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1620716207 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
1620816208 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16209 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16209 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1621016210
1621116211 const s = c_ret_struct_f32_f32f32();
1621216212 try expect(s.a == 1.0);
......@@ -16234,7 +16234,7 @@ extern fn c_test_struct_f64() void;
1623416234
1623516235test "struct f64" {
1623616236 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;
16237 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16237 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1623816238 if (builtin.cpu.arch.isRiscv32()) return error.SkipZigTest;
1623916239 if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest;
1624016240
......@@ -16265,7 +16265,7 @@ extern fn c_test_struct_f64_f64() void;
1626516265test "struct f64, f64" {
1626616266 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;
1626716267 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16268 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16268 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1626916269
1627016270 const s = c_ret_struct_f64_f64();
1627116271 try expect(s.a == 6);
......@@ -16297,7 +16297,7 @@ extern fn c_test_struct_f64_f64_f64() void;
1629716297test "struct f64, f64, f64" {
1629816298 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1629916299 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
16300 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16300 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1630116301
1630216302 const s = c_ret_struct_f64_f64_f64();
1630316303 try expect(s.a == 8);
......@@ -16332,7 +16332,7 @@ extern fn c_test_struct_f64_f64_f64_f64() void;
1633216332test "struct f64, f64, f64, f64" {
1633316333 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1633416334 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
16335 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16335 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1633616336
1633716337 const s = c_ret_struct_f64_f64_f64_f64();
1633816338 try expect(s.a == 10);
......@@ -16370,7 +16370,7 @@ extern fn c_test_struct_f64_f64_f64_f64_f64() void;
1637016370test "struct f64, f64, f64, f64, f64" {
1637116371 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1637216372 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
16373 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16373 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1637416374
1637516375 const s = c_ret_struct_f64_f64_f64_f64_f64();
1637616376 try expect(s.a == 12);
......@@ -16409,7 +16409,7 @@ test "struct{u32,union{u32,struct{u32,u32}}}" {
1640916409 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1641016410 if (builtin.cpu.arch == .loongarch64) return error.SkipZigTest;
1641116411 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16412 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16412 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1641316413
1641416414 const s = c_ret_struct_u32_union_u32_u32u32();
1641516415 try expect(s.a == 1);
......@@ -16427,10 +16427,10 @@ extern fn c_mut_struct_i32_i32(Struct_i32_i32) Struct_i32_i32;
1642716427extern fn c_struct_i32_i32(Struct_i32_i32) void;
1642816428
1642916429test "struct i32 i32" {
16430 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1643016431 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16431 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16432 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1643216433 if (builtin.cpu.arch.isRiscv32()) return error.SkipZigTest;
16433 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1643416434 if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest;
1643516435
1643616436 const s: Struct_i32_i32 = .{
......@@ -16460,10 +16460,10 @@ const BigStruct = extern struct {
1646016460extern fn c_big_struct(BigStruct) void;
1646116461
1646216462test "big struct" {
16463 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16464 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16465 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1646616463 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16464 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16465 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16466 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1646716467
1646816468 const s = BigStruct{
1646916469 .a = 1,
......@@ -16489,9 +16489,9 @@ const BigUnion = extern union {
1648916489extern fn c_big_union(BigUnion) void;
1649016490
1649116491test "big union" {
16492 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16493 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1649416492 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16493 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16494 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1649516495
1649616496 const x = BigUnion{
1649716497 .a = BigStruct{
......@@ -16523,10 +16523,10 @@ extern fn c_med_struct_mixed(MedStructMixed) void;
1652316523extern fn c_ret_med_struct_mixed() MedStructMixed;
1652416524
1652516525test "medium struct of ints and floats" {
16526 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16527 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16528 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1652916526 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16527 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16528 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16529 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1653016530
1653116531 const s = MedStructMixed{
1653216532 .a = 1234,
......@@ -16602,11 +16602,11 @@ const SplitStructInt = extern struct {
1660216602extern fn c_split_struct_ints(SplitStructInt) void;
1660316603
1660416604test "split struct of ints" {
16605 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
16606 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16607 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16608 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1660916605 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16606 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16607 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16608 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16609 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
1661016610
1661116611 const s = SplitStructInt{
1661216612 .a = 1234,
......@@ -16631,11 +16631,11 @@ extern fn c_split_struct_mixed(SplitStructMixed) void;
1663116631extern fn c_ret_split_struct_mixed() SplitStructMixed;
1663216632
1663316633test "split struct of ints and floats" {
16634 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
16635 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16636 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16637 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1663816634 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16635 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16636 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16637 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16638 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
1663916639
1664016640 const s = SplitStructMixed{
1664116641 .a = 1234,
......@@ -16658,10 +16658,10 @@ export fn zig_split_struct_mixed(x: SplitStructMixed) void {
1665816658extern fn c_big_struct_both(BigStruct) BigStruct;
1665916659
1666016660test "sret and byval together" {
16661 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16662 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16663 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1666416661 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16662 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16663 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16664 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1666516665
1666616666 const s = BigStruct{
1666716667 .a = 1,
......@@ -16771,11 +16771,11 @@ extern fn c_struct_with_array(StructWithArray) void;
1677116771extern fn c_ret_struct_with_array() StructWithArray;
1677216772
1677316773test "Struct with array as padding." {
16774 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
16775 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16776 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16777 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1677816774 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16775 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16776 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16777 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16778 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
1677916779
1678016780 c_struct_with_array(.{ .a = 1, .padding = undefined, .b = 2 });
1678116781
......@@ -16799,10 +16799,10 @@ extern fn c_float_array_struct(FloatArrayStruct) void;
1679916799extern fn c_ret_float_array_struct() FloatArrayStruct;
1680016800
1680116801test "Float array like struct" {
16802 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16803 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16804 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1680516802 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16803 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16804 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16805 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1680616806
1680716807 c_float_array_struct(.{
1680816808 .origin = .{
......@@ -16833,33 +16833,37 @@ pub inline fn expectOk(c_err: c_int) !void {
1683316833/// Tests for Double + Char struct
1683416834const DC = extern struct { v1: f64, v2: u8 };
1683516835test "DC: Zig passes to C" {
16836 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16837 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1683616838 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16839 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1683716840 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;
16838 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16839 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16840 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16841
1684116842 try expectOk(c_assert_DC(.{ .v1 = -0.25, .v2 = 15 }));
1684216843}
1684316844test "DC: Zig returns to C" {
16845 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1684416846 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16847 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1684516848 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;
16846 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16847 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16849
1684816850 try expectOk(c_assert_ret_DC());
1684916851}
1685016852test "DC: C passes to Zig" {
16853 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16854 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1685116855 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16856 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1685216857 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;
16853 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16854 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16855 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16858
1685616859 try expectOk(c_send_DC());
1685716860}
1685816861test "DC: C returns to Zig" {
16862 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1685916863 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16864 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1686016865 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;
16861 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16862 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16866
1686316867 try expectEqual(DC{ .v1 = -0.25, .v2 = 15 }, c_ret_DC());
1686416868}
1686516869
......@@ -16884,32 +16888,35 @@ const CFF = extern struct { v1: u8, v2: f32, v3: f32 };
1688416888test "CFF: Zig passes to C" {
1688516889 if (builtin.target.cpu.arch == .x86) return error.SkipZigTest;
1688616890 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16887 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16891 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1688816892 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1688916893 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16894
1689016895 try expectOk(c_assert_CFF(.{ .v1 = 39, .v2 = 0.875, .v3 = 1.0 }));
1689116896}
1689216897test "CFF: Zig returns to C" {
1689316898 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16894 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16899 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1689516900 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16901
1689616902 try expectOk(c_assert_ret_CFF());
1689716903}
1689816904test "CFF: C passes to Zig" {
16899 if (builtin.target.cpu.arch == .x86) return error.SkipZigTest;
16900 if (builtin.cpu.arch.isRISCV() and builtin.mode != .debug) return error.SkipZigTest;
16901 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16902 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16903 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1690416905 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16906 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16907 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16908 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16909 if (builtin.cpu.arch.isRISCV() and builtin.mode != .debug) return error.SkipZigTest;
16910 if (builtin.target.cpu.arch == .x86) return error.SkipZigTest;
1690516911
1690616912 try expectOk(c_send_CFF());
1690716913}
1690816914test "CFF: C returns to Zig" {
16909 if (builtin.cpu.arch.isRISCV() and builtin.mode != .debug) return error.SkipZigTest;
16910 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16911 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1691216915 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16916 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16917 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16918 if (builtin.cpu.arch.isRISCV() and builtin.mode != .debug) return error.SkipZigTest;
16919
1691316920 try expectEqual(CFF{ .v1 = 39, .v2 = 0.875, .v3 = 1.0 }, c_ret_CFF());
1691416921}
1691516922pub extern fn c_assert_CFF(lv: CFF) c_int;
......@@ -16932,31 +16939,35 @@ pub export fn zig_ret_CFF() CFF {
1693216939const PD = extern struct { v1: ?*anyopaque, v2: f64 };
1693316940
1693416941test "PD: Zig passes to C" {
16935 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16936 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16937 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1693816942 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16943 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16944 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16945 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1693916946 if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest;
16947
1694016948 try expectOk(c_assert_PD(.{ .v1 = null, .v2 = 0.5 }));
1694116949}
1694216950test "PD: Zig returns to C" {
16943 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16944 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1694516951 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16952 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16953 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16954
1694616955 try expectOk(c_assert_ret_PD());
1694716956}
1694816957test "PD: C passes to Zig" {
16949 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16950 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
16951 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1695216958 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
16959 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16960 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16961 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1695316962 if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest;
16963
1695416964 try expectOk(c_send_PD());
1695516965}
1695616966test "PD: C returns to Zig" {
16957 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16958 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1695916967 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
16968 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
16969 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
16970
1696016971 try expectEqual(PD{ .v1 = null, .v2 = 0.5 }, c_ret_PD());
1696116972}
1696216973pub extern fn c_assert_PD(lv: PD) c_int;
......@@ -17010,10 +17021,10 @@ const ByVal = extern struct {
1701017021
1701117022extern fn c_func_ptr_byval(*anyopaque, *anyopaque, ByVal, c_ulong, *anyopaque, c_ulong) void;
1701217023test "C function that takes byval struct called via function pointer" {
17024 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
17025 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1701317026 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
1701417027 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
17015 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
17016 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1701717028
1701817029 var fn_ptr = &c_func_ptr_byval;
1701917030 _ = &fn_ptr;
......@@ -17032,17 +17043,16 @@ test "C function that takes byval struct called via function pointer" {
1703217043
1703317044extern fn c_f16(f16) f16;
1703417045test "f16 bare" {
17035 if (builtin.cpu.arch == .x86_64) return error.SkipZigTest;
17036 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
17046 if (builtin.cpu.arch.isArm()) return error.SkipZigTest;
1703717047 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1703817048 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1703917049 if (builtin.cpu.arch.isMIPS()) return error.SkipZigTest;
17050 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1704017051 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;
1704117052 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
1704217053 if (builtin.cpu.arch.isWasm()) return error.SkipZigTest;
17043 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
17044
17045 if (builtin.cpu.arch.isArm()) return error.SkipZigTest;
17054 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
17055 if (builtin.cpu.arch == .x86_64) return error.SkipZigTest;
1704617056
1704717057 const a = c_f16(12);
1704817058 try expect(a == 34);
......@@ -17053,9 +17063,9 @@ const f16_struct = extern struct {
1705317063};
1705417064extern fn c_f16_struct(f16_struct) f16_struct;
1705517065test "f16 struct" {
17066 if (builtin.cpu.arch.isArm() and builtin.mode != .debug) return error.SkipZigTest;
1705617067 if (builtin.target.cpu.arch.isMIPS64()) return error.SkipZigTest;
1705717068 if (builtin.target.cpu.arch.isPowerPC32()) return error.SkipZigTest;
17058 if (builtin.cpu.arch.isArm() and builtin.mode != .debug) return error.SkipZigTest;
1705917069 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
1706017070 if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest;
1706117071
......@@ -17162,10 +17172,10 @@ const Coord2 = extern struct {
1716217172
1716317173extern fn stdcall_coord2(Coord2, Coord2, Coord2) callconv(stdcall_callconv) Coord2;
1716417174test "Stdcall ABI structs" {
17175 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
17176 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1716517177 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
1716617178 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
17167 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
17168 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1716917179 if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest;
1717017180
1717117181 const res = stdcall_coord2(
......@@ -17179,9 +17189,9 @@ test "Stdcall ABI structs" {
1717917189
1718017190extern fn stdcall_big_union(BigUnion) callconv(stdcall_callconv) void;
1718117191test "Stdcall ABI big union" {
17182 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
17183 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1718417192 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
17193 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
17194 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1718517195
1718617196 const x = BigUnion{
1718717197 .a = BigStruct{
......@@ -17253,10 +17263,10 @@ const byval_tail_callsite_attr = struct {
1725317263};
1725417264
1725517265test "byval tail callsite attribute" {
17256 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
17257 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
17258 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1725917266 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
17267 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
17268 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
17269 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1726017270
1726117271 // Originally reported at https://github.com/ziglang/zig/issues/16290
1726217272 // the bug was that the extern function had the byval attribute, but