summaryrefslogtreecommitdiff
path: root/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp
AgeCommit message (Collapse)Author
2024-10-31[libc++] Granularize <cstddef> includes (#108696)Nikolas Klauser
2023-09-01[libc++] Apply clang formatting to all string unit testsBrendan Emery
This applies clang-format to the std::string unit tests in preparation for landing https://reviews.llvm.org/D140550. Differential Revision: https://reviews.llvm.org/D140612
2023-03-21[libc++] Qualifies size_t.Mark de Wever
This has been done using the following command find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)size_t)|\1std::\2|' \{} \; And manually removed some false positives in std/depr/depr.c.headers. The `std` module doesn't export `::size_t`, this is a preparation for that module. Reviewed By: ldionne, #libc, EricWF, philnik Differential Revision: https://reviews.llvm.org/D146088
2022-11-21[libc++][NFC] Add missing conditionals for the existence of wide charactersLouis Dionne
Differential Revision: https://reviews.llvm.org/D138435
2022-06-03[libc++][test] Skip string_view tests for other vendors on older modesJoe Loser
`string_view` is supported all the way back to C++03 as an extension in `libc++`, and so many of the tests run in all standards modes for all vendors. This is unlikely desired by other standard library vendors using our test suite. So, disable the tests for vendors other than `libc++` in these older standards modes. Differential Revision: https://reviews.llvm.org/D126850
2021-12-16[libc++] Add GCC workaround in std::char_traits<char>::length()Nikolas Klauser
GCC currently does not allow `__builtin_strlen()` during constant evaluation. This PR adds a workaround in `std::char_traits<char>::length()` Reviewed By: Quuxplusone, ldionne, #libc, Mordante Spies: Mordante, libcxx-commits Differential Revision: https://reviews.llvm.org/D115795
2021-09-20[libc++] [LIBCXX-DEBUG-FIXME] Constexpr char_traits::copy mustn't compare ↵Arthur O'Dwyer
unrelated pointers. Now that __builtin_is_constant_evaluated() is present on all supported compilers, we can use it to skip the UB-inducing assert in cases where the computation might be happening at constexpr time. Differential Revision: https://reviews.llvm.org/D101674
2021-08-12[libc++] Remove Lit annotations for unsupported GCC versions from the test suiteLouis Dionne
Since we officially don't support several older compilers now, we can drop a lot of the markup in the test suite. This helps keep the test suite simple and makes sure that UNSUPPORTED annotations don't rot. This is the first patch of a series that will remove annotations for compilers that are now unsupported. Differential Revision: https://reviews.llvm.org/D107787
2021-07-15[libc++] Add a job running GCC with C++11Louis Dionne
This configuration is interesting because GCC has a different level of strictness for some C++ rules. In particular, it implements the older standards more stringently than Clang, which can help find places where we are non-conforming (especially in the test suite). Differential Revision: https://reviews.llvm.org/D105936
2021-06-15[libc++] [test] Fix some GCC 11 errors/warnings in these tests. NFCI.Arthur O'Dwyer
Differential Revision: https://reviews.llvm.org/D104228
2021-04-30[libc++] [test] Add a debug-mode CI.Arthur O'Dwyer
To run llvm-lit manually from the command line: ./bin/llvm-lit -sv --param std=c++2b --param cxx_under_test=`pwd`/bin/clang \ --param debug_level=1 ../libcxx/test/ Tests that currently fail with `debug_level=1` are marked `LIBCXX-DEBUG-FIXME`, but my intent is to deal with all of them and leave no such annotations in the codebase within the next couple weeks. (I have patches for all of them in my local checkout.) Differential Revision: https://reviews.llvm.org/D100866
2021-03-25[libc++] [P1032] Misc constexpr bits in <iterator>, <string_view>, <tuple>, ↵Arthur O'Dwyer
<utility>. This completes the implementation of P1032's changes to <iterator>, <string_view>, <tuple>, and <utility> in C++20. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html Drive-by fix a couple of unintended rvalues in "*iterators*/*.fail.cpp". Differential Revision: https://reviews.llvm.org/D96385
2019-02-04Support tests in freestandingJF Bastien
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-01-19Update more file headers across all of the LLVM projects in the monorepoChandler Carruth
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
2018-08-08[libcxx] [test] Add missing <stdexcept> in several tests.Billy Robert O'Neal III
Reviewed as https://reviews.llvm.org/D50420 llvm-svn: 339209
2016-10-24Add missing include in string_view tests. Patch from Billy ONeil @ microsoftEric Fiselier
llvm-svn: 285012
2016-07-21Implement std::string_view as described in http://wg21.link/P0254R1. ↵Marshall Clow
Reviewed as https://reviews.llvm.org/D21459 llvm-svn: 276238