Commit Graph

146 Commits

Author SHA1 Message Date
Billy Robert O'Neal III ed2f9a6094 [libcxx] [test] Add missing <stdexcept> in several tests.
Reviewed as https://reviews.llvm.org/D50420

llvm-svn: 339209
2018-08-08 00:40:32 +00:00
Marshall Clow 71f1ec7ea1 Turns out that wide literals U"xxx" and u"xxx" are c++11 and later.
llvm-svn: 336880
2018-07-12 02:55:01 +00:00
Marshall Clow b360cbcc4b Same reversed ifdef happened twice. Test fix only, NFC to the library.
llvm-svn: 336856
2018-07-11 21:22:13 +00:00
Marshall Clow 9c43521cd6 Fix a test #ifdef that was reversed. NFC to the library.
llvm-svn: 336855
2018-07-11 21:20:42 +00:00
Marshall Clow 76b26852b6 Implement LWG 2946, 3075 and 3076. Reviewed as https://reviews.llvm.org/D48616
llvm-svn: 336132
2018-07-02 18:41:15 +00:00
Volodymyr Sapsai b9c0b637cc [libcxx] [test] Mark the test as unsupported by apple-clang-8.1.
llvm-svn: 333011
2018-05-22 18:46:16 +00:00
Stephan T. Lavavej ad9545eb30 [libcxx] [test] Fix whitespace, NFC.
test/std almost always uses spaces; now it is entirely tab-free.

llvm-svn: 329978
2018-04-12 23:56:22 +00:00
Marshall Clow 4a6f3c4710 Implement LWG3034: P0767R1 breaks previously-standard-layout types
llvm-svn: 328064
2018-03-21 00:36:05 +00:00
Mike Edwards 8e94aeb5f8 [libcxx][test] Adding apple-clang-9 to UNSUPPORTED in iter_alloc_deduction.fail.cpp.
After two failed attempts last week to make this work I am
going back to a known good method of making this test pass on
macOS...adding the current apple-clang version to the
UNSUPPORTED list.

During a previous patch review (https://reviews.llvm.org/D44103)
it was suggested to just XFAIL libcpp-no-deduction-guides
as was done to iter_alloc_deduction.pass.cpp. However
this caused a an unexpected pass on:
http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc-tot-latest-std/builds/214

I then attempted to just mark libcpp-no-deduction-guides
as UNSUPPORTED, however this caused an additional bot
failure.  So I reverted everything (https://reviews.llvm.org/rCXX327191).

To solve this and get work unblocked I am adding
apple-clang-9 to the original UNSUPPORTED list.

llvm-svn: 327304
2018-03-12 18:06:37 +00:00
Mike Edwards b9abf3d299 [libcxx][test] Reverting r327178 and r327190.
Reverting changes made to iter_alloc_deduction.fail.cpp
as my changes seem to be making several Linux bots angry.

llvm-svn: 327191
2018-03-10 00:53:05 +00:00
Mike Edwards 231e19ce52 [libcxx][test] Marking libcpp-no-deduction-guides unsupported.
This fixes linux bot failures with r327178.

llvm-svn: 327190
2018-03-10 00:19:25 +00:00
Mike Edwards d0f595d77c XFAIL: libcpp-no-deduction-guides in libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.fail.cpp
Summary: Refactor the previous version method of marking each apple-clang version as UNSUPPORTED and just XFAIL'ing the libcpp-no-deduction-guides instead.  This brings this test inline with the same style as iter_alloc_deduction.pass.cpp

Reviewers: EricWF, dexonsmith

Reviewed By: EricWF

Subscribers: EricWF, vsapsai, vsk, cfe-commits

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

llvm-svn: 327178
2018-03-09 22:13:12 +00:00
Stephan T. Lavavej c1fcd97ede [libcxx] [test] Fix MSVC warnings and errors.
test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
Fix MSVC x64 truncation warnings.
warning C4267: conversion from 'size_t' to 'int', possible loss of data

test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
Fix MSVC uninitialized memory warning.
warning C6001: Using uninitialized memory 'vl'.

test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
Include <cassert> for the assert() macro.

Fixes D43273.

llvm-svn: 326120
2018-02-26 20:47:46 +00:00
Marshall Clow 3c83937370 Add another test case to the deduction guide for basic_string.
llvm-svn: 325740
2018-02-22 05:14:20 +00:00
Eric Fiselier 9491643c4b Fix test failure on compilers w/o deduction guides
llvm-svn: 325205
2018-02-15 02:41:19 +00:00
Stephan T. Lavavej 6b1ae9b854 [libcxx] [test] Strip trailing whitespace, NFC.
llvm-svn: 324959
2018-02-12 22:54:35 +00:00
Marshall Clow 7f7891c427 The apple versions of clang don't support deduction guides yet.
llvm-svn: 324640
2018-02-08 19:33:03 +00:00
Marshall Clow 6aafc8b308 Once more, with feeling. Spell 'clang-4.0' correctly this time
llvm-svn: 324624
2018-02-08 17:06:08 +00:00
Marshall Clow 2a81d30471 Clean up string's deduction guides tests. Mark old versions of clang as unsupported, b/c they don't have deduction guides, even in C++17 mode
llvm-svn: 324619
2018-02-08 16:25:57 +00:00
Marshall Clow b0c4bb74a8 Temporarily comment out deduction guide tests while I figure out what to do with old bots
llvm-svn: 324573
2018-02-08 07:20:45 +00:00
Marshall Clow 6d9f750dec Implement deduction guide for basic_string as described in P0433
llvm-svn: 324569
2018-02-08 06:34:03 +00:00
Marshall Clow fc940277cb Fix PR#31454 - 'basic_string<T>::push_back() crashes if sizeof(T)>sizeof(long long)'. We were mishandling the small-string optimization calculations for very large 'characters'. This may be an ABI change (change the size of) strings of very large 'characters', but since they never worked, I'm not too concerned.
llvm-svn: 324531
2018-02-07 21:30:17 +00:00
Marshall Clow aafb3151a8 Add tests to make sure that <string_view> provides std::size/data/empty in C++17 mode. This is LWG#3009, coming up for a vote in JAX - but we already do it, just don't have tests
llvm-svn: 323719
2018-01-30 00:47:43 +00:00
Marshall Clow 7d661bb248 Fix the definitions of 'reference' and 'pointer' in string_view that no one uses :-). Thanks to K-ballo for the catch.
llvm-svn: 321188
2017-12-20 16:31:40 +00:00
Stephan T. Lavavej 4626c9a647 [libcxx] [test] Strip trailing whitespace. NFC.
llvm-svn: 319994
2017-12-07 00:50:23 +00:00
Marshall Clow 936a2fd4b4 Ooops. I checked in a test for a bug I haven't fixed yet. Temporrarily commented it out.
llvm-svn: 319693
2017-12-04 20:46:38 +00:00
Marshall Clow 800259c98d Implement P0457R2: 'String Prefix and Suffix Checking' for c++2a
llvm-svn: 319687
2017-12-04 20:11:38 +00:00
Billy Robert O'Neal III ba40b0566f Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065
llvm-svn: 318804
2017-11-21 21:37:26 +00:00
Marshall Clow 25a7ba4524 More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in string, string_view, and the free function std::empty(). Removed tabs from <string_view>, which is why the diff is so big.
llvm-svn: 318328
2017-11-15 20:02:27 +00:00
Billy Robert O'Neal III 83252766f9 Tolerate [[nodiscard]] annotations in the STL. Reviewed as https://reviews.llvm.org/D39033
llvm-svn: 318276
2017-11-15 07:40:37 +00:00
Marshall Clow ac2b3e3a7a Mark string_view's constructor from (ptr,len) as noexcept (an extension). Update the tests to check this (and other noexcept bits
llvm-svn: 316456
2017-10-24 16:30:06 +00:00
Marshall Clow 59b48302a3 Mark string_view literals as 'noexcept'. Fixes PR#25054. Thanks to Pavel K for the bug report.
llvm-svn: 316439
2017-10-24 14:06:00 +00:00
Stephan T. Lavavej e23dde6449 [libcxx] [test] Fix unused local typedef warnings.
llvm-svn: 314259
2017-09-26 23:08:43 +00:00
Stephan T. Lavavej 326df3d819 [libcxx] [test] Strip trailing whitespace.
llvm-svn: 314258
2017-09-26 23:08:41 +00:00
Marshall Clow 064028bb05 Add even more string_view tests. These found some bugs in the default parameter value for rfind/find_last_of/find_last_not_of
llvm-svn: 312693
2017-09-07 04:19:32 +00:00
Marshall Clow e2addb79b8 Another missing string_view test
llvm-svn: 312691
2017-09-07 03:03:48 +00:00
Marshall Clow b6d73126c8 Add more string_view tests
llvm-svn: 312690
2017-09-07 02:46:09 +00:00
Stephan T. Lavavej 9ea675ef8c [libcxx] [test] Change comments to say C++ instead of c++. NFC.
This makes them consistent (many comments already used uppercase).

The special REQUIRES, UNSUPPORTED, and XFAIL comments are excluded from this change.

llvm-svn: 309468
2017-07-29 00:55:35 +00:00
Stephan T. Lavavej d29b12ef7c [libcxx] [test] Make files consistently end with newlines, NFC.
llvm-svn: 309465
2017-07-29 00:55:22 +00:00
Stephan T. Lavavej 4159db7698 [libcxx] [test] Untabify, NFC.
llvm-svn: 309464
2017-07-29 00:55:10 +00:00
Billy Robert O'Neal III 4deabc97a1 Add asserts that the nullptr is maintained in string erase operations.
llvm-svn: 303899
2017-05-25 19:01:14 +00:00
Eric Fiselier 5b8ab693ab Remove non-standard basic_string_view::clear() member.
This patch removes the clear() member from <string_view>. The
modifier was removed from the TS before it ever landed in the standard.
There is no reason libc++ should be providing this method.

llvm-svn: 302869
2017-05-12 03:35:53 +00:00
Billy Robert O'Neal III 362ea7329f Fix possible loss of data warnings on amd64
In T_size_size.pass, there is an explicit template argument to std::min to ask
for unsigned, to avoid type deduction errors. However, C1XX' warnings still
hate this use, because a 64 bit value (a size_t) is being passed to a function
accepting an unsigned (a 32 bit value).

Instead, change the tests to pass around std::size_t instances, and explicitly
narrow when constructing the string type under test. This also allows
removal of explicit template arguments to std::min.

llvm-svn: 302473
2017-05-08 21:54:53 +00:00
Mehdi Amini e9c66ad9fa Add markup for libc++ dylib availability
Libc++ is used as a system library on macOS and iOS (amongst others). In order
for users to be able to compile a binary that is intended to be deployed to an
older version of the platform, clang provides the
availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_
that can be placed on declarations to describe the lifecycle of a symbol in the
library.

See docs/DesignDocs/AvailabilityMarkup.rst for more information.

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

llvm-svn: 302172
2017-05-04 17:08:54 +00:00
Billy Robert O'Neal III 49ee2a0f28 Resolve unused local typedef warning in test.
llvm-svn: 300937
2017-04-21 01:10:04 +00:00
Eric Fiselier 414d17c67c Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the string library.
llvm-svn: 300633
2017-04-19 00:28:44 +00:00
Eric Fiselier e84fcb5f3d Fix PR32642 - string::insert and string::append don't work with move_iterator.
llvm-svn: 300397
2017-04-15 06:49:02 +00:00
Marshall Clow 7c803385a7 Implement P0599: 'noexcept for hash functions'. Fix a couple of hash functions (optional<T> and unique_ptr<T>) which were mistakenly marked as 'noexcept'. Reviewed as https://reviews.llvm.org/D31234
llvm-svn: 298573
2017-03-23 02:40:28 +00:00
Marshall Clow 4069c2bc48 Implement LWG#2761: 'basic_string should require that charT match traits::char_type'. Tests for string_view, too
llvm-svn: 297872
2017-03-15 18:41:11 +00:00
Mehdi Amini f8764e30d5 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.

llvm-svn: 297798
2017-03-15 00:59:54 +00:00