summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/re
Commit message (Collapse)AuthorAgeFilesLines
...
* Some of Eric's buildbots don't like this test. Disable it while I figure out ↵Marshall Clow2017-04-061-0/+2
| | | | | | why. llvm-svn: 299686
* Recommit awk tests with warnings removed. Initial commit r299652, reverted ↵Marshall Clow2017-04-061-48/+47
| | | | | | r299656. llvm-svn: 299680
* Revert "Restore Missing awk regex tests. Thanks to dexonsmith for noticing, ↵Mehdi Amini2017-04-061-8/+9
| | | | | | | | and proposing this as https://reviews.llvm.org/D16541" This reverts commit r299652, 32bits MacOS is broken. llvm-svn: 299656
* Restore Missing awk regex tests. Thanks to dexonsmith for noticing, and ↵Marshall Clow2017-04-061-9/+8
| | | | | | proposing this as https://reviews.llvm.org/D16541 llvm-svn: 299652
* Add deployment knobs to tests (for Apple platforms)Mehdi Amini2017-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Update all bug URL's to point to https://bugs.llvm.org/...Eric Fiselier2017-02-175-5/+5
| | | | llvm-svn: 295434
* Fix bug #31387 - not checking end iterator when parsing decimal escape. ↵Marshall Clow2016-12-241-0/+44
| | | | | | Thanks to Karen for the report. llvm-svn: 290500
* Fix -Wsign-compare warnings in re tests that only run on OS XEric Fiselier2016-12-247-224/+224
| | | | llvm-svn: 290481
* Fix sign-compare warnings on ARM platforms caused by wchar_t being unsignedEric Fiselier2016-12-241-7/+7
| | | | llvm-svn: 290480
* fix warnings only produced by apple-clangEric Fiselier2016-12-242-4/+0
| | | | llvm-svn: 290474
* Fix unused parameters and variablesEric Fiselier2016-12-232-3/+6
| | | | llvm-svn: 290459
* [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible ↵Stephan T. Lavavej2016-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | loss of data", part 7/7. test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp Add static_cast<char> because basic_istream::get() returns int_type (N4606 27.7.2.3 [istream.unformatted]/4). test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp Add static_cast<char> because toupper() returns int (C11 7.4.2.2/1). test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp This test is intentionally writing doubles to ostream_iterator<int>. It's silencing -Wliteral-conversion for Clang, so I'm adding C4244 silencing for MSVC. test/std/language.support/support.limits/limits/numeric.limits.members/infinity.pass.cpp Given `extern float zero;`, the expression `1./zero` has type double, which emits a truncation warning when being passed to test<float>() taking float. The fix is to say `1.f/zero` which has type float. test/std/numerics/complex.number/cmplx.over/arg.pass.cpp test/std/numerics/complex.number/cmplx.over/norm.pass.cpp These tests were constructing std::complex<double>(x, 0), emitting truncation warnings when x is long long. Saying static_cast<double>(x) avoids this. test/std/numerics/rand/rand.eng/rand.eng.lcong/seed_result_type.pass.cpp This was using `int s` to construct and seed a linear_congruential_engine<T, stuff>, where T is unsigned short/unsigned int/unsigned long/unsigned long long. That emits a truncation warning in the unsigned short case. Because the range [0, 20) is tiny and we aren't doing anything else with the index, we can just iterate with `T s`. test/std/re/re.traits/value.pass.cpp regex_traits<wchar_t>::value()'s first parameter is wchar_t (N4606 28.7 [re.traits]/13). This loop is using int to iterate through ['g', 0xFFFF), emitting a truncation warning from int to wchar_t (which is 16-bit for some of us). Because the bound is exclusive, we can just iterate with wchar_t. test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp This test is a little strange. It's trying to verify that basic_string's (InIt, InIt) range constructor isn't confused by "N copies of C" when N and C have the same integral type. To do this, it was testing (100, 65), but that eventually emits truncation warnings from int to char. There's a simple way to avoid this - passing (static_cast<char>(100), static_cast<char>(65)) also exercises the disambiguation. (And 100 is representable even when char has a signed range.) test/std/strings/string.view/string.view.hash/string_view.pass.cpp Add static_cast<char_type> because `'0' + i` has type int. test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp What's more horrible than nested bind()? pow() overloads! This operator()(T a, T b) was assuming that std::pow(a, b) can be returned as T. (In this case, T is int.) However, N4606 26.9.1 [cmath.syn]/2 says that pow(int, int) returns double, so this was truncating double to int. Adding static_cast<T> silences this. test/std/utilities/function.objects/unord.hash/integral.pass.cpp This was iterating `for (int i = 0; i <= 5; ++i)` and constructing `T t(i);` but that's truncating when T is short. (And super truncating when T is bool.) Adding static_cast<T> silences this. test/std/utilities/utility/exchange/exchange.pass.cpp First, this was exchanging 67.2 into an int, but that's inherently truncating. Changing this to static_cast<short>(67) avoids the truncation while preserving the "what if T and U are different" test coverage. Second, this was exchanging {} with the explicit type float into an int, and that's also inherently truncating. Specifying short is just as good. test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp Add static_cast<short>. Note that this affects template argument deduction for make_pair(), better fulfilling the test's intent. For example, this was saying `typedef std::pair<int, short> P1; P1 p1 = std::make_pair(3, 4);` but that was asking make_pair() to return pair<int, int>, which was then being converted to pair<int, short>. (pair's converting constructors are tested elsewhere.) Now, std::make_pair(3, static_cast<short>(4)) actually returns pair<int, short>. (There's still a conversion from pair<nullptr_t, short> to pair<unique_ptr<int>, short>.) Fixes D27544. llvm-svn: 289111
* [libcxx] [test] D27022: Fix MSVC warning C4389 "signed/unsigned mismatch", ↵Stephan T. Lavavej2016-12-062-2/+4
| | | | | | | | | | part 9/12. Add static_cast<std::size_t> to more comparisons. (Performed manually, unlike part 8/12.) Also, include <cstddef> when it wasn't already being included. llvm-svn: 288746
* [libcxx] Make regex_match backtrack when search failsTim Shen2016-10-271-10/+52
| | | | | | | | | | | | | | | | Summary: Fixes PR19851. alg.re.match/ecma.pass.cpp still XFAILS on linux, but after commenting out locale-related tests, it passes. I don't have a freebsd machine to produce a full pass. Reviewers: mclow.lists Subscribers: cfe-commits, emaste Differential Revision: https://reviews.llvm.org/D26026 llvm-svn: 285352
* [libcxx] Support std::regex_constants::match_not_nullTim Shen2016-10-211-0/+46
| | | | | | | | | | | | Summary: Fixes PR21597. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25595 llvm-svn: 284881
* [libcxx] Recover no-exceptions XFAILs - IAsiri Rathnayake2016-10-064-4/+6
| | | | | | | | | | | | | | | | First batch of changes to get some of these XFAILs working in the no-exceptions libc++ variant. Changed some XFAILs to UNSUPPORTED where the test is all about exception handling. In other cases, used the test macros TEST_THROW and TEST_HAS_NO_EXCEPTIONS to conditionally exclude those parts of the test that concerns exception handling behaviour. Reviewers: EricWF, mclow.lists Differential revision: https://reviews.llvm.org/D24562 llvm-svn: 283441
* [libcxx] Add "flag" default arg: basic_regex ptr_size_flag ctorHubert Tong2016-08-071-0/+39
| | | | | | | | | | | | | | | | | | | | | | Summary: The synopsis in C++11 subclause 28.8 [re.regex] has: ``` basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript); ``` The default argument is added to libc++ by this change. Reviewers: mclow.lists, rsmith, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22702 Reapplies r277966. Patch by Jason Liu! llvm-svn: 277968
* Revert r277966. Forgot patch attribution.Hubert Tong2016-08-071-39/+0
| | | | llvm-svn: 277967
* [libcxx] Add "flag" default arg: basic_regex ptr_size_flag ctorHubert Tong2016-08-071-0/+39
| | | | | | | | | | | | | | | | | | | Summary: The synopsis in C++11 subclause 28.8 [re.regex] has: ``` basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript); ``` The default argument is added to libc++ by this change. Reviewers: mclow.lists, rsmith, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22702 llvm-svn: 277966
* [libcxx] basic_regex: add traits_type, string_typeHubert Tong2016-08-021-0/+6
| | | | | | | | | | | | | | | | | Summary: In the synopsis in C++11 subclause 28.8 [re.regex], `basic_regex` is specified to have member typedefs `traits_type` and `string_type`. This change adds them to libc++. Reviewers: mclow.lists, rsmith, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22698 Patch by Jason Liu! llvm-svn: 277526
* Avoid octal escape sequence warning with MSVC. Patch from STL@microsoft.comEric Fiselier2016-06-142-3/+3
| | | | llvm-svn: 272639
* Remove trailing whitespace in test suite. Approved by Marshall Clow.Eric Fiselier2016-06-0112-28/+28
| | | | llvm-svn: 271435
* Void cast runtime-unused variables. Patch from STL@microsoft.comEric Fiselier2016-05-021-1/+1
| | | | llvm-svn: 268284
* Apparently XFAIL tests that are supposed to fail to compile can be ↵Marshall Clow2016-04-267-14/+28
| | | | | | problematic. They still get compiled, and if the compile succeeds, the buildbots complain. Replace the XFAIL with #error. llvm-svn: 267591
* #include <test_macros.h> in all the regex tests, and remove all mentions of ↵Marshall Clow2016-04-26140-31/+149
| | | | | | __cpluplus (use TEST_STD_VERS and/or XFAIL instead). No functional change llvm-svn: 267567
* Add some tests to ensure that the __regex_word does not conflict with any of ↵Marshall Clow2016-02-111-0/+13
| | | | | | | | ctype_base's values. Hopefully this will catch cases like https://llvm.org/bugs/show_bug.cgi?id=26476 in the future. llvm-svn: 260527
* re.results.form: Format out-of-range subexpression references as nullDuncan P. N. Exon Smith2016-02-031-0/+52
| | | | | | | | | | Rather than crashing in match_results::format() when a reference to a marked subexpression is out of range, format the subexpression as empty (i.e., replace it with an empty string). Note that match_results::operator[]() has a range-check and returns a null match in this case, so this just re-uses that logic. llvm-svn: 259682
* [libcxx] Add appropriate 'REQUIRE' directives to tests that require en_US.UTF-8.Daniel Sanders2016-01-214-0/+8
| | | | | | | | | | Reviewers: mclow.lists, hans Subscribers: bcraig, cfe-commits Differential Revision: http://reviews.llvm.org/D16406 llvm-svn: 258403
* Mark slow ASAN/MSAN tests as XFAIL for now.Eric Fiselier2016-01-191-0/+4
| | | | llvm-svn: 258195
* Fix PR#26175. Thanks to Josh Petrie for the report and the patch. Reviewed ↵Marshall Clow2016-01-191-0/+1
| | | | | | as http://reviews.llvm.org/D16262 llvm-svn: 258107
* Make it possible to build a no-exceptions variant of libcxx.Asiri Rathnayake2015-11-104-0/+4
| | | | | | | | | | | | Fixes a small omission in libcxx that prevents libcxx being built when -DLIBCXX_ENABLE_EXCEPTIONS=0 is specified. This patch adds XFAILS to all those tests that are currently failing on the new -fno-exceptions library variant. Follow-up patches will update the tests (progressively) to cope with the new library variant. Change-Id: I4b801bd8d8e4fe7193df9e55f39f1f393a8ba81a llvm-svn: 252598
* Remove task to get C++03 tests passing from TODO.txtEric Fiselier2015-08-301-1/+1
| | | | llvm-svn: 246392
* Finally get the test suite passing in C++03!!Eric Fiselier2015-08-281-0/+4
| | | | | | | | | After months of work there are only 4 tests still failing in C++03. This patch fixes those tests. All of the libc++ builders should be green. llvm-svn: 246275
* Fix a crasher found by libFuzzerMarshall Clow2015-08-241-0/+23
| | | | llvm-svn: 245849
* Detect and throw on a class of bad regexes that we mistakenly accepted ↵Marshall Clow2015-07-232-1/+43
| | | | | | before. Thanks to Trevor Smigiel for the report llvm-svn: 243030
* Add code to honor the match_not_bol and match_not_eol regex flats. Fixes ↵Marshall Clow2015-03-192-0/+100
| | | | | | PR#22651. Thanks to Jim Porter for the report and suggested fix. llvm-svn: 232733
* Don't hardcode the Czech locale name.Ed Schouten2015-03-1611-30/+44
| | | | | | | | | | | | We already have a definition for the Czech locale name in platform_support.h. Use this one instead. While there, respect the common format of the tests. For most other tests it's the case that test_iterators.h is placed right underneath the other #includes (without an empty line). platform_support.h is included after an empty line. llvm-svn: 232383
* Fix for PR22061 by K-balloMarshall Clow2015-01-281-3/+6
| | | | llvm-svn: 227384
* Cleaning up the test suite; remove some includes of non-standard file <__config>Marshall Clow2015-01-187-21/+7
| | | | llvm-svn: 226411
* Rename system_lib -> system_cxx_lib. NFCJonathan Roelofs2015-01-141-2/+2
| | | | llvm-svn: 226061
* Make regex::assign not clobber the regex in case of failure. Fixes PR#22213Marshall Clow2015-01-131-0/+9
| | | | llvm-svn: 225799
* Move test into test/std subdirectory.Eric Fiselier2014-12-20157-0/+19053
llvm-svn: 224658
OpenPOWER on IntegriCloud