Skip to content

Commit 52f4922

Browse files
[OpenMP][NFC] skip atomic tests for non-x86 arch
1 parent 8262f45 commit 52f4922

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

openmp/runtime/test/atomic/kmp_atomic_cas.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#include <stdbool.h>
55
#include <omp.h>
66

7+
// Used to detect architecture
8+
#include "../../src/kmp_platform.h"
9+
710
#ifdef __cplusplus
811
extern "C" {
912
#endif
@@ -32,6 +35,7 @@ __kmpc_atomic_val_8_cas(ident_t *loc, int gtid, long long *x, long long e,
3235

3336
int main() {
3437
int ret = 0;
38+
#if KMP_ARCH_X86 || KMP_ARCH_X86_64
3539
bool r;
3640
char c0 = 1;
3741
char c1 = 2;
@@ -176,5 +180,8 @@ int main() {
176180

177181
if (ret == 0)
178182
printf("passed\n");
183+
#else
184+
printf("Unsupported architecture, skipping test...\n");
185+
#endif // KMP_ARCH_X86 || KMP_ARCH_X86_64
179186
return ret;
180187
}

openmp/runtime/test/atomic/kmp_atomic_cas_cpt.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#include <stdbool.h>
55
#include <omp.h>
66

7+
// Used to detect architecture
8+
#include "../../src/kmp_platform.h"
9+
710
#ifdef __cplusplus
811
extern "C" {
912
#endif
@@ -38,6 +41,7 @@ __kmpc_atomic_val_8_cas_cpt(ident_t *loc, int gtid, long long *x, long long e,
3841

3942
int main() {
4043
int ret = 0;
44+
#if KMP_ARCH_X86 || KMP_ARCH_X86_64
4145
bool r;
4246
char c0 = 1;
4347
char c1 = 2;
@@ -215,5 +219,8 @@ int main() {
215219

216220
if (ret == 0)
217221
printf("passed\n");
222+
#else
223+
printf("Unsupported architecture, skipping test...\n");
224+
#endif // KMP_ARCH_X86 || KMP_ARCH_X86_64
218225
return ret;
219226
}

openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#include <stdio.h>
55
#include <omp.h>
66

7+
// Used to detect architecture
8+
#include "../../src/kmp_platform.h"
9+
710
#ifdef __cplusplus
811
extern "C" {
912
#endif
@@ -24,6 +27,7 @@ extern long double __kmpc_atomic_float10_min_cpt(ident_t *id_ref, int gtid,
2427

2528
int main() {
2629
int ret = 0;
30+
#if KMP_ARCH_X86 || KMP_ARCH_X86_64
2731
long double s = 012.3456; // small
2832
long double e = 123.4567; // middle
2933
long double d = 234.5678; // big
@@ -151,5 +155,8 @@ int main() {
151155

152156
if (ret == 0)
153157
printf("passed\n");
158+
#else
159+
printf("Unsupported architecture, skipping test...\n");
160+
#endif // KMP_ARCH_X86 || KMP_ARCH_X86_64
154161
return ret;
155162
}

0 commit comments

Comments
 (0)