[PATCH] D29708: [compiler-rt] [test] #ifdef new builtin tests for __arm__ platform
mgorny created this revision. Herald added subscribers: dberris, aemerson. Add an #if that excludes the newly added aeabi* tests on non-ARM platforms. This is consistent with other ARM tests, and aims to make running builtin tests easier. Lacking a proper infrastructure to run tests selectively, it is more convenient if we do not have to implement directory-platform exclusions and can just rely on tests compiling to no-op on other platforms. Repository: rL LLVM https://reviews.llvm.org/D29708 Files: test/builtins/Unit/arm/aeabi_idivmod_test.c test/builtins/Unit/arm/aeabi_uidivmod_test.c test/builtins/Unit/arm/aeabi_uldivmod_test.c Index: test/builtins/Unit/arm/aeabi_uldivmod_test.c === --- test/builtins/Unit/arm/aeabi_uldivmod_test.c +++ test/builtins/Unit/arm/aeabi_uldivmod_test.c @@ -14,6 +14,7 @@ #include "int_lib.h" #include +#if __arm__ // Based on udivmoddi4_test.c COMPILER_RT_ABI void /* __value_in_regs */ __aeabi_uldivmod(du_int a, du_int b); @@ -20637,14 +20638,19 @@ {0xuLL, 0xFFFEuLL, 0x0001uLL, 0x0001uLL}, {0xuLL, 0xuLL, 0x0001uLL, 0xuLL} }; +#endif int main() { +#if __arm__ const unsigned N = sizeof(tests) / sizeof(tests[0]); unsigned i; for (i = 0; i < N; ++i) if (test_aeabi_uldivmod(tests[i][0], tests[i][1], tests[i][2], tests[i][3])) return 1; +#else +printf("skipped\n"); +#endif return 0; } Index: test/builtins/Unit/arm/aeabi_uidivmod_test.c === --- test/builtins/Unit/arm/aeabi_uidivmod_test.c +++ test/builtins/Unit/arm/aeabi_uidivmod_test.c @@ -14,6 +14,7 @@ #include "int_lib.h" #include +#if __arm__ // Based on udivmodsi4_test.c extern du_int __aeabi_uidivmod(su_int a, su_int b); @@ -38,10 +39,12 @@ return 0; } +#endif int main() { +#if __arm__ if (test__aeabi_uidivmod(0, 1, 0, 0)) return 1; @@ -56,6 +59,9 @@ if (test__aeabi_uidivmod(0x8003, 8, 0x1000, 3)) return 1; +#else +printf("skipped\n"); +#endif return 0; } Index: test/builtins/Unit/arm/aeabi_idivmod_test.c === --- test/builtins/Unit/arm/aeabi_idivmod_test.c +++ test/builtins/Unit/arm/aeabi_idivmod_test.c @@ -14,6 +14,7 @@ #include "int_lib.h" #include +#if __arm__ // Based on divmodsi4_test.c extern du_int __aeabi_idivmod(si_int a, si_int b); @@ -38,10 +39,12 @@ return 0; } +#endif int main() { +#if __arm__ if (test__aeabi_idivmod(0, 1, 0, 0)) return 1; if (test__aeabi_idivmod(0, -1, 0, 0)) @@ -69,6 +72,9 @@ return 1; if (test__aeabi_idivmod(0x8007, 8, 0xf001, -1)) return 1; +#else +printf("skipped\n"); +#endif return 0; } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D29708: [compiler-rt] [test] #ifdef new builtin tests for __arm__ platform
This revision was automatically updated to reflect the committed changes. Closed by commit rL294438: [test] #ifdef new builtin tests for __arm__ platform (authored by mgorny). Changed prior to commit: https://reviews.llvm.org/D29708?vs=87617&id=87629#toc Repository: rL LLVM https://reviews.llvm.org/D29708 Files: compiler-rt/trunk/test/builtins/Unit/arm/aeabi_idivmod_test.c compiler-rt/trunk/test/builtins/Unit/arm/aeabi_uidivmod_test.c compiler-rt/trunk/test/builtins/Unit/arm/aeabi_uldivmod_test.c Index: compiler-rt/trunk/test/builtins/Unit/arm/aeabi_uidivmod_test.c === --- compiler-rt/trunk/test/builtins/Unit/arm/aeabi_uidivmod_test.c +++ compiler-rt/trunk/test/builtins/Unit/arm/aeabi_uidivmod_test.c @@ -14,6 +14,7 @@ #include "int_lib.h" #include +#if __arm__ // Based on udivmodsi4_test.c extern du_int __aeabi_uidivmod(su_int a, su_int b); @@ -38,10 +39,12 @@ return 0; } +#endif int main() { +#if __arm__ if (test__aeabi_uidivmod(0, 1, 0, 0)) return 1; @@ -56,6 +59,9 @@ if (test__aeabi_uidivmod(0x8003, 8, 0x1000, 3)) return 1; +#else +printf("skipped\n"); +#endif return 0; } Index: compiler-rt/trunk/test/builtins/Unit/arm/aeabi_idivmod_test.c === --- compiler-rt/trunk/test/builtins/Unit/arm/aeabi_idivmod_test.c +++ compiler-rt/trunk/test/builtins/Unit/arm/aeabi_idivmod_test.c @@ -14,6 +14,7 @@ #include "int_lib.h" #include +#if __arm__ // Based on divmodsi4_test.c extern du_int __aeabi_idivmod(si_int a, si_int b); @@ -38,10 +39,12 @@ return 0; } +#endif int main() { +#if __arm__ if (test__aeabi_idivmod(0, 1, 0, 0)) return 1; if (test__aeabi_idivmod(0, -1, 0, 0)) @@ -69,6 +72,9 @@ return 1; if (test__aeabi_idivmod(0x8007, 8, 0xf001, -1)) return 1; +#else +printf("skipped\n"); +#endif return 0; } Index: compiler-rt/trunk/test/builtins/Unit/arm/aeabi_uldivmod_test.c === --- compiler-rt/trunk/test/builtins/Unit/arm/aeabi_uldivmod_test.c +++ compiler-rt/trunk/test/builtins/Unit/arm/aeabi_uldivmod_test.c @@ -14,6 +14,7 @@ #include "int_lib.h" #include +#if __arm__ // Based on udivmoddi4_test.c COMPILER_RT_ABI void /* __value_in_regs */ __aeabi_uldivmod(du_int a, du_int b); @@ -20637,14 +20638,19 @@ {0xuLL, 0xFFFEuLL, 0x0001uLL, 0x0001uLL}, {0xuLL, 0xuLL, 0x0001uLL, 0xuLL} }; +#endif int main() { +#if __arm__ const unsigned N = sizeof(tests) / sizeof(tests[0]); unsigned i; for (i = 0; i < N; ++i) if (test_aeabi_uldivmod(tests[i][0], tests[i][1], tests[i][2], tests[i][3])) return 1; +#else +printf("skipped\n"); +#endif return 0; } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits