From 52f4922ebb7bfe5f9a6c32cf7d637b84e491526a Mon Sep 17 00:00:00 2001 From: AndreyChurbanov Date: Thu, 21 Oct 2021 21:51:33 +0300 Subject: [PATCH] [OpenMP][NFC] skip atomic tests for non-x86 arch --- openmp/runtime/test/atomic/kmp_atomic_cas.c | 7 +++++++ openmp/runtime/test/atomic/kmp_atomic_cas_cpt.c | 7 +++++++ openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/openmp/runtime/test/atomic/kmp_atomic_cas.c b/openmp/runtime/test/atomic/kmp_atomic_cas.c index 82c4745..5706701 100644 --- a/openmp/runtime/test/atomic/kmp_atomic_cas.c +++ b/openmp/runtime/test/atomic/kmp_atomic_cas.c @@ -4,6 +4,9 @@ #include #include +// Used to detect architecture +#include "../../src/kmp_platform.h" + #ifdef __cplusplus extern "C" { #endif @@ -32,6 +35,7 @@ __kmpc_atomic_val_8_cas(ident_t *loc, int gtid, long long *x, long long e, int main() { int ret = 0; +#if KMP_ARCH_X86 || KMP_ARCH_X86_64 bool r; char c0 = 1; char c1 = 2; @@ -176,5 +180,8 @@ int main() { if (ret == 0) printf("passed\n"); +#else + printf("Unsupported architecture, skipping test...\n"); +#endif // KMP_ARCH_X86 || KMP_ARCH_X86_64 return ret; } diff --git a/openmp/runtime/test/atomic/kmp_atomic_cas_cpt.c b/openmp/runtime/test/atomic/kmp_atomic_cas_cpt.c index f70cfbf..676ecb8 100644 --- a/openmp/runtime/test/atomic/kmp_atomic_cas_cpt.c +++ b/openmp/runtime/test/atomic/kmp_atomic_cas_cpt.c @@ -4,6 +4,9 @@ #include #include +// Used to detect architecture +#include "../../src/kmp_platform.h" + #ifdef __cplusplus extern "C" { #endif @@ -38,6 +41,7 @@ __kmpc_atomic_val_8_cas_cpt(ident_t *loc, int gtid, long long *x, long long e, int main() { int ret = 0; +#if KMP_ARCH_X86 || KMP_ARCH_X86_64 bool r; char c0 = 1; char c1 = 2; @@ -215,5 +219,8 @@ int main() { if (ret == 0) printf("passed\n"); +#else + printf("Unsupported architecture, skipping test...\n"); +#endif // KMP_ARCH_X86 || KMP_ARCH_X86_64 return ret; } diff --git a/openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c b/openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c index 6401dac..7a8e46e 100644 --- a/openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c +++ b/openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c @@ -4,6 +4,9 @@ #include #include +// Used to detect architecture +#include "../../src/kmp_platform.h" + #ifdef __cplusplus extern "C" { #endif @@ -24,6 +27,7 @@ extern long double __kmpc_atomic_float10_min_cpt(ident_t *id_ref, int gtid, int main() { int ret = 0; +#if KMP_ARCH_X86 || KMP_ARCH_X86_64 long double s = 012.3456; // small long double e = 123.4567; // middle long double d = 234.5678; // big @@ -151,5 +155,8 @@ int main() { if (ret == 0) printf("passed\n"); +#else + printf("Unsupported architecture, skipping test...\n"); +#endif // KMP_ARCH_X86 || KMP_ARCH_X86_64 return ret; } -- 2.7.4