[libcxx] r297798 - Add deployment knobs to tests (for Apple platforms)

Mehdi Amini via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 14 17:59:55 PDT 2017


Author: mehdi_amini
Date: Tue Mar 14 19:59:54 2017
New Revision: 297798

URL: http://llvm.org/viewvc/llvm-project?rev=297798&view=rev
Log:
Add deployment knobs to tests (for Apple platforms)

The tests for libc++ specify -target on the command-line to the
compiler, but this is problematic for a few reasons.

Firstly, the -target option isn't supported on Apple platforms. Parts
of the triple get dropped and ignored. Instead, software should be
compiled with a combination of the -arch and -m<name>-version-min
options.

Secondly, the generic "darwin" target references a kernel version
instead of a platform version. Each platform has its own independent
versions (with different versions of libc++.1.dylib), independent of the
version of the Darwin kernel.

This commit adds support to the LIT infrastructure for testing against
Apple platforms using -arch and -platform options.

If the host is not on OS X, or the compiler type is not clang or apple-clang, then this commit has NFC.
If the host is on OS X and --param=target_triple=... is specified, then a warning is emitted to use arch and platform instead. Besides the warning, there's NFC.
If the host is on OS X and *no* target-triple is specified, then use the new deployment target logic. This uses two new lit parameters, --param=arch=<arch> and --param=platform=<platform>. <platform> has the form <name>[<version>].
By default, arch is auto-detected from clang -dumpmachine, and platform is "macosx".
If the platform doesn't have a version:
For "macosx", the version is auto-detected from the host system using sw_vers. This may give a different version than the SDK, since new SDKs can be installed on older hosts.
Otherwise, the version is auto-detected from the SDK version using xcrun --show-sdk-path.
-arch <arch> -m<name>-version-min=<version> is added to the compiler flags.
The target triple is computed as <arch>-apple-<platform>. It is *not* passed to clang, but it is available for XFAIL and UNSUPPORTED (as is with_system_cxx_lib=<target>).
For convenience, apple-darwin and <arch>-apple-darwin are added to the set of available features.
There were a number of tests marked to XFAIL on x86_64-apple-darwin11
and x86_64-apple-darwin12. I updated these to
x86_64-apple-macosx10.7 and x86_64-apple-macosx10.8.

Modified:
    libcxx/trunk/test/std/localization/locale.categories/category.ctype/ctype_base.pass.cpp
    libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
    libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
    libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
    libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
    libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp
    libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp
    libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.category/category.pass.cpp
    libcxx/trunk/test/std/re/re.traits/translate_nocase.pass.cpp
    libcxx/trunk/test/std/strings/string.conversions/stof.pass.cpp
    libcxx/trunk/test/std/strings/string.conversions/stol.pass.cpp
    libcxx/trunk/test/std/strings/string.conversions/stoll.pass.cpp
    libcxx/trunk/test/std/strings/string.conversions/stoul.pass.cpp
    libcxx/trunk/test/std/strings/string.conversions/stoull.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.future_error/what.pass.cpp
    libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.pass.cpp
    libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.pass.cpp
    libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.pass.cpp
    libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak_explicit.pass.cpp
    libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange.pass.cpp
    libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange_explicit.pass.cpp
    libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp
    libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load_explicit.pass.cpp
    libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store.pass.cpp
    libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store_explicit.pass.cpp
    libcxx/trunk/test/std/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp
    libcxx/trunk/test/std/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp
    libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/consistency.pass.cpp
    libcxx/trunk/utils/libcxx/test/config.py
    libcxx/trunk/utils/libcxx/test/target_info.py

Modified: libcxx/trunk/test/std/localization/locale.categories/category.ctype/ctype_base.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.ctype/ctype_base.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.ctype/ctype_base.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.ctype/ctype_base.pass.cpp Tue Mar 14 19:59:54 2017
@@ -9,8 +9,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <locale>
 

Modified: libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp Tue Mar 14 19:59:54 2017
@@ -15,8 +15,8 @@
 
 // charT tolower(charT) const;
 
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 #include <locale>
 #include <cassert>

Modified: libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp Tue Mar 14 19:59:54 2017
@@ -15,8 +15,8 @@
 
 // const charT* tolower(charT* low, const charT* high) const;
 
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 #include <locale>
 #include <string>

Modified: libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp Tue Mar 14 19:59:54 2017
@@ -15,8 +15,8 @@
 
 // charT toupper(charT) const;
 
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 
 #include <locale>

Modified: libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp Tue Mar 14 19:59:54 2017
@@ -15,8 +15,8 @@
 
 // const charT* toupper(charT* low, const charT* high) const;
 
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 #include <locale>
 #include <string>

Modified: libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp Tue Mar 14 19:59:54 2017
@@ -9,8 +9,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <locale>
 

Modified: libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp Tue Mar 14 19:59:54 2017
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <locale>
 

Modified: libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.category/category.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.category/category.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.category/category.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.category/category.pass.cpp Tue Mar 14 19:59:54 2017
@@ -9,8 +9,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <locale>
 

Modified: libcxx/trunk/test/std/re/re.traits/translate_nocase.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.traits/translate_nocase.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.traits/translate_nocase.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.traits/translate_nocase.pass.cpp Tue Mar 14 19:59:54 2017
@@ -16,8 +16,8 @@
 
 // REQUIRES: locale.en_US.UTF-8
 
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // TODO: investigation needed
 // XFAIL: linux-gnu

Modified: libcxx/trunk/test/std/strings/string.conversions/stof.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/strings/string.conversions/stof.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/strings/string.conversions/stof.pass.cpp (original)
+++ libcxx/trunk/test/std/strings/string.conversions/stof.pass.cpp Tue Mar 14 19:59:54 2017
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <string>
 

Modified: libcxx/trunk/test/std/strings/string.conversions/stol.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/strings/string.conversions/stol.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/strings/string.conversions/stol.pass.cpp (original)
+++ libcxx/trunk/test/std/strings/string.conversions/stol.pass.cpp Tue Mar 14 19:59:54 2017
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <string>
 

Modified: libcxx/trunk/test/std/strings/string.conversions/stoll.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/strings/string.conversions/stoll.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/strings/string.conversions/stoll.pass.cpp (original)
+++ libcxx/trunk/test/std/strings/string.conversions/stoll.pass.cpp Tue Mar 14 19:59:54 2017
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <string>
 

Modified: libcxx/trunk/test/std/strings/string.conversions/stoul.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/strings/string.conversions/stoul.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/strings/string.conversions/stoul.pass.cpp (original)
+++ libcxx/trunk/test/std/strings/string.conversions/stoul.pass.cpp Tue Mar 14 19:59:54 2017
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <string>
 

Modified: libcxx/trunk/test/std/strings/string.conversions/stoull.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/strings/string.conversions/stoull.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/strings/string.conversions/stoull.pass.cpp (original)
+++ libcxx/trunk/test/std/strings/string.conversions/stoull.pass.cpp Tue Mar 14 19:59:54 2017
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <string>
 

Modified: libcxx/trunk/test/std/thread/futures/futures.future_error/what.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.future_error/what.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.future_error/what.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.future_error/what.pass.cpp Tue Mar 14 19:59:54 2017
@@ -12,8 +12,8 @@
 // LWG 2056 changed the values of future_errc, so if we're using new headers
 // with an old library we'll get incorrect messages.
 //
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 // XFAIL: with_system_cxx_lib=x86_64-apple-darwin13
 
 // <future>

Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.pass.cpp Tue Mar 14 19:59:54 2017
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <memory>
 

Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.pass.cpp Tue Mar 14 19:59:54 2017
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <memory>
 

Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.pass.cpp Tue Mar 14 19:59:54 2017
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <memory>
 

Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak_explicit.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak_explicit.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak_explicit.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak_explicit.pass.cpp Tue Mar 14 19:59:54 2017
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <memory>
 

Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange.pass.cpp Tue Mar 14 19:59:54 2017
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <memory>
 

Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange_explicit.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange_explicit.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange_explicit.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange_explicit.pass.cpp Tue Mar 14 19:59:54 2017
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <memory>
 

Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp Tue Mar 14 19:59:54 2017
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <memory>
 

Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load_explicit.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load_explicit.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load_explicit.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load_explicit.pass.cpp Tue Mar 14 19:59:54 2017
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <memory>
 

Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store.pass.cpp Tue Mar 14 19:59:54 2017
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <memory>
 

Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store_explicit.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store_explicit.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store_explicit.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store_explicit.pass.cpp Tue Mar 14 19:59:54 2017
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // <memory>
 

Modified: libcxx/trunk/test/std/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp Tue Mar 14 19:59:54 2017
@@ -9,8 +9,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // Due to C++17 inline variables ASAN flags this test as containing an ODR
 // violation because Clock::is_steady is defined in both the dylib and this TU.

Modified: libcxx/trunk/test/std/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp Tue Mar 14 19:59:54 2017
@@ -9,8 +9,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 // UNSUPPORTED: libcpp-has-no-monotonic-clock
 
 // Due to C++17 inline variables ASAN flags this test as containing an ODR

Modified: libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/consistency.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/consistency.pass.cpp?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/consistency.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/time/time.clock/time.clock.system/consistency.pass.cpp Tue Mar 14 19:59:54 2017
@@ -9,8 +9,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
-// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
+// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
 
 // Due to C++17 inline variables ASAN flags this test as containing an ODR
 // violation because Clock::is_steady is defined in both the dylib and this TU.

Modified: libcxx/trunk/utils/libcxx/test/config.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/utils/libcxx/test/config.py?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/utils/libcxx/test/config.py (original)
+++ libcxx/trunk/utils/libcxx/test/config.py Tue Mar 14 19:59:54 2017
@@ -117,14 +117,15 @@ class Configuration(object):
 
     def configure(self):
         self.configure_executor()
+        self.configure_use_system_cxx_lib()
         self.configure_target_info()
         self.configure_cxx()
         self.configure_triple()
+        self.configure_deployment()
         self.configure_src_root()
         self.configure_obj_root()
         self.configure_cxx_stdlib_under_test()
         self.configure_cxx_library_root()
-        self.configure_use_system_cxx_lib()
         self.configure_use_clang_verify()
         self.configure_use_thread_safety()
         self.configure_execute_external()
@@ -361,6 +362,13 @@ class Configuration(object):
         # Insert the platform name into the available features as a lower case.
         self.config.available_features.add(target_platform)
 
+        # If we're using deployment, add sub-components of the triple using
+        # "darwin" instead of the platform name.
+        if self.use_deployment:
+            arch, _, _ = self.config.deployment
+            self.config.available_features.add('apple-darwin')
+            self.config.available_features.add(arch + '-apple-darwin')
+
         # Simulator testing can take a really long time for some of these tests
         # so add a feature check so we can REQUIRES: long_tests in them
         self.long_tests = self.get_lit_bool('long_tests')
@@ -483,6 +491,10 @@ class Configuration(object):
                     ['-target', self.config.target_triple]):
                 self.lit_config.warning('use_target is true but -target is '\
                         'not supported by the compiler')
+        if self.use_deployment:
+            arch, name, version = self.config.deployment
+            self.cxx.flags += ['-arch', arch]
+            self.cxx.flags += ['-m' + name + '-version-min=' + version]
 
     def configure_compile_flags_header_includes(self):
         support_path = os.path.join(self.libcxx_src_root, 'test', 'support')
@@ -951,12 +963,34 @@ class Configuration(object):
         not_str = '%s %s ' % (pipes.quote(sys.executable), pipes.quote(not_py))
         sub.append(('not ', not_str))
 
+    def can_use_deployment(self):
+        # Check if the host is on an Apple platform using clang.
+        if not self.target_info.platform() == "darwin":
+            return False
+        if not self.target_info.is_host_macosx():
+            return False
+        if not self.cxx.type.endswith('clang'):
+            return False
+        return True
+
     def configure_triple(self):
         # Get or infer the target triple.
-        self.config.target_triple = self.get_lit_conf('target_triple')
+        target_triple = self.get_lit_conf('target_triple')
         self.use_target = self.get_lit_bool('use_target', False)
-        if self.use_target and self.config.target_triple:
+        if self.use_target and target_triple:
             self.lit_config.warning('use_target is true but no triple is specified')
+
+        # Use deployment if possible.
+        self.use_deployment = not self.use_target and self.can_use_deployment()
+        if self.use_deployment:
+            return
+
+        # Save the triple (and warn on Apple platforms).
+        self.config.target_triple = target_triple
+        if self.use_target and 'apple' in target_triple:
+            self.lit_config.warning('consider using arch and platform instead'
+                                    ' of target_triple on Apple platforms')
+
         # If no target triple was given, try to infer it from the compiler
         # under test.
         if not self.config.target_triple:
@@ -978,6 +1012,39 @@ class Configuration(object):
             self.lit_config.note(
                 "inferred target_triple as: %r" % self.config.target_triple)
 
+    def configure_deployment(self):
+        assert not self.use_deployment is None
+        assert not self.use_target is None
+        if not self.use_deployment:
+            # Warn about ignored parameters.
+            if self.get_lit_conf('arch'):
+                self.lit_config.warning('ignoring arch, using target_triple')
+            if self.get_lit_conf('platform'):
+                self.lit_config.warning('ignoring platform, using target_triple')
+            return
+
+        assert not self.use_target
+        assert self.target_info.is_host_macosx()
+
+        # Always specify deployment explicitly on Apple platforms, since
+        # otherwise a platform is picked up from the SDK.  If the SDK version
+        # doesn't match the system version, tests that use the system library
+        # may fail spuriously.
+        arch = self.get_lit_conf('arch')
+        if not arch:
+            arch = self.cxx.getTriple().split('-', 1)[0]
+            self.lit_config.note("inferred arch as: %r" % arch)
+
+        inferred_platform, name, version = self.target_info.get_platform()
+        if inferred_platform:
+            self.lit_config.note("inferred platform as: %r" % (name + version))
+        self.config.deployment = (arch, name, version)
+
+        # Set the target triple for use by lit.
+        self.config.target_triple = arch + '-apple-' + name + version
+        self.lit_config.note(
+            "computed target_triple as: %r" % self.config.target_triple)
+
     def configure_env(self):
         self.target_info.configure_env(self.exec_env)
 

Modified: libcxx/trunk/utils/libcxx/test/target_info.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/utils/libcxx/test/target_info.py?rev=297798&r1=297797&r2=297798&view=diff
==============================================================================
--- libcxx/trunk/utils/libcxx/test/target_info.py (original)
+++ libcxx/trunk/utils/libcxx/test/target_info.py Tue Mar 14 19:59:54 2017
@@ -12,6 +12,7 @@ import lit.util  # pylint: disable=impor
 import locale
 import os
 import platform
+import re
 import sys
 
 class DefaultTargetInfo(object):
@@ -70,12 +71,62 @@ class DarwinLocalTI(DefaultTargetInfo):
     def __init__(self, full_config):
         super(DarwinLocalTI, self).__init__(full_config)
 
+    def is_host_macosx(self):
+        name = lit.util.capture(['sw_vers', '-productName']).strip()
+        return name == "Mac OS X"
+
+    def get_macosx_version(self):
+        assert self.is_host_macosx()
+        version = lit.util.capture(['sw_vers', '-productVersion']).strip()
+        version = re.sub(r'([0-9]+\.[0-9]+)(\..*)?', r'\1', version)
+        return version
+
+    def get_sdk_version(self, name):
+        assert self.is_host_macosx()
+        cmd = ['xcrun', '--sdk', name, '--show-sdk-path']
+        try:
+            out = lit.util.capture(cmd).strip()
+        except OSError:
+            pass
+
+        if not out:
+            self.full_config.lit_config.fatal(
+                    "cannot infer sdk version with: %r" % cmd)
+
+        return re.sub(r'.*/[^0-9]+([0-9.]+)\.sdk', r'\1', out)
+
+    def get_platform(self):
+        platform = self.full_config.get_lit_conf('platform')
+        if platform:
+            platform = re.sub(r'([^0-9]+)([0-9\.]*)', r'\1-\2', platform)
+            name, version = tuple(platform.split('-', 1))
+        else:
+            name = 'macosx'
+            version = None
+
+        if version:
+            return (False, name, version)
+
+        # Infer the version, either from the SDK or the system itself.  For
+        # macosx, ignore the SDK version; what matters is what's at
+        # /usr/lib/libc++.dylib.
+        if name == 'macosx':
+            version = self.get_macosx_version()
+        else:
+            version = self.get_sdk_version(name)
+        return (True, name, version)
+
     def add_locale_features(self, features):
         add_common_locales(features, self.full_config.lit_config)
 
     def add_cxx_compile_flags(self, flags):
+        if self.full_config.use_deployment:
+            _, name, _ = self.full_config.config.deployment
+            cmd = ['xcrun', '--sdk', name, '--show-sdk-path']
+        else:
+            cmd = ['xcrun', '--show-sdk-path']
         try:
-            out = lit.util.capture(['xcrun', '--show-sdk-path']).strip()
+            out = lit.util.capture(cmd).strip()
             res = 0
         except OSError:
             res = -1




More information about the cfe-commits mailing list