authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-08-04 20:49:14+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-08-30 06:36:41+02:00
logf1491129516af8eb780127c292ab9a1975a7d189
tree4f27e48385dd0298e0760970cbe46c6f497a26d4
parentf6879c35af446c3ca3ef61f4b5b7d03d0e064769
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

test: expand C ABI test coverage to hexagon-linux-musl


3 files changed, 52 insertions(+), 19 deletions(-)

test/c_abi/cfuncs.c+14-9
...@@ -65,6 +65,10 @@ static void assert_or_panic(bool ok) {...@@ -65,6 +65,10 @@ static void assert_or_panic(bool ok) {
65# define ZIG_NO_COMPLEX65# define ZIG_NO_COMPLEX
66#endif66#endif
6767
68#ifdef __hexagon__
69# define ZIG_NO_COMPLEX
70#endif
71
68#ifdef __powerpc__72#ifdef __powerpc__
69# define ZIG_NO_COMPLEX73# define ZIG_NO_COMPLEX
70#endif74#endif
...@@ -2724,7 +2728,7 @@ void run_c_tests(void) {...@@ -2724,7 +2728,7 @@ void run_c_tests(void) {
2724 }2728 }
2725#endif2729#endif
27262730
2727#if !defined(ZIG_PPC32)2731#if !defined(ZIG_PPC32) && !defined(__hexagon__)
2728 {2732 {
2729 struct Struct_u64_u64 s = zig_ret_struct_u64_u64();2733 struct Struct_u64_u64 s = zig_ret_struct_u64_u64();
2730 assert_or_panic(s.a == 1);2734 assert_or_panic(s.a == 1);
...@@ -2803,7 +2807,7 @@ void run_c_tests(void) {...@@ -2803,7 +2807,7 @@ void run_c_tests(void) {
28032807
2804#if !defined __i386__ && !defined __arm__ && !defined __aarch64__ && \2808#if !defined __i386__ && !defined __arm__ && !defined __aarch64__ && \
2805 !defined __powerpc__ && !defined ZIG_RISCV64 && !defined(__loongarch__) && \2809 !defined __powerpc__ && !defined ZIG_RISCV64 && !defined(__loongarch__) && \
2806 !defined(__mips64__)2810 !defined(__mips64__) && !defined(__hexagon__)
2807 {2811 {
2808 struct SmallStructInts s = {1, 2, 3, 4};2812 struct SmallStructInts s = {1, 2, 3, 4};
2809 zig_small_struct_ints(s);2813 zig_small_struct_ints(s);
...@@ -2812,7 +2816,7 @@ void run_c_tests(void) {...@@ -2812,7 +2816,7 @@ void run_c_tests(void) {
28122816
2813#if !defined __arm__ && !defined __aarch64__ && \2817#if !defined __arm__ && !defined __aarch64__ && \
2814 !defined __powerpc__ && !defined ZIG_RISCV64 && !defined(__loongarch__) && \2818 !defined __powerpc__ && !defined ZIG_RISCV64 && !defined(__loongarch__) && \
2815 !defined(__mips64__)2819 !defined(__mips64__) && !defined(__hexagon__)
2816 {2820 {
2817 struct MedStructInts s = {1, 2, 3};2821 struct MedStructInts s = {1, 2, 3};
2818 zig_med_struct_ints(s);2822 zig_med_struct_ints(s);
...@@ -2839,7 +2843,7 @@ void run_c_tests(void) {...@@ -2839,7 +2843,7 @@ void run_c_tests(void) {
28392843
2840#if !defined __i386__ && !defined __arm__ && \2844#if !defined __i386__ && !defined __arm__ && \
2841 !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && \2845 !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && \
2842 !defined(__mips64__)2846 !defined(__mips64__) && !defined(__hexagon__)
2843 {2847 {
2844 struct SplitStructInts s = {1234, 100, 1337};2848 struct SplitStructInts s = {1234, 100, 1337};
2845 zig_split_struct_ints(s);2849 zig_split_struct_ints(s);
...@@ -2847,7 +2851,7 @@ void run_c_tests(void) {...@@ -2847,7 +2851,7 @@ void run_c_tests(void) {
2847#endif2851#endif
28482852
2849#if !defined __arm__ && !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && \2853#if !defined __arm__ && !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && \
2850 !defined(__mips64__)2854 !defined(__mips64__) && !defined(__hexagon__)
2851 {2855 {
2852 struct MedStructMixed s = {1234, 100.0f, 1337.0f};2856 struct MedStructMixed s = {1234, 100.0f, 1337.0f};
2853 zig_med_struct_mixed(s);2857 zig_med_struct_mixed(s);
...@@ -2856,14 +2860,14 @@ void run_c_tests(void) {...@@ -2856,14 +2860,14 @@ void run_c_tests(void) {
28562860
2857#if !defined __i386__ && !defined __arm__ && \2861#if !defined __i386__ && !defined __arm__ && \
2858 !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && \2862 !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && \
2859 !defined(__mips64__)2863 !defined(__mips64__) && !defined(__hexagon__)
2860 {2864 {
2861 struct SplitStructMixed s = {1234, 100, 1337.0f};2865 struct SplitStructMixed s = {1234, 100, 1337.0f};
2862 zig_split_struct_mixed(s);2866 zig_split_struct_mixed(s);
2863 }2867 }
2864#endif2868#endif
28652869
2866#if !defined(__powerpc__) && !defined(__loongarch__) && !defined(__mips64__)2870#if !defined(__powerpc__) && !defined(__loongarch__) && !defined(__mips64__) && !defined(__hexagon__)
2867 {2871 {
2868 struct BigStruct s = {30, 31, 32, 33, 34};2872 struct BigStruct s = {30, 31, 32, 33, 34};
2869 struct BigStruct res = zig_big_struct_both(s);2873 struct BigStruct res = zig_big_struct_both(s);
...@@ -2875,7 +2879,8 @@ void run_c_tests(void) {...@@ -2875,7 +2879,8 @@ void run_c_tests(void) {
2875 }2879 }
2876#endif2880#endif
28772881
2878#if !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && !defined(__mips64__)2882#if !defined ZIG_PPC32 && !defined _ARCH_PPC64 && !defined(__loongarch__) && !defined(__mips64__) && \
2883 !defined(__hexagon__)
2879 {2884 {
2880 struct Rect r1 = {1, 21, 16, 4};2885 struct Rect r1 = {1, 21, 16, 4};
2881 struct Rect r2 = {178, 189, 21, 15};2886 struct Rect r2 = {178, 189, 21, 15};
...@@ -2883,7 +2888,7 @@ void run_c_tests(void) {...@@ -2883,7 +2888,7 @@ void run_c_tests(void) {
2883 }2888 }
2884#endif2889#endif
28852890
2886#if !defined ZIG_PPC32 && !defined(__loongarch__) && !defined(__mips64__)2891#if !defined ZIG_PPC32 && !defined(__loongarch__) && !defined(__mips64__) && !defined(__hexagon__)
2887 {2892 {
2888 struct FloatRect r1 = {1, 21, 16, 4};2893 struct FloatRect r1 = {1, 21, 16, 4};
2889 struct FloatRect r2 = {178, 189, 21, 15};2894 struct FloatRect r2 = {178, 189, 21, 15};
test/c_abi/main.zig+31-2
...@@ -11,7 +11,8 @@ const print = std.debug.print;...@@ -11,7 +11,8 @@ const print = std.debug.print;
11const expect = std.testing.expect;11const expect = std.testing.expect;
12const expectEqual = std.testing.expectEqual;12const expectEqual = std.testing.expectEqual;
13const have_i128 = builtin.cpu.arch != .x86 and !builtin.cpu.arch.isArm() and13const have_i128 = builtin.cpu.arch != .x86 and !builtin.cpu.arch.isArm() and
14 !builtin.cpu.arch.isMIPS() and !builtin.cpu.arch.isPowerPC32() and builtin.cpu.arch != .riscv32;14 !builtin.cpu.arch.isMIPS() and !builtin.cpu.arch.isPowerPC32() and builtin.cpu.arch != .riscv32 and
15 builtin.cpu.arch != .hexagon;
1516
16const have_f128 = builtin.cpu.arch.isWasm() or (builtin.cpu.arch.isX86() and !builtin.os.tag.isDarwin());17const have_f128 = builtin.cpu.arch.isWasm() or (builtin.cpu.arch.isX86() and !builtin.os.tag.isDarwin());
17const have_f80 = builtin.cpu.arch.isX86();18const have_f80 = builtin.cpu.arch.isX86();
...@@ -183,7 +184,8 @@ extern fn c_cmultf(a: ComplexFloat, b: ComplexFloat) ComplexFloat;...@@ -183,7 +184,8 @@ extern fn c_cmultf(a: ComplexFloat, b: ComplexFloat) ComplexFloat;
183extern fn c_cmultd(a: ComplexDouble, b: ComplexDouble) ComplexDouble;184extern fn c_cmultd(a: ComplexDouble, b: ComplexDouble) ComplexDouble;
184185
185const complex_abi_compatible = builtin.cpu.arch != .x86 and !builtin.cpu.arch.isMIPS() and186const complex_abi_compatible = builtin.cpu.arch != .x86 and !builtin.cpu.arch.isMIPS() and
186 !builtin.cpu.arch.isArm() and !builtin.cpu.arch.isPowerPC32() and !builtin.cpu.arch.isRISCV();187 !builtin.cpu.arch.isArm() and !builtin.cpu.arch.isPowerPC32() and !builtin.cpu.arch.isRISCV() and
188 builtin.cpu.arch != .hexagon;
187189
188test "C ABI complex float" {190test "C ABI complex float" {
189 if (!complex_abi_compatible) return error.SkipZigTest;191 if (!complex_abi_compatible) return error.SkipZigTest;
...@@ -326,6 +328,7 @@ extern fn c_struct_u64_u64_8(usize, usize, usize, usize, usize, usize, usize, us...@@ -326,6 +328,7 @@ extern fn c_struct_u64_u64_8(usize, usize, usize, usize, usize, usize, usize, us
326test "C ABI struct u64 u64" {328test "C ABI struct u64 u64" {
327 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;329 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
328 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;330 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
331 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
329332
330 const s = c_ret_struct_u64_u64();333 const s = c_ret_struct_u64_u64();
331 try expect(s.a == 21);334 try expect(s.a == 21);
...@@ -417,6 +420,7 @@ test "C ABI struct {f32,f32} f32" {...@@ -417,6 +420,7 @@ test "C ABI struct {f32,f32} f32" {
417 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;420 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
418 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;421 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;
419 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;422 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
423 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
420424
421 const s = c_ret_struct_f32f32_f32();425 const s = c_ret_struct_f32f32_f32();
422 try expect(s.a.b == 1.0);426 try expect(s.a.b == 1.0);
...@@ -449,6 +453,7 @@ test "C ABI struct f32 {f32,f32}" {...@@ -449,6 +453,7 @@ test "C ABI struct f32 {f32,f32}" {
449 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;453 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
450 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;454 if (builtin.cpu.arch.isArm() and builtin.abi.float() == .soft) return error.SkipZigTest;
451 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;455 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
456 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
452457
453 const s = c_ret_struct_f32_f32f32();458 const s = c_ret_struct_f32_f32f32();
454 try expect(s.a == 1.0);459 try expect(s.a == 1.0);
...@@ -485,6 +490,7 @@ test "C ABI struct{u32,union{u32,struct{u32,u32}}}" {...@@ -485,6 +490,7 @@ test "C ABI struct{u32,union{u32,struct{u32,u32}}}" {
485 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;490 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
486 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;491 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
487 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;492 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
493 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
488494
489 const s = c_ret_struct_u32_union_u32_u32u32();495 const s = c_ret_struct_u32_union_u32_u32u32();
490 try expect(s.a == 1);496 try expect(s.a == 1);
...@@ -536,6 +542,7 @@ test "C ABI big struct" {...@@ -536,6 +542,7 @@ test "C ABI big struct" {
536 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;542 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
537 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;543 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
538 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;544 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
545 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
539546
540 const s = BigStruct{547 const s = BigStruct{
541 .a = 1,548 .a = 1,
...@@ -563,6 +570,7 @@ extern fn c_big_union(BigUnion) void;...@@ -563,6 +570,7 @@ extern fn c_big_union(BigUnion) void;
563test "C ABI big union" {570test "C ABI big union" {
564 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;571 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
565 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;572 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
573 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
566574
567 const x = BigUnion{575 const x = BigUnion{
568 .a = BigStruct{576 .a = BigStruct{
...@@ -597,6 +605,7 @@ test "C ABI medium struct of ints and floats" {...@@ -597,6 +605,7 @@ test "C ABI medium struct of ints and floats" {
597 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;605 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
598 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;606 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
599 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;607 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
608 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
600609
601 const s = MedStructMixed{610 const s = MedStructMixed{
602 .a = 1234,611 .a = 1234,
...@@ -631,6 +640,7 @@ test "C ABI small struct of ints" {...@@ -631,6 +640,7 @@ test "C ABI small struct of ints" {
631 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;640 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
632 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest;641 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest;
633 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;642 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
643 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
634644
635 const s = SmallStructInts{645 const s = SmallStructInts{
636 .a = 1,646 .a = 1,
...@@ -665,6 +675,7 @@ test "C ABI medium struct of ints" {...@@ -665,6 +675,7 @@ test "C ABI medium struct of ints" {
665 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;675 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
666 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;676 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
667 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;677 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
678 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
668679
669 const s = MedStructInts{680 const s = MedStructInts{
670 .x = 1,681 .x = 1,
...@@ -744,6 +755,7 @@ test "C ABI split struct of ints" {...@@ -744,6 +755,7 @@ test "C ABI split struct of ints" {
744 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;755 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
745 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;756 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
746 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;757 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
758 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
747759
748 const s = SplitStructInt{760 const s = SplitStructInt{
749 .a = 1234,761 .a = 1234,
...@@ -772,6 +784,7 @@ test "C ABI split struct of ints and floats" {...@@ -772,6 +784,7 @@ test "C ABI split struct of ints and floats" {
772 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;784 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
773 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;785 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
774 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;786 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
787 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
775788
776 const s = SplitStructMixed{789 const s = SplitStructMixed{
777 .a = 1234,790 .a = 1234,
...@@ -800,6 +813,7 @@ test "C ABI sret and byval together" {...@@ -800,6 +813,7 @@ test "C ABI sret and byval together" {
800 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;813 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
801 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;814 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
802 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;815 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
816 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
803817
804 const s = BigStruct{818 const s = BigStruct{
805 .a = 1,819 .a = 1,
...@@ -853,6 +867,7 @@ test "C ABI structs of floats as parameter" {...@@ -853,6 +867,7 @@ test "C ABI structs of floats as parameter" {
853 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;867 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
854 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;868 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
855 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;869 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
870 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
856871
857 const v3 = Vector3{872 const v3 = Vector3{
858 .x = 3.0,873 .x = 3.0,
...@@ -894,6 +909,7 @@ test "C ABI structs of ints as multiple parameters" {...@@ -894,6 +909,7 @@ test "C ABI structs of ints as multiple parameters" {
894 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;909 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
895 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;910 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
896 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;911 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
912 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
897913
898 const r1 = Rect{914 const r1 = Rect{
899 .left = 1,915 .left = 1,
...@@ -932,6 +948,7 @@ test "C ABI structs of floats as multiple parameters" {...@@ -932,6 +948,7 @@ test "C ABI structs of floats as multiple parameters" {
932 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;948 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
933 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;949 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
934 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;950 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
951 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
935952
936 const r1 = FloatRect{953 const r1 = FloatRect{
937 .left = 1,954 .left = 1,
...@@ -1046,6 +1063,7 @@ test "Struct with array as padding." {...@@ -1046,6 +1063,7 @@ test "Struct with array as padding." {
1046 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;1063 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
1047 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;1064 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
1048 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;1065 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1066 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
10491067
1050 c_struct_with_array(.{ .a = 1, .padding = undefined, .b = 2 });1068 c_struct_with_array(.{ .a = 1, .padding = undefined, .b = 2 });
10511069
...@@ -1072,6 +1090,7 @@ test "Float array like struct" {...@@ -1072,6 +1090,7 @@ test "Float array like struct" {
1072 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;1090 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
1073 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;1091 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
1074 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;1092 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
1093 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
10751094
1076 c_float_array_struct(.{1095 c_float_array_struct(.{
1077 .origin = .{1096 .origin = .{
...@@ -5471,6 +5490,7 @@ test "DC: Zig passes to C" {...@@ -5471,6 +5490,7 @@ test "DC: Zig passes to C" {
5471 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;5490 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;
5472 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5491 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5473 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5492 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5493 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5474 try expectOk(c_assert_DC(.{ .v1 = -0.25, .v2 = 15 }));5494 try expectOk(c_assert_DC(.{ .v1 = -0.25, .v2 = 15 }));
5475}5495}
5476test "DC: Zig returns to C" {5496test "DC: Zig returns to C" {
...@@ -5485,6 +5505,7 @@ test "DC: C passes to Zig" {...@@ -5485,6 +5505,7 @@ test "DC: C passes to Zig" {
5485 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;5505 if (builtin.cpu.arch.isRISCV()) return error.SkipZigTest;
5486 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5506 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5487 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5507 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5508 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5488 try expectOk(c_send_DC());5509 try expectOk(c_send_DC());
5489}5510}
5490test "DC: C returns to Zig" {5511test "DC: C returns to Zig" {
...@@ -5518,6 +5539,7 @@ test "CFF: Zig passes to C" {...@@ -5518,6 +5539,7 @@ test "CFF: Zig passes to C" {
5518 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;5539 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
5519 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5540 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5520 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5541 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5542 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5521 try expectOk(c_assert_CFF(.{ .v1 = 39, .v2 = 0.875, .v3 = 1.0 }));5543 try expectOk(c_assert_CFF(.{ .v1 = 39, .v2 = 0.875, .v3 = 1.0 }));
5522}5544}
5523test "CFF: Zig returns to C" {5545test "CFF: Zig returns to C" {
...@@ -5533,6 +5555,7 @@ test "CFF: C passes to Zig" {...@@ -5533,6 +5555,7 @@ test "CFF: C passes to Zig" {
5533 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;5555 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
5534 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5556 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5535 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5557 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5558 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
55365559
5537 try expectOk(c_send_CFF());5560 try expectOk(c_send_CFF());
5538}5561}
...@@ -5567,6 +5590,7 @@ test "PD: Zig passes to C" {...@@ -5567,6 +5590,7 @@ test "PD: Zig passes to C" {
5567 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;5590 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
5568 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5591 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5569 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5592 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5593 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5570 try expectOk(c_assert_PD(.{ .v1 = null, .v2 = 0.5 }));5594 try expectOk(c_assert_PD(.{ .v1 = null, .v2 = 0.5 }));
5571}5595}
5572test "PD: Zig returns to C" {5596test "PD: Zig returns to C" {
...@@ -5579,6 +5603,7 @@ test "PD: C passes to Zig" {...@@ -5579,6 +5603,7 @@ test "PD: C passes to Zig" {
5579 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;5603 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
5580 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5604 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5581 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5605 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5606 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
5582 try expectOk(c_send_PD());5607 try expectOk(c_send_PD());
5583}5608}
5584test "PD: C returns to Zig" {5609test "PD: C returns to Zig" {
...@@ -5641,6 +5666,7 @@ test "C function that takes byval struct called via function pointer" {...@@ -5641,6 +5666,7 @@ test "C function that takes byval struct called via function pointer" {
5641 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;5666 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
5642 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;5667 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
5643 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5668 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5669 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
56445670
5645 var fn_ptr = &c_func_ptr_byval;5671 var fn_ptr = &c_func_ptr_byval;
5646 _ = &fn_ptr;5672 _ = &fn_ptr;
...@@ -5781,6 +5807,7 @@ test "Stdcall ABI structs" {...@@ -5781,6 +5807,7 @@ test "Stdcall ABI structs" {
5781 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;5807 if (builtin.cpu.arch.isPowerPC()) return error.SkipZigTest;
5782 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest;5808 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest;
5783 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5809 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5810 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
57845811
5785 const res = stdcall_coord2(5812 const res = stdcall_coord2(
5786 .{ .x = 0x1111, .y = 0x2222 },5813 .{ .x = 0x1111, .y = 0x2222 },
...@@ -5795,6 +5822,7 @@ extern fn stdcall_big_union(BigUnion) callconv(stdcall_callconv) void;...@@ -5795,6 +5822,7 @@ extern fn stdcall_big_union(BigUnion) callconv(stdcall_callconv) void;
5795test "Stdcall ABI big union" {5822test "Stdcall ABI big union" {
5796 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;5823 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
5797 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5824 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5825 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
57985826
5799 const x = BigUnion{5827 const x = BigUnion{
5800 .a = BigStruct{5828 .a = BigStruct{
...@@ -5868,6 +5896,7 @@ test "byval tail callsite attribute" {...@@ -5868,6 +5896,7 @@ test "byval tail callsite attribute" {
5868 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;5896 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest;
5869 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;5897 if (builtin.cpu.arch.isPowerPC32()) return error.SkipZigTest;
5870 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;5898 if (builtin.cpu.arch.isLoongArch()) return error.SkipZigTest;
5899 if (builtin.cpu.arch == .hexagon) return error.SkipZigTest;
58715900
5872 // Originally reported at https://github.com/ziglang/zig/issues/162905901 // Originally reported at https://github.com/ziglang/zig/issues/16290
5873 // the bug was that the extern function had the byval attribute, but5902 // the bug was that the extern function had the byval attribute, but
test/tests.zig+7-8
...@@ -1607,14 +1607,13 @@ const c_abi_targets = blk: {...@@ -1607,14 +1607,13 @@ const c_abi_targets = blk: {
1607 },1607 },
1608 },1608 },
16091609
1610 // Crashes in LLVM instruction selection.1610 .{
1611 // .{1611 .target = .{
1612 // .target = .{1612 .cpu_arch = .hexagon,
1613 // .cpu_arch = .hexagon,1613 .os_tag = .linux,
1614 // .os_tag = .linux,1614 .abi = .musl,
1615 // .abi = .musl,1615 },
1616 // },1616 },
1617 // },
16181617
1619 .{1618 .{
1620 .target = .{1619 .target = .{