Skip to content

Commit

Permalink
[libc++] Move handling of the target triple to the DSL
Browse files Browse the repository at this point in the history
This fixes a long standing issue where the triple is not always set
consistently in all configurations. This change also moves the
back-deployment Lit features to using the proper target triple
instead of using something ad-hoc.

This will be necessary for using from scratch Lit configuration files
in both normal testing and back-deployment testing.

Differential Revision: https://reviews.llvm.org/D102012
  • Loading branch information
ldionne committed May 8, 2021
1 parent 9610a2d commit 74d096e
Show file tree
Hide file tree
Showing 242 changed files with 1,247 additions and 1,262 deletions.
2 changes: 1 addition & 1 deletion libcxx/docs/TestingLibcxx.rst
Expand Up @@ -153,7 +153,7 @@ default.
**Default**: False

Enable or disable testing against the installed version of libc++ library.
This impacts whether the ``with_system_cxx_lib`` Lit feature is defined or
This impacts whether the ``use_system_cxx_lib`` Lit feature is defined or
not. The ``cxx_library_root`` and ``cxx_runtime_root`` parameters should
still be used to specify the path of the library to link to and run against,
respectively.
Expand Down
3 changes: 2 additions & 1 deletion libcxx/test/configs/legacy.cfg.in
Expand Up @@ -21,7 +21,8 @@ config.use_sanitizer = "@LLVM_USE_SANITIZER@"
config.sanitizer_library = "@LIBCXX_SANITIZER_LIBRARY@"
config.configuration_variant = "@LIBCXX_LIT_VARIANT@"
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
if "@TARGET_TRIPLE@":
config.target_triple = "@TARGET_TRIPLE@"
config.sysroot = "@LIBCXX_SYSROOT@"
config.gcc_toolchain = "@LIBCXX_GCC_TOOLCHAIN@"
config.generate_coverage = @LIBCXX_GENERATE_COVERAGE@
Expand Down
12 changes: 6 additions & 6 deletions libcxx/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp
Expand Up @@ -11,12 +11,12 @@
// Test exporting the symbol: "__cxa_deleted_virtual" in macosx
// But don't expect the symbol to be exported in previous versions.
//
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
// XFAIL: with_system_cxx_lib=macosx10.12
// XFAIL: with_system_cxx_lib=macosx10.11
// XFAIL: with_system_cxx_lib=macosx10.10
// XFAIL: with_system_cxx_lib=macosx10.9
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.12
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.11
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.10
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.9

struct S { virtual void f() = delete; virtual ~S() {} };
int main(int, char**) {
Expand Down
Expand Up @@ -16,11 +16,11 @@
// UNSUPPORTED: apple-clang-9, apple-clang-10
// UNSUPPORTED: clang-5, clang-6, clang-7

// REQUIRES: with_system_cxx_lib=macosx10.13 || \
// REQUIRES: with_system_cxx_lib=macosx10.12 || \
// REQUIRES: with_system_cxx_lib=macosx10.11 || \
// REQUIRES: with_system_cxx_lib=macosx10.10 || \
// REQUIRES: with_system_cxx_lib=macosx10.9
// REQUIRES: use_system_cxx_lib && (x86_64-apple-macosx10.13 || \
// REQUIRES: x86_64-apple-macosx10.12 || \
// REQUIRES: x86_64-apple-macosx10.11 || \
// REQUIRES: x86_64-apple-macosx10.10 || \
// REQUIRES: x86_64-apple-macosx10.9)

#include <new>
#include <cstddef>
Expand Down
Expand Up @@ -16,10 +16,10 @@
// The dylibs shipped before macosx10.13 do not contain the aligned allocation
// functions, so trying to force using those with -faligned-allocation results
// in a link error.
// XFAIL: with_system_cxx_lib=macosx10.12
// XFAIL: with_system_cxx_lib=macosx10.11
// XFAIL: with_system_cxx_lib=macosx10.10
// XFAIL: with_system_cxx_lib=macosx10.9
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.12
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.11
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.10
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.9

// AppleClang < 10 incorrectly warns that aligned allocation is not supported
// even when it is supported.
Expand Down
Expand Up @@ -16,10 +16,10 @@
// The dylibs shipped before macosx10.13 do not contain the aligned allocation
// functions, so trying to force using those with -faligned-allocation results
// in a link error.
// XFAIL: with_system_cxx_lib=macosx10.12
// XFAIL: with_system_cxx_lib=macosx10.11
// XFAIL: with_system_cxx_lib=macosx10.10
// XFAIL: with_system_cxx_lib=macosx10.9
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.12
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.11
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.10
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.9

// REQUIRES: -faligned-allocation
// ADDITIONAL_COMPILE_FLAGS: -faligned-allocation
Expand Down
Expand Up @@ -15,11 +15,11 @@
// GCC 5 doesn't support aligned allocation
// UNSUPPORTED: gcc-5

// XFAIL: with_system_cxx_lib=macosx10.13
// XFAIL: with_system_cxx_lib=macosx10.12
// XFAIL: with_system_cxx_lib=macosx10.11
// XFAIL: with_system_cxx_lib=macosx10.10
// XFAIL: with_system_cxx_lib=macosx10.9
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.12
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.11
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.10
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.9

#include <new>

Expand Down
4 changes: 4 additions & 0 deletions libcxx/test/libcxx/selftest/dsl/dsl.sh.py
Expand Up @@ -342,6 +342,10 @@ def test_empty_name_should_blow_up(self):
def test_empty_choices_should_blow_up(self):
self.assertRaises(ValueError, lambda: dsl.Parameter(name='std', choices=[], type=str, help='', actions=lambda _: []))

def test_no_choices_is_ok(self):
param = dsl.Parameter(name='triple', type=str, help='', actions=lambda _: [])
self.assertEqual(param.name, 'triple')

def test_name_is_set_correctly(self):
param = dsl.Parameter(name='std', choices=['c++03'], type=str, help='', actions=lambda _: [])
self.assertEqual(param.name, 'std')
Expand Down
15 changes: 8 additions & 7 deletions libcxx/test/libcxx/thread/atomic.availability.verify.cpp
Expand Up @@ -7,13 +7,14 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11
// REQUIRES: with_system_cxx_lib=macosx10.9 || \
// REQUIRES: with_system_cxx_lib=macosx10.10 || \
// REQUIRES: with_system_cxx_lib=macosx10.11 || \
// REQUIRES: with_system_cxx_lib=macosx10.12 || \
// REQUIRES: with_system_cxx_lib=macosx10.13 || \
// REQUIRES: with_system_cxx_lib=macosx10.14 || \
// REQUIRES: with_system_cxx_lib=macosx10.15
// REQUIRES: use_system_cxx_lib && (x86_64-apple-macosx10.9 || \
// REQUIRES: x86_64-apple-macosx10.10 || \
// REQUIRES: x86_64-apple-macosx10.11 || \
// REQUIRES: x86_64-apple-macosx10.12 || \
// REQUIRES: x86_64-apple-macosx10.13 || \
// REQUIRES: x86_64-apple-macosx10.14 || \
// REQUIRES: x86_64-apple-macosx10.15)


// Test the availability markup on the C++20 Synchronization Library
// additions to <atomic>.
Expand Down
15 changes: 8 additions & 7 deletions libcxx/test/libcxx/thread/barrier.availability.verify.cpp
Expand Up @@ -7,13 +7,14 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11
// REQUIRES: with_system_cxx_lib=macosx10.9 || \
// REQUIRES: with_system_cxx_lib=macosx10.10 || \
// REQUIRES: with_system_cxx_lib=macosx10.11 || \
// REQUIRES: with_system_cxx_lib=macosx10.12 || \
// REQUIRES: with_system_cxx_lib=macosx10.13 || \
// REQUIRES: with_system_cxx_lib=macosx10.14 || \
// REQUIRES: with_system_cxx_lib=macosx10.15
// REQUIRES: use_system_cxx_lib && (x86_64-apple-macosx10.9 || \
// REQUIRES: x86_64-apple-macosx10.10 || \
// REQUIRES: x86_64-apple-macosx10.11 || \
// REQUIRES: x86_64-apple-macosx10.12 || \
// REQUIRES: x86_64-apple-macosx10.13 || \
// REQUIRES: x86_64-apple-macosx10.14 || \
// REQUIRES: x86_64-apple-macosx10.15)


// Test the availability markup on std::barrier.

Expand Down
15 changes: 8 additions & 7 deletions libcxx/test/libcxx/thread/latch.availability.verify.cpp
Expand Up @@ -7,13 +7,14 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11
// REQUIRES: with_system_cxx_lib=macosx10.9 || \
// REQUIRES: with_system_cxx_lib=macosx10.10 || \
// REQUIRES: with_system_cxx_lib=macosx10.11 || \
// REQUIRES: with_system_cxx_lib=macosx10.12 || \
// REQUIRES: with_system_cxx_lib=macosx10.13 || \
// REQUIRES: with_system_cxx_lib=macosx10.14 || \
// REQUIRES: with_system_cxx_lib=macosx10.15
// REQUIRES: use_system_cxx_lib && (x86_64-apple-macosx10.9 || \
// REQUIRES: x86_64-apple-macosx10.10 || \
// REQUIRES: x86_64-apple-macosx10.11 || \
// REQUIRES: x86_64-apple-macosx10.12 || \
// REQUIRES: x86_64-apple-macosx10.13 || \
// REQUIRES: x86_64-apple-macosx10.14 || \
// REQUIRES: x86_64-apple-macosx10.15)


// Test the availability markup on std::latch.

Expand Down
15 changes: 8 additions & 7 deletions libcxx/test/libcxx/thread/semaphore.availability.verify.cpp
Expand Up @@ -7,13 +7,14 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11
// REQUIRES: with_system_cxx_lib=macosx10.9 || \
// REQUIRES: with_system_cxx_lib=macosx10.10 || \
// REQUIRES: with_system_cxx_lib=macosx10.11 || \
// REQUIRES: with_system_cxx_lib=macosx10.12 || \
// REQUIRES: with_system_cxx_lib=macosx10.13 || \
// REQUIRES: with_system_cxx_lib=macosx10.14 || \
// REQUIRES: with_system_cxx_lib=macosx10.15
// REQUIRES: use_system_cxx_lib && (x86_64-apple-macosx10.9 || \
// REQUIRES: x86_64-apple-macosx10.10 || \
// REQUIRES: x86_64-apple-macosx10.11 || \
// REQUIRES: x86_64-apple-macosx10.12 || \
// REQUIRES: x86_64-apple-macosx10.13 || \
// REQUIRES: x86_64-apple-macosx10.14 || \
// REQUIRES: x86_64-apple-macosx10.15)


// Test the availability markup on std::counting_semaphore and std::binary_semaphore.

Expand Down
Expand Up @@ -14,10 +14,10 @@
// UNSUPPORTED: c++03

// PR30202 was fixed starting in macosx10.13.
// UNSUPPORTED: with_system_cxx_lib=macosx10.12
// UNSUPPORTED: with_system_cxx_lib=macosx10.11
// UNSUPPORTED: with_system_cxx_lib=macosx10.10
// UNSUPPORTED: with_system_cxx_lib=macosx10.9
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.12
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.11
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.10
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.9

// <condition_variable>

Expand Down
Expand Up @@ -11,9 +11,9 @@
// Until 58a0a70fb2f1, this_thread::sleep_for could sometimes get interrupted
// by signals and this test would fail spuriously. Disable the test on the
// corresponding system libraries.
// UNSUPPORTED: with_system_cxx_lib=macosx10.11
// UNSUPPORTED: with_system_cxx_lib=macosx10.10
// UNSUPPORTED: with_system_cxx_lib=macosx10.9
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.11
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.10
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.9

// <thread>

Expand Down
Expand Up @@ -14,9 +14,9 @@
// Until 58a0a70fb2f1, this_thread::sleep_for misbehaves when interrupted by
// a signal, as tested here. Disable the test on the corresponding system
// libraries.
// XFAIL: with_system_cxx_lib=macosx10.11
// XFAIL: with_system_cxx_lib=macosx10.10
// XFAIL: with_system_cxx_lib=macosx10.9
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.11
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.10
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.9

// <thread>

Expand Down
Expand Up @@ -7,12 +7,12 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03
// REQUIRES: with_system_cxx_lib=macosx10.9 || \
// REQUIRES: with_system_cxx_lib=macosx10.10 || \
// REQUIRES: with_system_cxx_lib=macosx10.11 || \
// REQUIRES: with_system_cxx_lib=macosx10.12 || \
// REQUIRES: with_system_cxx_lib=macosx10.13 || \
// REQUIRES: with_system_cxx_lib=macosx10.14
// REQUIRES: use_system_cxx_lib && (x86_64-apple-macosx10.9 || \
// REQUIRES: x86_64-apple-macosx10.10 || \
// REQUIRES: x86_64-apple-macosx10.11 || \
// REQUIRES: x86_64-apple-macosx10.12 || \
// REQUIRES: x86_64-apple-macosx10.13 || \
// REQUIRES: x86_64-apple-macosx10.14)

// Test the availability markup on std::to_chars.

Expand Down
Expand Up @@ -12,14 +12,14 @@

// This test requires the dylib support introduced in D68480,
// which hasn't shipped yet.
// XFAIL: with_system_cxx_lib=macosx
// XFAIL: with_system_cxx_lib=macosx10.15
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
// XFAIL: with_system_cxx_lib=macosx10.12
// XFAIL: with_system_cxx_lib=macosx10.11
// XFAIL: with_system_cxx_lib=macosx10.10
// XFAIL: with_system_cxx_lib=macosx10.9
// XFAIL: use_system_cxx_lib && x86_64-apple
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.15
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.12
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.11
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.10
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.9

// <atomic>

Expand Down
Expand Up @@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//

// XFAIL: suse-linux-enterprise-server-11
// XFAIL: with_system_cxx_lib=macosx10.12
// XFAIL: with_system_cxx_lib=macosx10.11
// XFAIL: with_system_cxx_lib=macosx10.10
// XFAIL: with_system_cxx_lib=macosx10.9
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.12
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.11
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.10
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.9

// <system_error>

Expand Down
Expand Up @@ -13,10 +13,10 @@
// const error_category& system_category();

// XFAIL: suse-linux-enterprise-server-11
// XFAIL: with_system_cxx_lib=macosx10.12
// XFAIL: with_system_cxx_lib=macosx10.11
// XFAIL: with_system_cxx_lib=macosx10.10
// XFAIL: with_system_cxx_lib=macosx10.9
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.12
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.11
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.10
// XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.9

#include <system_error>
#include <cassert>
Expand Down
Expand Up @@ -10,12 +10,12 @@
// UNSUPPORTED: libcpp-has-no-filesystem-library

// Filesystem is supported on Apple platforms starting with macosx10.15.
// UNSUPPORTED: with_system_cxx_lib=macosx10.14
// UNSUPPORTED: with_system_cxx_lib=macosx10.13
// UNSUPPORTED: with_system_cxx_lib=macosx10.12
// UNSUPPORTED: with_system_cxx_lib=macosx10.11
// UNSUPPORTED: with_system_cxx_lib=macosx10.10
// UNSUPPORTED: with_system_cxx_lib=macosx10.9
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.14
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.13
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.12
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.11
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.10
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.9

// <fstream>

Expand Down
Expand Up @@ -10,12 +10,12 @@
// UNSUPPORTED: libcpp-has-no-filesystem-library

// Filesystem is supported on Apple platforms starting with macosx10.15.
// UNSUPPORTED: with_system_cxx_lib=macosx10.14
// UNSUPPORTED: with_system_cxx_lib=macosx10.13
// UNSUPPORTED: with_system_cxx_lib=macosx10.12
// UNSUPPORTED: with_system_cxx_lib=macosx10.11
// UNSUPPORTED: with_system_cxx_lib=macosx10.10
// UNSUPPORTED: with_system_cxx_lib=macosx10.9
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.14
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.13
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.12
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.11
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.10
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.9

// <fstream>

Expand Down
Expand Up @@ -10,12 +10,12 @@
// UNSUPPORTED: libcpp-has-no-filesystem-library

// Filesystem is supported on Apple platforms starting with macosx10.15.
// UNSUPPORTED: with_system_cxx_lib=macosx10.14
// UNSUPPORTED: with_system_cxx_lib=macosx10.13
// UNSUPPORTED: with_system_cxx_lib=macosx10.12
// UNSUPPORTED: with_system_cxx_lib=macosx10.11
// UNSUPPORTED: with_system_cxx_lib=macosx10.10
// UNSUPPORTED: with_system_cxx_lib=macosx10.9
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.14
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.13
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.12
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.11
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.10
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.9

// <fstream>

Expand Down
Expand Up @@ -10,12 +10,12 @@
// UNSUPPORTED: libcpp-has-no-filesystem-library

// Filesystem is supported on Apple platforms starting with macosx10.15.
// UNSUPPORTED: with_system_cxx_lib=macosx10.14
// UNSUPPORTED: with_system_cxx_lib=macosx10.13
// UNSUPPORTED: with_system_cxx_lib=macosx10.12
// UNSUPPORTED: with_system_cxx_lib=macosx10.11
// UNSUPPORTED: with_system_cxx_lib=macosx10.10
// UNSUPPORTED: with_system_cxx_lib=macosx10.9
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.14
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.13
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.12
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.11
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.10
// UNSUPPORTED: use_system_cxx_lib && x86_64-apple-macosx10.9

// FILE_DEPENDENCIES: test.dat

Expand Down

0 comments on commit 74d096e

Please sign in to comment.