[Openmp-commits] [openmp] 52f4922 - [OpenMP][NFC] skip atomic tests for non-x86 arch
via Openmp-commits
openmp-commits at lists.llvm.org
Thu Oct 21 11:51:42 PDT 2021
Author: AndreyChurbanov
Date: 2021-10-21T21:51:33+03:00
New Revision: 52f4922ebb7bfe5f9a6c32cf7d637b84e491526a
URL: https://github.com/llvm/llvm-project/commit/52f4922ebb7bfe5f9a6c32cf7d637b84e491526a
DIFF: https://github.com/llvm/llvm-project/commit/52f4922ebb7bfe5f9a6c32cf7d637b84e491526a.diff
LOG: [OpenMP][NFC] skip atomic tests for non-x86 arch
Added:
Modified:
openmp/runtime/test/atomic/kmp_atomic_cas.c
openmp/runtime/test/atomic/kmp_atomic_cas_cpt.c
openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c
Removed:
################################################################################
diff --git a/openmp/runtime/test/atomic/kmp_atomic_cas.c b/openmp/runtime/test/atomic/kmp_atomic_cas.c
index 82c4745b30980..5706701e4a46a 100644
--- a/openmp/runtime/test/atomic/kmp_atomic_cas.c
+++ b/openmp/runtime/test/atomic/kmp_atomic_cas.c
@@ -4,6 +4,9 @@
#include <stdbool.h>
#include <omp.h>
+// 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 f70cfbfe2fbed..676ecb89d822b 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 <stdbool.h>
#include <omp.h>
+// 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 6401dacb37d49..7a8e46e0e9f23 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 <stdio.h>
#include <omp.h>
+// 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;
}
More information about the Openmp-commits
mailing list