[PATCH] D17469: [libcxx] Add deployment knobs to tests (for Apple platforms)

Duncan P. N. Exon Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 19 17:59:34 PST 2016


dexonsmith created this revision.
dexonsmith added reviewers: EricWF, mclow.lists.
dexonsmith added a subscriber: cfe-commits.

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`.


http://reviews.llvm.org/D17469

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17469.48565.patch
Type: text/x-patch
Size: 26808 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160220/9800d5a2/attachment-0001.bin>


More information about the cfe-commits mailing list