This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] kmp_atomic_float10_max_min.c test should only be executed on x86 platform
ClosedPublic

Authored by igor.kirillov on Feb 4 2022, 5:28 AM.

Diff Detail

Event Timeline

igor.kirillov created this revision.Feb 4 2022, 5:28 AM
igor.kirillov requested review of this revision.Feb 4 2022, 5:28 AM
Herald added a project: Restricted Project. · View Herald Transcript
kkwli0 added a subscriber: kkwli0.Feb 4 2022, 6:47 AM

It works on Power9. Thanks.

@kkwli0 Hi, is it useful to run this test outside of x86? We on aarch64 had the same problem as the on addressed by a64797b5b81963a8d4bc73eaacabfee67c85c679. Alternatively I can just // UNSUPPORTED: aarch64 instead of // REQUIRES: x86-registered-target but there is a chance those clauses will be needed for the other architectures too.

kkwli0 added a comment.Feb 4 2022, 8:15 AM

@igor.kirillov Adding // UNSUPPORTED: aarch64 may not work because the config.target_triplet is empty. Actually, it currently does not work on Power with // UNSUPPORTED: powerpc. And I experiment the following changes but I am not sure about the overall impact.

diff --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg
index c1d240eaa80a..4dca14c35c38 100644
--- a/openmp/runtime/test/lit.cfg
+++ b/openmp/runtime/test/lit.cfg
@@ -56,7 +56,7 @@ if config.has_libatomic:
     libs += " -latomic"
 
 # Allow REQUIRES / UNSUPPORTED / XFAIL to work
-config.target_triple = [ ]
 for feature in config.test_compiler_features:
     config.available_features.add(feature)
 
diff --git a/openmp/runtime/test/lit.site.cfg.in b/openmp/runtime/test/lit.site.cfg.in
index dae5b9007931..2c6ca43d3e71 100644
--- a/openmp/runtime/test/lit.site.cfg.in
+++ b/openmp/runtime/test/lit.site.cfg.in
@@ -1,5 +1,6 @@
 @AUTO_GEN_COMMENT@
 
+config.target_triple = "@TARGET_TRIPLE@"
 config.test_c_compiler = "@OPENMP_TEST_C_COMPILER@"
 config.test_cxx_compiler = "@OPENMP_TEST_CXX_COMPILER@"
 config.test_compiler_features = @OPENMP_TEST_COMPILER_FEATURES@
kkwli0 added a comment.Feb 4 2022, 6:50 PM

@igor.kirillov I try it on x86_64 and the patch works.

JonChesterfield accepted this revision.Feb 5 2022, 2:20 PM
JonChesterfield added a subscriber: JonChesterfield.

Looks reasonable to me. This is looking at 80 bit floating point which x86 can do (in some modes at least, this passes mlong-double-80 ). Long double elsewhere tends to be 64 or 128 bit.

If we have another in tree target w/openmp that can do fp80 then I suppose the test should run on that as well. I don't know of one though.

This revision is now accepted and ready to land.Feb 5 2022, 2:20 PM
This revision was landed with ongoing or failed builds.Feb 7 2022, 2:16 AM
This revision was automatically updated to reflect the committed changes.