authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-11-18 01:35:56+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-11-19 01:42:45+01:00
log692c798303bc1ceb031ddb26a0d79a49d3056b66
tree6e37dfcfe08c3d66510faac3d3cf183ccc58413a
parentae0cc8c0659d95a30c6436abfe8c7ca862f570a3
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

test: disable a bunch of failing C ABI tests on s390x


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

test/c_abi/cfuncs.c+15-9
...@@ -77,6 +77,10 @@ static void assert_or_panic(bool ok) {...@@ -77,6 +77,10 @@ static void assert_or_panic(bool ok) {
77# define ZIG_NO_COMPLEX77# define ZIG_NO_COMPLEX
78#endif78#endif
7979
80#ifdef __s390x__
81# define ZIG_NO_COMPLEX
82#endif
83
80#ifdef __x86_64__84#ifdef __x86_64__
81#define ZIG_NO_RAW_F1685#define ZIG_NO_RAW_F16
82#endif86#endif
...@@ -2728,7 +2732,7 @@ void run_c_tests(void) {...@@ -2728,7 +2732,7 @@ void run_c_tests(void) {
2728 }2732 }
2729#endif2733#endif
27302734
2731#if !defined(ZIG_PPC32) && !defined(__hexagon__)2735#if !defined(ZIG_PPC32) && !defined(__hexagon__) && !defined(__s390x__)
2732 {2736 {
2733 struct Struct_u64_u64 s = zig_ret_struct_u64_u64();2737 struct Struct_u64_u64 s = zig_ret_struct_u64_u64();
2734 assert_or_panic(s.a == 1);2738 assert_or_panic(s.a == 1);
...@@ -2807,7 +2811,7 @@ void run_c_tests(void) {...@@ -2807,7 +2811,7 @@ void run_c_tests(void) {
28072811
2808#if !defined __i386__ && !defined __arm__ && !defined __aarch64__ && \2812#if !defined __i386__ && !defined __arm__ && !defined __aarch64__ && \
2809 !defined __powerpc__ && !defined ZIG_RISCV64 && !defined(__loongarch__) && \2813 !defined __powerpc__ && !defined ZIG_RISCV64 && !defined(__loongarch__) && \
2810 !defined(__mips64__) && !defined(__hexagon__)2814 !defined(__mips64__) && !defined(__hexagon__) && !defined(__s390x__)
2811 {2815 {
2812 struct SmallStructInts s = {1, 2, 3, 4};2816 struct SmallStructInts s = {1, 2, 3, 4};
2813 zig_small_struct_ints(s);2817 zig_small_struct_ints(s);
...@@ -2816,7 +2820,7 @@ void run_c_tests(void) {...@@ -2816,7 +2820,7 @@ void run_c_tests(void) {
28162820
2817#if !defined __arm__ && !defined __aarch64__ && \2821#if !defined __arm__ && !defined __aarch64__ && \
2818 !defined __powerpc__ && !defined ZIG_RISCV64 && !defined(__loongarch__) && \2822 !defined __powerpc__ && !defined ZIG_RISCV64 && !defined(__loongarch__) && \
2819 !defined(__mips64__) && !defined(__hexagon__)2823 !defined(__mips64__) && !defined(__hexagon__) && !defined(__s390x__)
2820 {2824 {
2821 struct MedStructInts s = {1, 2, 3};2825 struct MedStructInts s = {1, 2, 3};
2822 zig_med_struct_ints(s);2826 zig_med_struct_ints(s);
...@@ -2843,7 +2847,7 @@ void run_c_tests(void) {...@@ -2843,7 +2847,7 @@ void run_c_tests(void) {
28432847
2844#if !defined __i386__ && !defined __arm__ && \2848#if !defined __i386__ && !defined __arm__ && \
2845 !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && \2849 !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && \
2846 !defined(__mips64__) && !defined(__hexagon__)2850 !defined(__mips64__) && !defined(__hexagon__) && !defined(__s390x__)
2847 {2851 {
2848 struct SplitStructInts s = {1234, 100, 1337};2852 struct SplitStructInts s = {1234, 100, 1337};
2849 zig_split_struct_ints(s);2853 zig_split_struct_ints(s);
...@@ -2851,7 +2855,7 @@ void run_c_tests(void) {...@@ -2851,7 +2855,7 @@ void run_c_tests(void) {
2851#endif2855#endif
28522856
2853#if !defined __arm__ && !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && \2857#if !defined __arm__ && !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && \
2854 !defined(__mips64__) && !defined(__hexagon__)2858 !defined(__mips64__) && !defined(__hexagon__) && !defined(__s390x__)
2855 {2859 {
2856 struct MedStructMixed s = {1234, 100.0f, 1337.0f};2860 struct MedStructMixed s = {1234, 100.0f, 1337.0f};
2857 zig_med_struct_mixed(s);2861 zig_med_struct_mixed(s);
...@@ -2860,14 +2864,15 @@ void run_c_tests(void) {...@@ -2860,14 +2864,15 @@ void run_c_tests(void) {
28602864
2861#if !defined __i386__ && !defined __arm__ && \2865#if !defined __i386__ && !defined __arm__ && \
2862 !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && \2866 !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && \
2863 !defined(__mips64__) && !defined(__hexagon__)2867 !defined(__mips64__) && !defined(__hexagon__) && !defined(__s390x__)
2864 {2868 {
2865 struct SplitStructMixed s = {1234, 100, 1337.0f};2869 struct SplitStructMixed s = {1234, 100, 1337.0f};
2866 zig_split_struct_mixed(s);2870 zig_split_struct_mixed(s);
2867 }2871 }
2868#endif2872#endif
28692873
2870#if !defined(__powerpc__) && !defined(__loongarch__) && !defined(__mips64__) && !defined(__hexagon__)2874#if !defined(__powerpc__) && !defined(__loongarch__) && !defined(__mips64__) && !defined(__hexagon__) && \
2875 !defined(__s390x__)
2871 {2876 {
2872 struct BigStruct s = {30, 31, 32, 33, 34};2877 struct BigStruct s = {30, 31, 32, 33, 34};
2873 struct BigStruct res = zig_big_struct_both(s);2878 struct BigStruct res = zig_big_struct_both(s);
...@@ -2880,7 +2885,7 @@ void run_c_tests(void) {...@@ -2880,7 +2885,7 @@ void run_c_tests(void) {
2880#endif2885#endif
28812886
2882#if !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && !defined(__mips64__) && \2887#if !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && !defined(__mips64__) && \
2883 !defined(__hexagon__)2888 !defined(__hexagon__) && !defined(__s390x__)
2884 {2889 {
2885 struct Rect r1 = {1, 21, 16, 4};2890 struct Rect r1 = {1, 21, 16, 4};
2886 struct Rect r2 = {178, 189, 21, 15};2891 struct Rect r2 = {178, 189, 21, 15};
...@@ -2888,7 +2893,8 @@ void run_c_tests(void) {...@@ -2888,7 +2893,8 @@ void run_c_tests(void) {
2888 }2893 }
2889#endif2894#endif
28902895
2891#if !defined ZIG_PPC32 && !defined(__loongarch__) && !defined(__mips64__) && !defined(__hexagon__)2896#if !defined ZIG_PPC32 && !defined(__loongarch__) && !defined(__mips64__) && !defined(__hexagon__) && \
2897 !defined(__s390x__)
2892 {2898 {
2893 struct FloatRect r1 = {1, 21, 16, 4};2899 struct FloatRect r1 = {1, 21, 16, 4};
2894 struct FloatRect r2 = {178, 189, 21, 15};2900 struct FloatRect r2 = {178, 189, 21, 15};
test/c_abi/main.zig+44-1
...@@ -186,7 +186,8 @@ extern fn c_cmultd(a: ComplexDouble, b: ComplexDouble) ComplexDouble;...@@ -186,7 +186,8 @@ extern fn c_cmultd(a: ComplexDouble, b: ComplexDouble) ComplexDouble;
186186
187const complex_abi_compatible = builtin.cpu.arch != .x86 and !builtin.cpu.arch.isMIPS() and187const complex_abi_compatible = builtin.cpu.arch != .x86 and !builtin.cpu.arch.isMIPS() and
188 !builtin.cpu.arch.isArm() and !builtin.cpu.arch.isPowerPC32() and !builtin.cpu.arch.isRISCV() and188 !builtin.cpu.arch.isArm() and !builtin.cpu.arch.isPowerPC32() and !builtin.cpu.arch.isRISCV() and
189 builtin.cpu.arch != .hexagon;189 builtin.cpu.arch != .hexagon and
190 builtin.cpu.arch != .s390x;
190191
191test "C ABI complex float" {192test "C ABI complex float" {
192 if (!complex_abi_compatible) return error.SkipZigTest;193 if (!complex_abi_compatible) return error.SkipZigTest;
...@@ -330,6 +331,7 @@ test "C ABI struct u64 u64" {...@@ -330,6 +331,7 @@ test "C ABI struct u64 u64" {
330 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;331 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
331 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;332 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
332 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;333 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
334 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
333335
334 const s = c_ret_struct_u64_u64();336 const s = c_ret_struct_u64_u64();
335 try expect(s.a == 21);337 try expect(s.a == 21);
...@@ -364,6 +366,7 @@ extern fn c_struct_f32(Struct_f32) void;...@@ -364,6 +366,7 @@ extern fn c_struct_f32(Struct_f32) void;
364test "C ABI struct f32" {366test "C ABI struct f32" {
365 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;367 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
366 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;368 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
369 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
367370
368 const s = c_ret_struct_f32();371 const s = c_ret_struct_f32();
369 try expect(s.a == 2.5);372 try expect(s.a == 2.5);
...@@ -391,6 +394,7 @@ test "C ABI struct f64" {...@@ -391,6 +394,7 @@ test "C ABI struct f64" {
391 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;394 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
392 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;395 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;
393 if (builtin.cpu.arch == .riscv32) return error.SkipZigTest;396 if (builtin.cpu.arch == .riscv32) return error.SkipZigTest;
397 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
394398
395 const s = c_ret_struct_f64();399 const s = c_ret_struct_f64();
396 try expect(s.a == 2.5);400 try expect(s.a == 2.5);
...@@ -422,6 +426,7 @@ test "C ABI struct {f32,f32} f32" {...@@ -422,6 +426,7 @@ test "C ABI struct {f32,f32} f32" {
422 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;426 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;
423 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;427 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
424 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;428 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
429 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
425430
426 const s = c_ret_struct_f32f32_f32();431 const s = c_ret_struct_f32f32_f32();
427 try expect(s.a.b == 1.0);432 try expect(s.a.b == 1.0);
...@@ -455,6 +460,7 @@ test "C ABI struct f32 {f32,f32}" {...@@ -455,6 +460,7 @@ test "C ABI struct f32 {f32,f32}" {
455 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;460 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;
456 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;461 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
457 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;462 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
463 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
458464
459 const s = c_ret_struct_f32_f32f32();465 const s = c_ret_struct_f32_f32f32();
460 try expect(s.a == 1.0);466 try expect(s.a == 1.0);
...@@ -492,6 +498,7 @@ test "C ABI struct{u32,union{u32,struct{u32,u32}}}" {...@@ -492,6 +498,7 @@ test "C ABI struct{u32,union{u32,struct{u32,u32}}}" {
492 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;498 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
493 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;499 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
494 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;500 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
501 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
495502
496 const s = c_ret_struct_u32_union_u32_u32u32();503 const s = c_ret_struct_u32_union_u32_u32u32();
497 try expect(s.a == 1);504 try expect(s.a == 1);
...@@ -512,6 +519,7 @@ test "C ABI struct i32 i32" {...@@ -512,6 +519,7 @@ test "C ABI struct i32 i32" {
512 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;519 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
513 if (builtin.cpu.arch == .riscv32) return error.SkipZigTest;520 if (builtin.cpu.arch == .riscv32) return error.SkipZigTest;
514 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;521 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
522 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
515523
516 const s: Struct_i32_i32 = .{524 const s: Struct_i32_i32 = .{
517 .a = 1,525 .a = 1,
...@@ -544,6 +552,7 @@ test "C ABI big struct" {...@@ -544,6 +552,7 @@ test "C ABI big struct" {
544 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;552 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
545 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;553 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
546 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;554 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
555 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
547556
548 const s = BigStruct{557 const s = BigStruct{
549 .a = 1,558 .a = 1,
...@@ -572,6 +581,7 @@ test "C ABI big union" {...@@ -572,6 +581,7 @@ test "C ABI big union" {
572 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;581 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
573 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;582 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
574 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;583 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
584 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
575585
576 const x = BigUnion{586 const x = BigUnion{
577 .a = BigStruct{587 .a = BigStruct{
...@@ -607,6 +617,7 @@ test "C ABI medium struct of ints and floats" {...@@ -607,6 +617,7 @@ test "C ABI medium struct of ints and floats" {
607 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;617 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
608 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;618 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
609 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;619 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
620 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
610621
611 const s = MedStructMixed{622 const s = MedStructMixed{
612 .a = 1234,623 .a = 1234,
...@@ -642,6 +653,7 @@ test "C ABI small struct of ints" {...@@ -642,6 +653,7 @@ test "C ABI small struct of ints" {
642 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest;653 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest;
643 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;654 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
644 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;655 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
656 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
645657
646 const s = SmallStructInts{658 const s = SmallStructInts{
647 .a = 1,659 .a = 1,
...@@ -677,6 +689,7 @@ test "C ABI medium struct of ints" {...@@ -677,6 +689,7 @@ test "C ABI medium struct of ints" {
677 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;689 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
678 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;690 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
679 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;691 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
692 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
680693
681 const s = MedStructInts{694 const s = MedStructInts{
682 .x = 1,695 .x = 1,
...@@ -757,6 +770,7 @@ test "C ABI split struct of ints" {...@@ -757,6 +770,7 @@ test "C ABI split struct of ints" {
757 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;770 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
758 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;771 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
759 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;772 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
773 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
760774
761 const s = SplitStructInt{775 const s = SplitStructInt{
762 .a = 1234,776 .a = 1234,
...@@ -786,6 +800,7 @@ test "C ABI split struct of ints and floats" {...@@ -786,6 +800,7 @@ test "C ABI split struct of ints and floats" {
786 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;800 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
787 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;801 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
788 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;802 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
803 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
789804
790 const s = SplitStructMixed{805 const s = SplitStructMixed{
791 .a = 1234,806 .a = 1234,
...@@ -815,6 +830,7 @@ test "C ABI sret and byval together" {...@@ -815,6 +830,7 @@ test "C ABI sret and byval together" {
815 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;830 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
816 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;831 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
817 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;832 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
833 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
818834
819 const s = BigStruct{835 const s = BigStruct{
820 .a = 1,836 .a = 1,
...@@ -869,6 +885,7 @@ test "C ABI structs of floats as parameter" {...@@ -869,6 +885,7 @@ test "C ABI structs of floats as parameter" {
869 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;885 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
870 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;886 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
871 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;887 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
888 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
872889
873 const v3 = Vector3{890 const v3 = Vector3{
874 .x = 3.0,891 .x = 3.0,
...@@ -911,6 +928,7 @@ test "C ABI structs of ints as multiple parameters" {...@@ -911,6 +928,7 @@ test "C ABI structs of ints as multiple parameters" {
911 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;928 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
912 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;929 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
913 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;930 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
931 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
914932
915 const r1 = Rect{933 const r1 = Rect{
916 .left = 1,934 .left = 1,
...@@ -950,6 +968,7 @@ test "C ABI structs of floats as multiple parameters" {...@@ -950,6 +968,7 @@ test "C ABI structs of floats as multiple parameters" {
950 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;968 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
951 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;969 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
952 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;970 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
971 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
953972
954 const r1 = FloatRect{973 const r1 = FloatRect{
955 .left = 1,974 .left = 1,
...@@ -1065,6 +1084,7 @@ test "Struct with array as padding." {...@@ -1065,6 +1084,7 @@ test "Struct with array as padding." {
1065 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;1084 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1066 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;1085 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1067 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;1086 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1087 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
10681088
1069 c_struct_with_array(.{ .a = 1, .padding = undefined, .b = 2 });1089 c_struct_with_array(.{ .a = 1, .padding = undefined, .b = 2 });
10701090
...@@ -1092,6 +1112,7 @@ test "Float array like struct" {...@@ -1092,6 +1112,7 @@ test "Float array like struct" {
1092 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;1112 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1093 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;1113 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1094 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;1114 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
1115 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
10951116
1096 c_float_array_struct(.{1117 c_float_array_struct(.{
1097 .origin = .{1118 .origin = .{
...@@ -1120,6 +1141,7 @@ test "small simd vector" {...@@ -1120,6 +1141,7 @@ test "small simd vector" {
1120 if (builtin.cpu.arch == .x86) return error.SkipZigTest;1141 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
1121 if (builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest;1142 if (builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest;
1122 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;1143 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1144 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
11231145
1124 c_small_vec(.{ 1, 2 });1146 c_small_vec(.{ 1, 2 });
11251147
...@@ -1137,6 +1159,7 @@ test "medium simd vector" {...@@ -1137,6 +1159,7 @@ test "medium simd vector" {
1137 if (builtin.zig_backend == .stage2_x86_64 and !comptime builtin.cpu.has(.x86, .avx)) return error.SkipZigTest;1159 if (builtin.zig_backend == .stage2_x86_64 and !comptime builtin.cpu.has(.x86, .avx)) return error.SkipZigTest;
1138 if (builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest;1160 if (builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest;
1139 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;1161 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1162 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
11401163
1141 c_medium_vec(.{ 1, 2, 3, 4 });1164 c_medium_vec(.{ 1, 2, 3, 4 });
11421165
...@@ -1185,6 +1208,7 @@ extern fn c_ret_vector_4_float() Vector4Float;...@@ -1185,6 +1208,7 @@ extern fn c_ret_vector_4_float() Vector4Float;
1185test "float simd vectors" {1208test "float simd vectors" {
1186 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;1209 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1187 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;1210 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1211 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
11881212
1189 {1213 {
1190 c_vector_2_float(.{ 1.0, 2.0 });1214 c_vector_2_float(.{ 1.0, 2.0 });
...@@ -5470,6 +5494,7 @@ test "C ABI pointer sized float struct" {...@@ -5470,6 +5494,7 @@ test "C ABI pointer sized float struct" {
5470 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;5494 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;
5471 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;5495 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
5472 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;5496 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;
5497 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
54735498
5474 c_ptr_size_float_struct(.{ .x = 1, .y = 2 });5499 c_ptr_size_float_struct(.{ .x = 1, .y = 2 });
54755500
...@@ -5494,6 +5519,7 @@ test "DC: Zig passes to C" {...@@ -5494,6 +5519,7 @@ test "DC: Zig passes to C" {
5494 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5519 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5495 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5520 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5496 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;5521 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5522 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
5497 try expectOk(c_assert_DC(.{ .v1 = -0.25, .v2 = 15 }));5523 try expectOk(c_assert_DC(.{ .v1 = -0.25, .v2 = 15 }));
5498}5524}
5499test "DC: Zig returns to C" {5525test "DC: Zig returns to C" {
...@@ -5501,6 +5527,7 @@ test "DC: Zig returns to C" {...@@ -5501,6 +5527,7 @@ test "DC: Zig returns to C" {
5501 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;5527 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;
5502 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5528 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5503 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5529 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5530 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
5504 try expectOk(c_assert_ret_DC());5531 try expectOk(c_assert_ret_DC());
5505}5532}
5506test "DC: C passes to Zig" {5533test "DC: C passes to Zig" {
...@@ -5509,6 +5536,7 @@ test "DC: C passes to Zig" {...@@ -5509,6 +5536,7 @@ test "DC: C passes to Zig" {
5509 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5536 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5510 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5537 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5511 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;5538 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5539 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
5512 try expectOk(c_send_DC());5540 try expectOk(c_send_DC());
5513}5541}
5514test "DC: C returns to Zig" {5542test "DC: C returns to Zig" {
...@@ -5516,6 +5544,7 @@ test "DC: C returns to Zig" {...@@ -5516,6 +5544,7 @@ test "DC: C returns to Zig" {
5516 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;5544 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;
5517 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5545 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5518 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5546 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5547 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
5519 try expectEqual(DC{ .v1 = -0.25, .v2 = 15 }, c_ret_DC());5548 try expectEqual(DC{ .v1 = -0.25, .v2 = 15 }, c_ret_DC());
5520}5549}
55215550
...@@ -5543,12 +5572,14 @@ test "CFF: Zig passes to C" {...@@ -5543,12 +5572,14 @@ test "CFF: Zig passes to C" {
5543 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5572 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5544 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5573 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5545 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;5574 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5575 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
5546 try expectOk(c_assert_CFF(.{ .v1 = 39, .v2 = 0.875, .v3 = 1.0 }));5576 try expectOk(c_assert_CFF(.{ .v1 = 39, .v2 = 0.875, .v3 = 1.0 }));
5547}5577}
5548test "CFF: Zig returns to C" {5578test "CFF: Zig returns to C" {
5549 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;5579 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
5550 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5580 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5551 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5581 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5582 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
5552 try expectOk(c_assert_ret_CFF());5583 try expectOk(c_assert_ret_CFF());
5553}5584}
5554test "CFF: C passes to Zig" {5585test "CFF: C passes to Zig" {
...@@ -5559,6 +5590,7 @@ test "CFF: C passes to Zig" {...@@ -5559,6 +5590,7 @@ test "CFF: C passes to Zig" {
5559 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5590 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5560 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5591 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5561 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;5592 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5593 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
55625594
5563 try expectOk(c_send_CFF());5595 try expectOk(c_send_CFF());
5564}5596}
...@@ -5568,6 +5600,7 @@ test "CFF: C returns to Zig" {...@@ -5568,6 +5600,7 @@ test "CFF: C returns to Zig" {
5568 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;5600 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
5569 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5601 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5570 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5602 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5603 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
5571 try expectEqual(CFF{ .v1 = 39, .v2 = 0.875, .v3 = 1.0 }, c_ret_CFF());5604 try expectEqual(CFF{ .v1 = 39, .v2 = 0.875, .v3 = 1.0 }, c_ret_CFF());
5572}5605}
5573pub extern fn c_assert_CFF(lv: CFF) c_int;5606pub extern fn c_assert_CFF(lv: CFF) c_int;
...@@ -5594,12 +5627,14 @@ test "PD: Zig passes to C" {...@@ -5594,12 +5627,14 @@ test "PD: Zig passes to C" {
5594 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5627 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5595 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5628 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5596 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;5629 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5630 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
5597 try expectOk(c_assert_PD(.{ .v1 = null, .v2 = 0.5 }));5631 try expectOk(c_assert_PD(.{ .v1 = null, .v2 = 0.5 }));
5598}5632}
5599test "PD: Zig returns to C" {5633test "PD: Zig returns to C" {
5600 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;5634 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
5601 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5635 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5602 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5636 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5637 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
5603 try expectOk(c_assert_ret_PD());5638 try expectOk(c_assert_ret_PD());
5604}5639}
5605test "PD: C passes to Zig" {5640test "PD: C passes to Zig" {
...@@ -5607,12 +5642,14 @@ test "PD: C passes to Zig" {...@@ -5607,12 +5642,14 @@ test "PD: C passes to Zig" {
5607 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5642 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5608 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5643 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5609 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;5644 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5645 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
5610 try expectOk(c_send_PD());5646 try expectOk(c_send_PD());
5611}5647}
5612test "PD: C returns to Zig" {5648test "PD: C returns to Zig" {
5613 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;5649 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
5614 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5650 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5615 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5651 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5652 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
5616 try expectEqual(PD{ .v1 = null, .v2 = 0.5 }, c_ret_PD());5653 try expectEqual(PD{ .v1 = null, .v2 = 0.5 }, c_ret_PD());
5617}5654}
5618pub extern fn c_assert_PD(lv: PD) c_int;5655pub extern fn c_assert_PD(lv: PD) c_int;
...@@ -5646,6 +5683,7 @@ extern fn c_modify_by_ref_param(ByRef) ByRef;...@@ -5646,6 +5683,7 @@ extern fn c_modify_by_ref_param(ByRef) ByRef;
5646test "C function modifies by ref param" {5683test "C function modifies by ref param" {
5647 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;5684 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
5648 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5685 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5686 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
56495687
5650 const res = c_modify_by_ref_param(.{ .val = 1, .arr = undefined });5688 const res = c_modify_by_ref_param(.{ .val = 1, .arr = undefined });
5651 try expect(res.val == 42);5689 try expect(res.val == 42);
...@@ -5670,6 +5708,7 @@ test "C function that takes byval struct called via function pointer" {...@@ -5670,6 +5708,7 @@ test "C function that takes byval struct called via function pointer" {
5670 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;5708 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
5671 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5709 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5672 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;5710 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5711 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
56735712
5674 var fn_ptr = &c_func_ptr_byval;5713 var fn_ptr = &c_func_ptr_byval;
5675 _ = &fn_ptr;5714 _ = &fn_ptr;
...@@ -5702,6 +5741,7 @@ test "f16 struct" {...@@ -5702,6 +5741,7 @@ test "f16 struct" {
5702 if (builtin.target.cpu.arch.isMIPS64()) return error.SkipZigTest;5741 if (builtin.target.cpu.arch.isMIPS64()) return error.SkipZigTest;
5703 if (builtin.target.cpu.arch.isPowerPC32()) return error.SkipZigTest;5742 if (builtin.target.cpu.arch.isPowerPC32()) return error.SkipZigTest;
5704 if (builtin.cpu.arch.isArm() and builtin.mode != .Debug) return error.SkipZigTest;5743 if (builtin.cpu.arch.isArm() and builtin.mode != .Debug) return error.SkipZigTest;
5744 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
57055745
5706 const a = c_f16_struct(.{ .a = 12 });5746 const a = c_f16_struct(.{ .a = 12 });
5707 try expect(a.a == 34);5747 try expect(a.a == 34);
...@@ -5811,6 +5851,7 @@ test "Stdcall ABI structs" {...@@ -5811,6 +5851,7 @@ test "Stdcall ABI structs" {
5811 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest;5851 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest;
5812 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5852 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5813 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;5853 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5854 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
58145855
5815 const res = stdcall_coord2(5856 const res = stdcall_coord2(
5816 .{ .x = 0x1111, .y = 0x2222 },5857 .{ .x = 0x1111, .y = 0x2222 },
...@@ -5826,6 +5867,7 @@ test "Stdcall ABI big union" {...@@ -5826,6 +5867,7 @@ test "Stdcall ABI big union" {
5826 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;5867 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
5827 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5868 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5828 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;5869 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5870 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
58295871
5830 const x = BigUnion{5872 const x = BigUnion{
5831 .a = BigStruct{5873 .a = BigStruct{
...@@ -5900,6 +5942,7 @@ test "byval tail callsite attribute" {...@@ -5900,6 +5942,7 @@ test "byval tail callsite attribute" {
5900 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;5942 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
5901 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5943 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5902 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;5944 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5945 if (builtin.cpu.arch == .s390x) return error.SkipZigTest;
59035946
5904 // Originally reported at https://github.com/ziglang/zig/issues/162905947 // Originally reported at https://github.com/ziglang/zig/issues/16290
5905 // the bug was that the extern function had the byval attribute, but5948 // the bug was that the extern function had the byval attribute, but