From 43d584fba6ecb04daa4851e8529a90c8b79fc538 Mon Sep 17 00:00:00 2001 From: Weiming Zhao Date: Tue, 21 Mar 2017 05:32:51 +0000 Subject: [Builtin] Implement lit-test support (part 1 of 2: test cases update) Original r297566 is splitted into two parts. This is part one, which adds "RUN" command for test cases. Unit/arm/call_apsr.S is updated to support thumb1. It also fixes a bug in arm/aeabi_uldivmod_test.c gcc_personality_test is XFAILED as the framework cannot handle it so far. cpu_model_test is also XFAILED for now as it is expected to return non-zero. TODO: A few tests are XFAILed for armhf and aarch64. We need further investigating. [1,2] Tracks the issue. [1] https://bugs.llvm.org//show_bug.cgi?id=32260 [2] https://bugs.llvm.org//show_bug.cgi?id=32261 Reviewers: rengolin, compnerd, jroelofs, erik.pilkington, arphaman Reviewed By: jroelofs Subscribers: jroelofs, aemerson, srhines, nemanjai, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D30802 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@298339 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/builtins/Unit/bswapsi2_test.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/builtins/Unit/bswapsi2_test.c') diff --git a/test/builtins/Unit/bswapsi2_test.c b/test/builtins/Unit/bswapsi2_test.c index 4488a888e..c32cbb442 100644 --- a/test/builtins/Unit/bswapsi2_test.c +++ b/test/builtins/Unit/bswapsi2_test.c @@ -1,3 +1,5 @@ +// UNSUPPORTED: armv6m-target-arch +// RUN: %clang_builtins %s %librt -o %t && %run %t //===-- bswapsi2_test.c - Test __bswapsi2 ---------------------------------===// // // The LLVM Compiler Infrastructure -- cgit v1.2.1 From cb42103777b0fa8b8f38a7bfe5592ed8e3e48388 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 25 May 2017 14:52:14 +0000 Subject: Add generic __bswap[ds]i2 implementations Summary: In FreeBSD we needed to add generic implementations for `__bswapdi2` and `__bswapsi2`, since gcc 6.x for mips is emitting calls to these. See: https://reviews.freebsd.org/D10838 and https://reviews.freebsd.org/rS318601 The actual mips code generated for these generic C versions is pretty OK, as can be seen in the (FreeBSD) review. I checked over gcc sources, and it seems that it can emit these calls on more architectures, so maybe it's best to simply always add them to the compiler-rt builtins library. Reviewers: howard.hinnant, compnerd, petarj, emaste Reviewed By: compnerd, emaste Subscribers: mgorny, llvm-commits, arichardson Differential Revision: https://reviews.llvm.org/D33516 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303866 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/builtins/Unit/bswapsi2_test.c | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) (limited to 'test/builtins/Unit/bswapsi2_test.c') diff --git a/test/builtins/Unit/bswapsi2_test.c b/test/builtins/Unit/bswapsi2_test.c index c32cbb442..899c251d9 100644 --- a/test/builtins/Unit/bswapsi2_test.c +++ b/test/builtins/Unit/bswapsi2_test.c @@ -13,34 +13,25 @@ // //===----------------------------------------------------------------------===// -#include +#include #include #include -#include - +#include extern uint32_t __bswapsi2(uint32_t); -#if __arm__ -int test__bswapsi2(uint32_t a, uint32_t expected) -{ - uint32_t actual = __bswapsi2(a); - if (actual != expected) - printf("error in test__bswapsi2(0x%0X) = 0x%0X, expected 0x%0X\n", - a, actual, expected); - return actual != expected; +int test__bswapsi2(uint32_t a, uint32_t expected) { + uint32_t actual = __bswapsi2(a); + if (actual != expected) + printf("error in test__bswapsi2(0x%0X) = 0x%0X, expected 0x%0X\n", a, + actual, expected); + return actual != expected; } -#endif -int main() -{ -#if __arm__ - if (test__bswapsi2(0x12345678, 0x78563412)) - return 1; - if (test__bswapsi2(0x00000001, 0x01000000)) - return 1; -#else - printf("skipped\n"); -#endif - return 0; +int main() { + if (test__bswapsi2(0x12345678, 0x78563412)) + return 1; + if (test__bswapsi2(0x00000001, 0x01000000)) + return 1; + return 0; } -- cgit v1.2.1