[Openmp-commits] [openmp] 50d2a19 - [OpenMP] Only test kmp_atomic_float10_max_min.c on X86

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Fri Jan 20 07:52:58 PST 2023


Author: Shilei Tian
Date: 2023-01-20T10:52:53-05:00
New Revision: 50d2a193a7399ce99e321b93d6ee85184d3be4de

URL: https://github.com/llvm/llvm-project/commit/50d2a193a7399ce99e321b93d6ee85184d3be4de
DIFF: https://github.com/llvm/llvm-project/commit/50d2a193a7399ce99e321b93d6ee85184d3be4de.diff

LOG: [OpenMP] Only test kmp_atomic_float10_max_min.c on X86

The test `openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c` uses a compiler
flag `-mlong-double-80` that might not be supported by all targets. Currently it
requires `x86-registered-target`, but that requirement can be true when LLVM
supports X86 while the actual `libomp` arch is not X86. For example, when LLVM
is built on AArch64 with all targets enabled, `x86-registered-target` can be met.
If `libomp` is built with native target, aka. AArch64, the test will still be enabled,
causing test failure.

This patch only enables the test if the actual target is X86. The actual target
is determined by `LIBOMP_ARCH`.

Fix #53696.

Reviewed By: jlpeyton

Differential Revision: https://reviews.llvm.org/D142172

Added: 
    

Modified: 
    openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c
    openmp/runtime/test/lit.cfg
    openmp/runtime/test/lit.site.cfg.in

Removed: 
    


################################################################################
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 cc54e1a05c149..82d8cbc19d7a1 100644
--- a/openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c
+++ b/openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c
@@ -1,6 +1,6 @@
 // RUN: %libomp-compile -mlong-double-80 && %libomp-run
 // UNSUPPORTED: gcc
-// REQUIRES: x86-registered-target
+// REQUIRES: x86-target-arch
 
 #include <stdio.h>
 #include <omp.h>

diff  --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg
index 5e429d502ae64..d008844a0cc57 100644
--- a/openmp/runtime/test/lit.cfg
+++ b/openmp/runtime/test/lit.cfg
@@ -114,6 +114,12 @@ if config.operating_system in ['Linux', 'Windows']:
 if config.operating_system in ['Linux']:
     config.available_features.add('hidden-helper')
 
+target_arch = getattr(config, 'target_arch', None)
+if target_arch:
+  config.available_features.add(target_arch + '-target-arch')
+  if target_arch in ['x86_64', 'i386']:
+    config.available_features.add('x86-target-arch')
+
 # Avoid Windows heuristics which try to detect potential installer programs
 # (which may need to run with elevated privileges) and ask if the user wants
 # to run them in that way. This heuristic may match for executables containing

diff  --git a/openmp/runtime/test/lit.site.cfg.in b/openmp/runtime/test/lit.site.cfg.in
index e84a2d31a1f68..45a18b480130f 100644
--- a/openmp/runtime/test/lit.site.cfg.in
+++ b/openmp/runtime/test/lit.site.cfg.in
@@ -19,6 +19,7 @@ config.has_libm = @LIBOMP_HAVE_LIBM@
 config.has_libatomic = @LIBOMP_HAVE_LIBATOMIC@
 config.is_standalone_build = @OPENMP_STANDALONE_BUILD@
 config.has_omit_frame_pointer_flag = @OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS@
+config.target_arch = "@LIBOMP_ARCH@"
 
 # Let the main config do the real work.
 lit_config.load_config(config, "@LIBOMP_BASE_DIR@/test/lit.cfg")


        


More information about the Openmp-commits mailing list