[libcxx-commits] [libcxx] [libc++][test] fix atomic float test CI failure (PR #73364)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Nov 24 12:25:58 PST 2023
https://github.com/huixie90 updated https://github.com/llvm/llvm-project/pull/73364
>From 72bc94d6f9c297221619e0881fea09c9f2f7ab78 Mon Sep 17 00:00:00 2001
From: Hui <hui.xie0621 at gmail.com>
Date: Fri, 24 Nov 2023 20:09:01 +0000
Subject: [PATCH 1/2] [libc++][test] fix atomic float test CI failure
---
.../atomics.types.float/lockfree.pass.cpp | 3 +--
.../atomics.types.float/assign.pass.cpp | 3 +--
.../compare_exchange_strong.pass.cpp | 2 +-
.../compare_exchange_weak.pass.cpp | 2 +-
.../atomics.types.float/ctor.pass.cpp | 3 +--
.../atomics.types.float/exchange.pass.cpp | 5 ++---
.../atomics.types.float/fetch_add.pass.cpp | 7 +++----
.../atomics.types.float/fetch_sub.pass.cpp | 7 +++----
.../atomics.types.float/load.pass.cpp | 5 ++---
.../atomics.types.float/lockfree.pass.cpp | 3 +--
.../atomics.types.float/notify_all.pass.cpp | 2 +-
.../atomics.types.float/notify_one.pass.cpp | 2 +-
.../atomics.types.float/operator.float.pass.cpp | 3 +--
.../operator.minus_equals.pass.cpp | 5 ++---
.../operator.plus_equals.pass.cpp | 5 ++---
.../atomics.types.float/store.pass.cpp | 4 ++--
.../atomics.types.float/wait.pass.cpp | 4 ++--
libcxx/utils/libcxx/test/features.py | 13 +++++--------
18 files changed, 32 insertions(+), 46 deletions(-)
diff --git a/libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp b/libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp
index 46511530c7c7582..22fd06c3a6dfe80 100644
--- a/libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp
+++ b/libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp
@@ -6,8 +6,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: target={{.+}}-windows-gnu
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: !non-lockfree-atomics
// static constexpr bool is_always_lock_free = implementation-defined;
// bool is_lock_free() const volatile noexcept;
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/assign.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/assign.pass.cpp
index 8efb556cb5d99a5..df889106289970b 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/assign.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/assign.pass.cpp
@@ -6,8 +6,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: target={{.+}}-windows-gnu
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: !non-lockfree-atomics
// floating-point-type operator=(floating-point-type) volatile noexcept;
// floating-point-type operator=(floating-point-type) noexcept;
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_strong.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_strong.pass.cpp
index 839d79d3a411052..d7d2a9d5c56b7c3 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_strong.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_strong.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: !non-lockfree-atomics
// bool compare_exchange_strong(T& expected, T desired,
// memory_order success, memory_order failure) volatile noexcept;
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_weak.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_weak.pass.cpp
index 097210cc4a9db26..0c9107ac2d48349 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_weak.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_weak.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: !non-lockfree-atomics
// bool compare_exchange_weak(T& expected, T desired,
// memory_order success, memory_order failure) volatile noexcept;
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/ctor.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/ctor.pass.cpp
index febabb4f2678261..bfd9573dfd5dd15 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/ctor.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/ctor.pass.cpp
@@ -6,8 +6,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: target={{.+}}-windows-gnu
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: !non-lockfree-atomics
// constexpr atomic() noexcept;
// constexpr atomic(floating-point-type) noexcept;
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/exchange.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/exchange.pass.cpp
index a8306304280c545..a09804f2e76a5ed 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/exchange.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/exchange.pass.cpp
@@ -6,11 +6,10 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: target={{.+}}-windows-gnu
// Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893
-// XFAIL: tsan
+// XFAIL: target={{x86_64-.*}} && tsan
// XFAIL: target={{x86_64-.*}} && msan
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: !non-lockfree-atomics
// T exchange(T, memory_order = memory_order::seq_cst) volatile noexcept;
// T exchange(T, memory_order = memory_order::seq_cst) noexcept;
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp
index 0c59b50eb807051..d3aa1772fcc2aa5 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp
@@ -6,13 +6,12 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: target={{.+}}-windows-gnu
-// XFAIL: LIBCXX-AIX-FIXME
+// UNSUPPORTED: LIBCXX-AIX-FIXME
// Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893
-// XFAIL: tsan
+// XFAIL: target={{x86_64-.*}} && tsan
// Hangs with msan.
// UNSUPPORTED: msan
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: !non-lockfree-atomics
// floating-point-type fetch_add(floating-point-type,
// memory_order = memory_order::seq_cst) volatile noexcept;
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp
index 4435e3fc19b4e90..48c9b0b63bee751 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp
@@ -6,13 +6,12 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: target={{.+}}-windows-gnu
-// XFAIL: LIBCXX-AIX-FIXME
+// UNSUPPORTED: LIBCXX-AIX-FIXME
// Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893
-// XFAIL: tsan
+// XFAIL: target={{x86_64-.*}} && tsan
// Hangs with msan.
// UNSUPPORTED: msan
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: !non-lockfree-atomics
// floating-point-type fetch_sub(floating-point-type,
// memory_order = memory_order::seq_cst) volatile noexcept;
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/load.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/load.pass.cpp
index fa085275de2995b..46689291cf3b1f5 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/load.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/load.pass.cpp
@@ -6,10 +6,9 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: target={{.+}}-windows-gnu
// Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893
-// XFAIL: tsan
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: target={{x86_64-.*}} && tsan
+// XFAIL: !non-lockfree-atomics
// floating-point-type load(memory_order = memory_order::seq_cst) volatile noexcept;
// floating-point-type load(memory_order = memory_order::seq_cst) noexcept;
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp
index 447e0f86500272b..03ca1a551740523 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp
@@ -6,8 +6,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: target={{.+}}-windows-gnu
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: !non-lockfree-atomics
// static constexpr bool is_always_lock_free = implementation-defined;
// bool is_lock_free() const volatile noexcept;
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_all.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_all.pass.cpp
index e2320ed0b70ed13..f1a325fe2b60cbe 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_all.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_all.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: no-threads
// XFAIL: availability-synchronization_library-missing
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: !non-lockfree-atomics
// void notify_all() volatile noexcept;
// void notify_all() noexcept;
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_one.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_one.pass.cpp
index 058424f5cee0593..8df9cde89999c48 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_one.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_one.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: no-threads
// XFAIL: availability-synchronization_library-missing
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: !non-lockfree-atomics
// void notify_one() volatile noexcept;
// void notify_one() noexcept;
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.float.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.float.pass.cpp
index 54c62ba8d091810..45617ab5c11f94f 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.float.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.float.pass.cpp
@@ -6,8 +6,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: target={{.+}}-windows-gnu
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: !non-lockfree-atomics
// operator floating-point-type() volatile noexcept;
// operator floating-point-type() noexcept;
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp
index 23ad0c5c819dc8e..c9424e3563b399b 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp
@@ -6,9 +6,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: target={{.+}}-windows-gnu
-// XFAIL: LIBCXX-AIX-FIXME
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// UNSUPPORTED: LIBCXX-AIX-FIXME
+// XFAIL: !non-lockfree-atomics
// Hangs with msan.
// UNSUPPORTED: msan
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp
index 0676645fcfa1518..f623c6cd80baad1 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp
@@ -6,9 +6,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: target={{.+}}-windows-gnu
-// XFAIL: LIBCXX-AIX-FIXME
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// UNSUPPORTED: LIBCXX-AIX-FIXME
+// XFAIL: !non-lockfree-atomics
// Hangs with msan.
// UNSUPPORTED: msan
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/store.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/store.pass.cpp
index 0bb1f00840a890f..a754d2af6490403 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/store.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/store.pass.cpp
@@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
// Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893
-// XFAIL: tsan
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: target={{x86_64-.*}} && tsan
+// XFAIL: !non-lockfree-atomics
// void store(floating-point-type, memory_order = memory_order::seq_cst) volatile noexcept;
// void store(floating-point-type, memory_order = memory_order::seq_cst) noexcept;
diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/wait.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/wait.pass.cpp
index 15f3613245a836e..9c46b0ef43445b2 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/wait.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/wait.pass.cpp
@@ -8,9 +8,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// XFAIL: availability-synchronization_library-missing
// Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893
-// XFAIL: tsan
+// XFAIL: target={{x86_64-.*}} && tsan
// XFAIL: target={{x86_64-.*}} && msan
-// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic
+// XFAIL: !non-lockfree-atomics
// void wait(T old, memory_order order = memory_order::seq_cst) const volatile noexcept;
// void wait(T old, memory_order order = memory_order::seq_cst) const noexcept;
diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index e854aed66513806..19d36f09433d758 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -111,14 +111,11 @@ def _getAndroidDeviceApi(cfg):
when=lambda cfg: hasCompileFlag(cfg, "-Xclang -verify-ignore-unexpected"),
),
Feature(
- name="has-latomic",
- when=lambda cfg: sourceBuilds(
- cfg,
- """
- int main(int, char**) { return 0; }
- """,
- ["-latomic"],
- ),
+ name="add-latomic-workaround", # https://github.com/llvm/llvm-project/issues/73361
+ when=lambda cfg: sourceBuilds(cfg, "int main(int, char**) { return 0; }", ["-latomic"]),
+ actions=[
+ AddLinkFlag("-latomic")
+ ],
),
Feature(
name="non-lockfree-atomics",
>From 62f45df98ad307db370b5e5ab77c124fee6f6cc7 Mon Sep 17 00:00:00 2001
From: Hui <hui.xie0621 at gmail.com>
Date: Fri, 24 Nov 2023 20:25:41 +0000
Subject: [PATCH 2/2] format
---
libcxx/utils/libcxx/test/features.py | 76 ++++++++++++++++++++--------
1 file changed, 55 insertions(+), 21 deletions(-)
diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index 19d36f09433d758..753ba7aae02e4d1 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -13,22 +13,34 @@
import subprocess
import sys
-_isClang = lambda cfg: "__clang__" in compilerMacros(cfg) and "__apple_build_version__" not in compilerMacros(cfg)
+_isClang = lambda cfg: "__clang__" in compilerMacros(
+ cfg
+) and "__apple_build_version__" not in compilerMacros(cfg)
_isAppleClang = lambda cfg: "__apple_build_version__" in compilerMacros(cfg)
-_isGCC = lambda cfg: "__GNUC__" in compilerMacros(cfg) and "__clang__" not in compilerMacros(cfg)
+_isGCC = lambda cfg: "__GNUC__" in compilerMacros(
+ cfg
+) and "__clang__" not in compilerMacros(cfg)
_isMSVC = lambda cfg: "_MSC_VER" in compilerMacros(cfg)
-_msvcVersion = lambda cfg: (int(compilerMacros(cfg)["_MSC_VER"]) // 100, int(compilerMacros(cfg)["_MSC_VER"]) % 100)
+_msvcVersion = lambda cfg: (
+ int(compilerMacros(cfg)["_MSC_VER"]) // 100,
+ int(compilerMacros(cfg)["_MSC_VER"]) % 100,
+)
def _getSuitableClangTidy(cfg):
try:
# If we didn't build the libcxx-tidy plugin via CMake, we can't run the clang-tidy tests.
- if runScriptExitCode(cfg, ["stat %{test-tools}/clang_tidy_checks/libcxx-tidy.plugin"]) != 0:
+ if (
+ runScriptExitCode(
+ cfg, ["stat %{test-tools}/clang_tidy_checks/libcxx-tidy.plugin"]
+ )
+ != 0
+ ):
return None
# TODO MODULES require ToT due module specific fixes.
- if runScriptExitCode(cfg, ['clang-tidy-17 --version']) == 0:
- return 'clang-tidy-17'
+ if runScriptExitCode(cfg, ["clang-tidy-17 --version"]) == 0:
+ return "clang-tidy-17"
# TODO This should be the last stable release.
# LLVM RELEASE bump to latest stable version
@@ -36,7 +48,14 @@ def _getSuitableClangTidy(cfg):
return "clang-tidy-16"
# LLVM RELEASE bump version
- if int(re.search("[0-9]+", commandOutput(cfg, ["clang-tidy --version"])).group()) >= 16:
+ if (
+ int(
+ re.search(
+ "[0-9]+", commandOutput(cfg, ["clang-tidy --version"])
+ ).group()
+ )
+ >= 16
+ ):
return "clang-tidy"
except ConfigurationRuntimeError:
@@ -111,11 +130,11 @@ def _getAndroidDeviceApi(cfg):
when=lambda cfg: hasCompileFlag(cfg, "-Xclang -verify-ignore-unexpected"),
),
Feature(
- name="add-latomic-workaround", # https://github.com/llvm/llvm-project/issues/73361
- when=lambda cfg: sourceBuilds(cfg, "int main(int, char**) { return 0; }", ["-latomic"]),
- actions=[
- AddLinkFlag("-latomic")
- ],
+ name="add-latomic-workaround", # https://github.com/llvm/llvm-project/issues/73361
+ when=lambda cfg: sourceBuilds(
+ cfg, "int main(int, char**) { return 0; }", ["-latomic"]
+ ),
+ actions=[AddLinkFlag("-latomic")],
),
Feature(
name="non-lockfree-atomics",
@@ -219,7 +238,8 @@ def _getAndroidDeviceApi(cfg):
# manages to find binaries to execute.
Feature(
name="executor-has-no-bash",
- when=lambda cfg: runScriptExitCode(cfg, ["%{exec} bash -c 'bash --version'"]) != 0,
+ when=lambda cfg: runScriptExitCode(cfg, ["%{exec} bash -c 'bash --version'"])
+ != 0,
),
Feature(
name="has-clang-tidy",
@@ -234,11 +254,15 @@ def _getAndroidDeviceApi(cfg):
when=_isAppleClang,
),
Feature(
- name=lambda cfg: "apple-clang-{__clang_major__}.{__clang_minor__}".format(**compilerMacros(cfg)),
+ name=lambda cfg: "apple-clang-{__clang_major__}.{__clang_minor__}".format(
+ **compilerMacros(cfg)
+ ),
when=_isAppleClang,
),
Feature(
- name=lambda cfg: "apple-clang-{__clang_major__}.{__clang_minor__}.{__clang_patchlevel__}".format(**compilerMacros(cfg)),
+ name=lambda cfg: "apple-clang-{__clang_major__}.{__clang_minor__}.{__clang_patchlevel__}".format(
+ **compilerMacros(cfg)
+ ),
when=_isAppleClang,
),
Feature(name="clang", when=_isClang),
@@ -247,11 +271,15 @@ def _getAndroidDeviceApi(cfg):
when=_isClang,
),
Feature(
- name=lambda cfg: "clang-{__clang_major__}.{__clang_minor__}".format(**compilerMacros(cfg)),
+ name=lambda cfg: "clang-{__clang_major__}.{__clang_minor__}".format(
+ **compilerMacros(cfg)
+ ),
when=_isClang,
),
Feature(
- name=lambda cfg: "clang-{__clang_major__}.{__clang_minor__}.{__clang_patchlevel__}".format(**compilerMacros(cfg)),
+ name=lambda cfg: "clang-{__clang_major__}.{__clang_minor__}.{__clang_patchlevel__}".format(
+ **compilerMacros(cfg)
+ ),
when=_isClang,
),
# Note: Due to a GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104760), we must disable deprecation warnings
@@ -274,11 +302,15 @@ def _getAndroidDeviceApi(cfg):
name=lambda cfg: "gcc-{__GNUC__}".format(**compilerMacros(cfg)), when=_isGCC
),
Feature(
- name=lambda cfg: "gcc-{__GNUC__}.{__GNUC_MINOR__}".format(**compilerMacros(cfg)),
+ name=lambda cfg: "gcc-{__GNUC__}.{__GNUC_MINOR__}".format(
+ **compilerMacros(cfg)
+ ),
when=_isGCC,
),
Feature(
- name=lambda cfg: "gcc-{__GNUC__}.{__GNUC_MINOR__}.{__GNUC_PATCHLEVEL__}".format(**compilerMacros(cfg)),
+ name=lambda cfg: "gcc-{__GNUC__}.{__GNUC_MINOR__}.{__GNUC_PATCHLEVEL__}".format(
+ **compilerMacros(cfg)
+ ),
when=_isGCC,
),
Feature(name="msvc", when=_isMSVC),
@@ -310,13 +342,14 @@ def _getAndroidDeviceApi(cfg):
"_LIBCPP_HAS_NO_WIDE_CHARACTERS": "no-wide-characters",
"_LIBCPP_HAS_NO_TIME_ZONE_DATABASE": "no-tzdb",
"_LIBCPP_HAS_NO_UNICODE": "libcpp-has-no-unicode",
- "_LIBCPP_HAS_NO_STD_MODULES": "libcpp-has-no-std-modules",
+ "_LIBCPP_HAS_NO_STD_MODULES": "libcpp-has-no-std-modules",
"_LIBCPP_PSTL_CPU_BACKEND_LIBDISPATCH": "libcpp-pstl-cpu-backend-libdispatch",
}
for macro, feature in macros.items():
DEFAULT_FEATURES.append(
Feature(
- name=lambda cfg, m=macro, f=feature: f + ("={}".format(compilerMacros(cfg)[m]) if compilerMacros(cfg)[m] else ""),
+ name=lambda cfg, m=macro, f=feature: f
+ + ("={}".format(compilerMacros(cfg)[m]) if compilerMacros(cfg)[m] else ""),
when=lambda cfg, m=macro: m in compilerMacros(cfg),
)
)
@@ -430,6 +463,7 @@ def _getAndroidDeviceApi(cfg):
),
]
+
# Detect whether GDB is on the system, has Python scripting and supports
# adding breakpoint commands. If so add a substitution to access it.
def check_gdb(cfg):
More information about the libcxx-commits
mailing list