Commit Graph

169 Commits

Author SHA1 Message Date
Eric Fiselier 9d75d88d30 Handle TLS values in sym_check
llvm-svn: 357705
2019-04-04 15:37:10 +00:00
Louis Dionne daf43ed800 [libc++] Add proper XFAILs for shared_mutex tests
Dylib support for shared_mutex was added in macOS 10.12, so the tests
should be XFAILed accordingly instead of being completely disabled
whenever availability is enabled.

rdar://problem/48769104

llvm-svn: 357079
2019-03-27 15:50:34 +00:00
Louis Dionne 976073794e [libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms
Summary:
I can't see a good reason to disallow this, even though it isn't the
standard way we build libc++ for Apple platforms.

Making this work on Apple platforms requires using different flags for
--whole-archive and removing the -D flag when running `ar` to merge
archives because that flag isn't supported by the `ar` shipped on Apple
platforms. This shouldn't be an issue since the -D option appears to be
enabled by default in GNU `ar`.

Reviewers: phosek, EricWF, serge-sans-paille

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59513

llvm-svn: 356903
2019-03-25 14:56:29 +00:00
Eric Fiselier c9f4cbf7a6 Add dylib-has-no-filesystem when filesystem is disabled
llvm-svn: 356640
2019-03-21 02:13:30 +00:00
Eric Fiselier f1d87f8b4c Allow disabling of filesystem library.
Summary: Filesystem doesn't work on Windows, so we need a mechanism to turn it off for the time being.

Reviewers: ldionne, serge-sans-paille, EricWF

Reviewed By: EricWF

Subscribers: mstorsjo, mgorny, christof, jdoerfert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59619

llvm-svn: 356633
2019-03-21 00:04:31 +00:00
Louis Dionne 6f3b566c87 [libc++] Use the compiler that CMake found when running lit for back-deployment tests
llvm-svn: 356595
2019-03-20 19:12:27 +00:00
Louis Dionne e526a6bd55 [libc++] Do not force going through xcrun to find Clang in the macOS CI scripts
It should be possible to run those CI scripts with different compilers
by simply exporting a different CXX environment variable.

llvm-svn: 356562
2019-03-20 15:40:56 +00:00
Louis Dionne b38c08ac02 [libc++] Mark <filesystem> tests as failing when the dylib doesn't support filesystem
This fixes CI for back-deployment testers on platforms that don't have
<filesystem> support in the dylib.

This is effectively half of https://reviews.llvm.org/D59224. The other
half requires fixes in Clang.

llvm-svn: 356558
2019-03-20 14:34:00 +00:00
Louis Dionne cc37af7a36 [libc++] Build <filesystem> support as part of the dylib
Summary:
This patch treats <filesystem> as a first-class citizen of the dylib,
like all other sub-libraries (e.g. <chrono>). As such, it also removes
all special handling for installing the filesystem library separately
or disabling part of the test suite from the lit command line.

Unlike the previous attempt (r356500), this doesn't remove all the
filesystem tests.

Reviewers: mclow.lists, EricWF, serge-sans-paille

Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59152

llvm-svn: 356518
2019-03-19 20:56:13 +00:00
Louis Dionne f7b43230b8 Revert "[libc++] Build <filesystem> support as part of the dylib"
When I applied r356500 (https://reviews.llvm.org/D59152), I somehow
deleted all of filesystem's tests. I will revert r356500 and re-apply
it properly.

llvm-svn: 356505
2019-03-19 19:27:29 +00:00
Louis Dionne 72122d058b [libc++] Build <filesystem> support as part of the dylib
Summary:
This patch treats <filesystem> as a first-class citizen of the dylib,
like all other sub-libraries (e.g. <chrono>). As such, it also removes
all special handling for installing the filesystem library separately
or disabling part of the test suite from the lit command line.

Reviewers: mclow.lists, EricWF, serge-sans-paille

Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59152

llvm-svn: 356500
2019-03-19 19:09:33 +00:00
Louis Dionne bbdddb7b0e [libc++] Only add dylib-related features when using the system's libc++
Otherwise, when testing trunk libc++ on an older system, lit will think
that the dylib features are disabled. Ideally, we'd have a notion of
running the tests with/without a deployment target (or, equivalently,
a deployment target representing trunk where everything is as recent
as can be). Since we always have a deployment target right now (which
defaults to the current system), we only enable those features when
we're going to also be testing with the system libc++.

We also need to disable the availability markup when we are not running
a system library flavor, because availability markup does not make sense
when building against the trunk libc++ (which has everything regardless
of what the current system is).

This is a re-application of r353319, which had been reverted due to
CI breakage. This time around, I made sure it didn't break our internal
CI before submitting.

This is also a partial undoing of r348296, in spirit at least. However,
with this patch, availability markup is enabled based on whether we're
using a system library or not, whereas previously one could enable
it or disable it arbitrarily. This was confusing as it led to testing
configurations that don't make sense (such as testing a system library
without availability markup, or trunk testing with availability markup).

llvm-svn: 355451
2019-03-05 22:42:45 +00:00
Eric Fiselier 1c014d75b4 Fix -fsanitize=vptr badness in <__debug>
Summary:

This patch fixes a lifetime bug when inserting a new container into the debug database. It is
diagnosed by UBSAN when debug mode is enabled. This patch corrects how nodes are constructed
during insertion.

The fix requires unconditionally breaking the debug mode ABI. Users should not expect ABI
stability from debug mode.

Reviewers: ldionne, serge-sans-paille, EricWF

Reviewed By: EricWF

Subscribers: mclow.lists, christof, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D58011

llvm-svn: 355367
2019-03-05 02:10:31 +00:00
Eric Fiselier 8b73ab29c3 Install GCC 5 on buildbots to replace GCC 4.9.
LLVM is dropping support for GCC 4.9. This patch adds
a GCC 5 installation to the buildbot image so we can upgrade
the 4.9 bot to GCC 5.

As a temporary workaround until zorg updates, we install GCC 5
as GCC 4.9.

llvm-svn: 355334
2019-03-04 20:49:18 +00:00
Louis Dionne 4fcdf21406 [NFC][libc++] Update comment about oldest supported macosx for back-deployment
llvm-svn: 355043
2019-02-27 23:36:22 +00:00
Eric Fiselier 1eb19e5277 Make the sym_diff utilities more useful.
In particular when working with static libraries and libstdc++.

llvm-svn: 353772
2019-02-12 00:00:43 +00:00
Petr Hosek 1405ac457b [libcxx] Preserve order, avoid duplicates when merging static archives
glob can return files in arbitrary order which breaks deterministic
builds. Rather, use `ar t` to list the files in each archive and
preserve the original order. Using `ar q` results in duplicate entries
in the archive, instead use `ar r` to avoid duplicates.

Differential Revision: https://reviews.llvm.org/D58024

llvm-svn: 353671
2019-02-11 08:48:47 +00:00
Chandler Carruth 9d610c5a53 The new file header didn't get carried over when these files were
"moved" somehow, update them to use it.

llvm-svn: 353669
2019-02-11 08:39:23 +00:00
Eric Fiselier 609d676aab Format sym_extract.py output to minimize diff output.
Different versions of python print dictionaries in different orders.
 This can mess up diffs when updating ABI lists. This patch uses
 pprint.pformat to print the dicts to get a consistent ordering.

llvm-svn: 353634
2019-02-10 04:48:54 +00:00
Petr Hosek b34fed1a2e [libcxx] Support runtimes and monorepo locations for tests
The test configuration support currently searches for libc++ sources
in <ROOT>/projects/libcxx. This change also additionally searches
<ROOT>/runtimes/libcxx (so called runtimes layout) and <ROOT>/libcxx
(monorepo layout).

This matches the logic we already use in CMake, for example:
https://github.com/llvm/llvm-project/blob/6fd4e7f/libcxx/CMakeLists.txt#L148

When the monorepo becomes the only supported layout in the future,
we can simplify this logic again.

Differential Revision: https://reviews.llvm.org/D57776

llvm-svn: 353600
2019-02-09 02:50:09 +00:00
Louis Dionne feeedafd28 Revert "[libc++] Only add dylib-related features when using the system's libc++"
This reverts r353319, which broke our internal CI.

llvm-svn: 353321
2019-02-06 18:33:02 +00:00
Louis Dionne 6f6beae627 [libc++] Only add dylib-related features when using the system's libc++
Otherwise, when testing trunk libc++ on an older system, lit will think
that the dylib features are disabled. Ideally, we'd have a notion of
running the tests with/without a deployment target (or, equivalently,
a deployment target representing trunk where everything is as recent
as can be). Since we always have a deployment target right now (which
defaults to the current system), we only enable those features when
we're going to also be testing with the system libc++.

llvm-svn: 353319
2019-02-06 18:06:50 +00:00
Petr Hosek 97bc08ae02 [CMake] Support compiler-rt builtins library in tests
We're building tests with -nostdlib which means that we need to
explicitly include the builtins library. When using libgcc (default)
we can simply include -lgcc_s on the link line, but when using
compiler-rt builtins we need a complete path to the builtins library.

This path is already available in CMake as <PROJECT>_BUILTINS_LIBRARY,
so we just need to pass that path to lit and if config.compiler_rt is
true, link it to the test.

Prior to this patch, running tests when compiler-rt is being used as
the builtins library was broken as all tests would fail to link, but
with this change running tests when compiler-rt bultins library is
being used should be supported.

Differential Revision: https://reviews.llvm.org/D56701

llvm-svn: 353208
2019-02-05 19:50:47 +00:00
Louis Dionne 51358e45e2 [libcxx] Start defining lit features for tests depending on availability
This patch removes some vendor-specific availability XFAILs from the
test suite. In the future, when a new feature is introduced in the
dylib, an availability macro should be created and a matching lit
feature should be created. That way, the test suite can XFAIL whenever
the implementation lacks the necessary feature instead of being
cluttered by vendor-specific annotations.

Right now, those vendor-specific annotations are still somewhat cluttering
the test suite by being in `config.py`, but at least they are localized.
In the future, we could design a way to define those less intrusively or
even automatically based on the availability macros that already exist
in <__config>.

llvm-svn: 353201
2019-02-05 19:22:38 +00:00
Louis Dionne a3ec627a1c [libc++] Control whether exceptions are enabled in the macOS trunk testing script
llvm-svn: 353185
2019-02-05 16:42:37 +00:00
JF Bastien 73f499771f Fix double curlies
Pointed out by Arthur in D57624.

llvm-svn: 353140
2019-02-05 05:34:12 +00:00
Petr Hosek 3ad50fed48 [CMake] Update lit test configuration
There are several changes:
- Don't stringify Pythonized bools (that's why we're Pythonizing them)
- Support specifying target and sysroot via CMake variables
- Use consistent spelling for --target, --sysroot, --gcc-toolchain

llvm-svn: 353137
2019-02-05 04:44:03 +00:00
JF Bastien 2df59c5068 Support tests in freestanding
Summary:
Freestanding is *weird*. The standard allows it to differ in a bunch of odd
manners from regular C++, and the committee would like to improve that
situation. I'd like to make libc++ behave better with what freestanding should
be, so that it can be a tool we use in improving the standard. To do that we
need to try stuff out, both with "freestanding the language mode" and
"freestanding the library subset".

Let's start with the super basic: run the libc++ tests in freestanding, using
clang as the compiler, and see what works. The easiest hack to do this:

In utils/libcxx/test/config.py add:

  self.cxx.compile_flags += ['-ffreestanding']

Run the tests and they all fail.

Why? Because in freestanding `main` isn't special. This "not special" property
has two effects: main doesn't get mangled, and main isn't allowed to omit its
`return` statement. The first means main gets mangled and the linker can't
create a valid executable for us to test. The second means we spew out warnings
(ew) and the compiler doesn't insert the `return` we omitted, and main just
falls of the end and does whatever undefined behavior (if you're luck, ud2
leading to non-zero return code).

Let's start my work with the basics. This patch changes all libc++ tests to
declare `main` as `int main(int, char**` so it mangles consistently (enabling us
to declare another `extern "C"` main for freestanding which calls the mangled
one), and adds `return 0;` to all places where it was missing. This touches 6124
files, and I apologize.

The former was done with The Magic Of Sed.

The later was done with a (not quite correct but decent) clang tool:

  https://gist.github.com/jfbastien/793819ff360baa845483dde81170feed

This works for most tests, though I did have to adjust a few places when e.g.
the test runs with `-x c`, macros are used for main (such as for the filesystem
tests), etc.

Once this is in we can create a freestanding bot which will prevent further
regressions. After that, we can start the real work of supporting C++
freestanding fairly well in libc++.

<rdar://problem/47754795>

Reviewers: ldionne, mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, arphaman, miyuki, libcxx-commits

Differential Revision: https://reviews.llvm.org/D57624

llvm-svn: 353086
2019-02-04 20:31:13 +00:00
Eric Fiselier 508da4156a Move the feature test macros script to the utils directory.
It doesn't make a lot of sense to keep it with the tests,
deep into the test suite directonies.

llvm-svn: 352970
2019-02-02 23:13:49 +00:00
Eric Fiselier b0f1013a73 Improve docker images and configuration; create compiler-zoo image
llvm-svn: 351667
2019-01-19 23:36:06 +00:00
Chandler Carruth 57b08b0944 Update more file headers across all of the LLVM projects in the monorepo
to reflect the new license. These used slightly different spellings that
defeated my regular expressions.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351648
2019-01-19 10:56:40 +00:00
Eric Fiselier 8c0332204d Fix all the bots.
The buildbot start scripts hardcode the version string.
Bump it from 8 to 9.

llvm-svn: 351638
2019-01-19 09:07:04 +00:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Louis Dionne 227371ded6 [libcxx] Add a script to run CI on older MacOS versions
This script can be used by CI systems to test things like availability
markup and binary compatibility on older MacOS versions. This is still
a bit rough on the edges, for example we don't test libc++abi yet.

llvm-svn: 350752
2019-01-09 19:40:20 +00:00
Louis Dionne cb4e59ed92 [libcxx] Add a script to run CI on MacOS
CI systems like Green Dragon should use this script so as to make
reproducing errors easy locally.

llvm-svn: 350740
2019-01-09 16:35:55 +00:00
Kamil Rytarowski 74b936ec98 Revert "D56064: More tolerance for flaky tests in libc++ on NetBSD"
Requested by EricWF.

llvm-svn: 350477
2019-01-05 20:11:54 +00:00
Kamil Rytarowski 2803bcf5b0 More tolerance for flaky tests in libc++ on NetBSD
Summary:
Tests marked with the flaky attribute ("FLAKY_TEST.")
can still report false positives in local tests and on the
NetBSD buildbot.

Additionally a number of tests (probably all threaded
ones) unmarked with the flaky attribute is flaky on
NetBSD.

An ideal solution on the libcxx side would be to raise
max retries for NetBSD and mark failing tests with
the flaky flag, however this adds more maintenance
burden and constant monitoring of flaky tests.

Reduce the work and handle flaky tests as more flaky
on NetBSD and allow flakiness  of other tests on
NetBSD.

Reviewers: mgorny, EricWF

Reviewed By: mgorny

Subscribers: christof, llvm-commits, libcxx-commits

Differential Revision: https://reviews.llvm.org/D56064

llvm-svn: 350170
2018-12-30 23:05:14 +00:00
Michal Gorny c32d47c6a8 [test] Add target_info for NetBSD, and XFAIL some of locale tests
Add a target_info definition for NetBSD.  The definition is based
on the one used by FreeBSD, with libcxxrt replaced by libc++abi,
and using llvm-libunwind since we need to use its unwinder
implementation to build anyway.

Additionally, XFAIL the 30 tests that fail because of non-implemented
locale features.  According to the manual, NetBSD implements only
LC_CTYPE part of locale handling.  However, there is a locale database
in the system and locale specifications are validated against it,
so it makes sense to list the common locales as supported.

If I'm counting correctly, this change enables additional 43 passing
tests.

Differential Revision: https://reviews.llvm.org/D55767

llvm-svn: 349379
2018-12-17 19:14:08 +00:00
Eric Fiselier f707738557 Try 2: Fix bug in buildbot start script
llvm-svn: 349236
2018-12-15 03:48:08 +00:00
Eric Fiselier 6d7331c172 Fix bug in buildbot start script
llvm-svn: 349235
2018-12-15 03:45:21 +00:00
Eric Fiselier 4e903a3a7d Rework docker setup to make it easier to work around bugs on buildbots
llvm-svn: 349234
2018-12-15 03:24:33 +00:00
Louis Dionne bc297b1da9 [libcxx] Make sure use_system_cxx_lib does not override cxx_runtime_root for DYLD_LIBRARY_PATH
Otherwise, even specifying a runtime root different from the library
we're linking against won't work -- the library we're linking against
is always used. This is undesirable if we try testing something like
linking against a recent libc++.dylib but running the tests against an
older version (the back-deployment use case).

llvm-svn: 349171
2018-12-14 18:19:14 +00:00
Eric Fiselier 814715f958 Update google benchmark again
llvm-svn: 349127
2018-12-14 03:48:09 +00:00
Eric Fiselier 7a91ac4753 Update google benchmark version
llvm-svn: 349126
2018-12-14 03:37:13 +00:00
Louis Dionne 471b8b73c9 [libcxx] Only enable the availability LIT feature when we're testing libc++
Other standard libraries don't implement availability markup, so it doesn't
make sense to e.g. XFAIL tests based on availability markup outside of
libc++.

llvm-svn: 348871
2018-12-11 18:05:38 +00:00
Louis Dionne 2112fbcc00 [libcxx] Remove the no_default_flags LIT configuration
This is part of an ongoing cleanup of the LIT test suite, where I'm
trying to reduce the number of configuration options. In this case,
the original intent seemed to be running the test suite with libstdc++,
but this is now supported by specifying cxx_stdlib_under_test=libstdc++.

llvm-svn: 348868
2018-12-11 17:29:55 +00:00
Louis Dionne edc36c0731 [NFC] Fix incorrect (but unreachable) LIT error message
It is unreachable because we test that the cxx_stdlib_under_test is
in the supported set of libraries elsewhere. Furthermore, this code
relied on the `use_stdlib_type`, which is never defined.

llvm-svn: 348867
2018-12-11 17:05:20 +00:00
Louis Dionne 737be83d20 [libcxx] Remove the availability_markup LIT feature
It is now equivalent to the 'availability' LIT feature, so there's no
reason to keep both.

llvm-svn: 348653
2018-12-07 21:48:39 +00:00
Louis Dionne 73b9849145 [libcxx] Always convert 'use_system_cxx_lib' to an absolute path
Otherwise, some tests would fail when a relative path was passed,
because they'd use the relative path from a different directory
than the current working directory.

llvm-svn: 348525
2018-12-06 20:09:15 +00:00
Louis Dionne f14927e98e [libcxx] Always enable availability in the lit test suite.
Summary:
Running the tests without availability enabled doesn't really make sense:
availability annotations allow catching errors at compile-time instead
of link-time. Running the tests without availability enabled allows
confirming that a test breaks at link-time under some configuration,
but it is more useful to instead check that it should fail at compile-time.

Always enabling availability in the lit test suite will greatly simplify
XFAILs and troubleshooting of failing tests, which is currently a giant
pain because we have these two levels of possible failure: link-time and
compile-time.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Differential Revision: https://reviews.llvm.org/D55079

llvm-svn: 348296
2018-12-04 19:31:08 +00:00