diff options
author | David L. Jones <dlj@google.com> | 2017-11-10 01:07:01 +0000 |
---|---|---|
committer | David L. Jones <dlj@google.com> | 2017-11-10 01:07:01 +0000 |
commit | 5cdb7458cb1d6fc8fc83dd5a177658f1284f5d29 (patch) | |
tree | 1772d0d4f25219059bc98e9c65baeef15d268524 /test/builtins/Unit/bswapsi2_test.c | |
parent | 97e140242d3085562afa1340578d5f531a82ad69 (diff) | |
parent | bcc227ee4af1ef3e63033b35dcb1d5627a3b2941 (diff) | |
download | compiler-rt-5cdb7458cb1d6fc8fc83dd5a177658f1284f5d29.tar.gz |
Creating branches/google/testing and tags/google/testing/ from r317203
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/google/testing@317856 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/builtins/Unit/bswapsi2_test.c')
-rw-r--r-- | test/builtins/Unit/bswapsi2_test.c | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/test/builtins/Unit/bswapsi2_test.c b/test/builtins/Unit/bswapsi2_test.c index 4488a888e..899c251d9 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 @@ -11,34 +13,25 @@ // //===----------------------------------------------------------------------===// -#include <stdlib.h> +#include <math.h> #include <stdint.h> #include <stdio.h> -#include <math.h> - +#include <stdlib.h> 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; } |