| ... | ... | @@ -291,6 +291,7 @@ test "C ABI struct u8" { |
| 291 | 291 | if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; |
| 292 | 292 | if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest; |
| 293 | 293 | if (builtin.cpu.arch == .s390x) return error.SkipZigTest; |
| 294 | if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest; |
| 294 | 295 | |
| 295 | 296 | const s = c_ret_struct_u8(); |
| 296 | 297 | try expect(s.a == 4); |
| ... | ... | @@ -318,6 +319,7 @@ test "C ABI struct u16" { |
| 318 | 319 | if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; |
| 319 | 320 | if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest; |
| 320 | 321 | if (builtin.cpu.arch == .s390x) return error.SkipZigTest; |
| 322 | if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest; |
| 321 | 323 | |
| 322 | 324 | const s = c_ret_struct_u16(); |
| 323 | 325 | try expect(s.a == 10); |
| ... | ... | @@ -345,6 +347,7 @@ test "C ABI struct u32" { |
| 345 | 347 | if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; |
| 346 | 348 | if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest; |
| 347 | 349 | if (builtin.cpu.arch == .s390x) return error.SkipZigTest; |
| 350 | if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest; |
| 348 | 351 | |
| 349 | 352 | const s = c_ret_struct_u32(); |
| 350 | 353 | try expect(s.a == 16); |
| ... | ... | @@ -372,6 +375,7 @@ test "C ABI struct u64" { |
| 372 | 375 | if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest; |
| 373 | 376 | if (builtin.cpu.arch == .riscv32) return error.SkipZigTest; |
| 374 | 377 | if (builtin.cpu.arch == .s390x) return error.SkipZigTest; |
| 378 | if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest; |
| 375 | 379 | |
| 376 | 380 | const s = c_ret_struct_u64(); |
| 377 | 381 | try expect(s.a == 22); |
| ... | ... | @@ -485,6 +489,7 @@ test "C ABI struct f32" { |
| 485 | 489 | if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; |
| 486 | 490 | if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest; |
| 487 | 491 | if (builtin.cpu.arch == .s390x) return error.SkipZigTest; |
| 492 | if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest; |
| 488 | 493 | |
| 489 | 494 | const s = c_ret_struct_f32(); |
| 490 | 495 | try expect(s.a == 2.5); |
| ... | ... | @@ -513,6 +518,7 @@ test "C ABI struct f64" { |
| 513 | 518 | if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest; |
| 514 | 519 | if (builtin.cpu.arch == .riscv32) return error.SkipZigTest; |
| 515 | 520 | if (builtin.cpu.arch == .s390x) return error.SkipZigTest; |
| 521 | if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest; |
| 516 | 522 | |
| 517 | 523 | const s = c_ret_struct_f64(); |
| 518 | 524 | try expect(s.a == 2.5); |
| ... | ... | @@ -705,6 +711,7 @@ test "C ABI struct i32 i32" { |
| 705 | 711 | if (builtin.cpu.arch == .riscv32) return error.SkipZigTest; |
| 706 | 712 | if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest; |
| 707 | 713 | if (builtin.cpu.arch == .s390x) return error.SkipZigTest; |
| 714 | if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest; |
| 708 | 715 | |
| 709 | 716 | const s: Struct_i32_i32 = .{ |
| 710 | 717 | .a = 1, |
| ... | ... | @@ -5681,6 +5688,7 @@ test "C ABI pointer sized float struct" { |
| 5681 | 5688 | if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest; |
| 5682 | 5689 | if (builtin.cpu.arch.isLoongArch() and builtin.abi.float() == .soft) return error.SkipZigTest; |
| 5683 | 5690 | if (builtin.cpu.arch == .s390x) return error.SkipZigTest; |
| 5691 | if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest; |
| 5684 | 5692 | |
| 5685 | 5693 | c_ptr_size_float_struct(.{ .x = 1, .y = 2 }); |
| 5686 | 5694 | |
| ... | ... | @@ -5812,6 +5820,7 @@ test "PD: Zig passes to C" { |
| 5812 | 5820 | if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest; |
| 5813 | 5821 | if (builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| 5814 | 5822 | if (builtin.cpu.arch == .s390x) return error.SkipZigTest; |
| 5823 | if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest; |
| 5815 | 5824 | try expectOk(c_assert_PD(.{ .v1 = null, .v2 = 0.5 })); |
| 5816 | 5825 | } |
| 5817 | 5826 | test "PD: Zig returns to C" { |
| ... | ... | @@ -5827,6 +5836,7 @@ test "PD: C passes to Zig" { |
| 5827 | 5836 | if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest; |
| 5828 | 5837 | if (builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| 5829 | 5838 | if (builtin.cpu.arch == .s390x) return error.SkipZigTest; |
| 5839 | if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest; |
| 5830 | 5840 | try expectOk(c_send_PD()); |
| 5831 | 5841 | } |
| 5832 | 5842 | test "PD: C returns to Zig" { |
| ... | ... | @@ -5936,6 +5946,7 @@ test "f16 struct" { |
| 5936 | 5946 | if (builtin.target.cpu.arch.isPowerPC32()) return error.SkipZigTest; |
| 5937 | 5947 | if (builtin.cpu.arch.isArm() and builtin.mode != .Debug) return error.SkipZigTest; |
| 5938 | 5948 | if (builtin.cpu.arch == .s390x) return error.SkipZigTest; |
| 5949 | if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest; |
| 5939 | 5950 | |
| 5940 | 5951 | const a = c_f16_struct(.{ .a = 12 }); |
| 5941 | 5952 | try expect(a.a == 34); |
| ... | ... | @@ -6045,6 +6056,7 @@ test "Stdcall ABI structs" { |
| 6045 | 6056 | if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest; |
| 6046 | 6057 | if (builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| 6047 | 6058 | if (builtin.cpu.arch == .s390x) return error.SkipZigTest; |
| 6059 | if (builtin.cpu.arch == .x86 and builtin.os.tag == .windows) return error.SkipZigTest; |
| 6048 | 6060 | |
| 6049 | 6061 | const res = stdcall_coord2( |
| 6050 | 6062 | .{ .x = 0x1111, .y = 0x2222 }, |