| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[libc++][test] Add '-Wdeprecated-copy', '-Wdeprecated-copy-dtor' warnings to the test suite This is a follow up to https://reviews.llvm.org/D144694. Fixes https://github.com/llvm/llvm-project/issues/60977. Differential Revision: https://reviews.llvm.org/D144775 | 2 年前 | |
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 | 7 年前 | |
[NFC][libc++][test] Removes C++98 support. (#92930) Libc++ has no separate C++98 support, it uses C++03 instead. This removes some obsolete c++98 markers in the test. Thanks to @StephanTLavavej for spotting this. | 2 年前 | |
[libc++] Implement P2446R2 (views::as_rvalue) Reviewed By: ldionne, var-const, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D137637 | 3 年前 | |
[libc++] [test] Fix portability issues for MSVC (#93259) * Guard std::__make_from_tuple_impl tests with #ifdef _LIBCPP_VERSION and LIBCPP_STATIC_ASSERT. * Change _LIBCPP_CONSTEXPR_SINCE_CXX20 to TEST_CONSTEXPR_CXX20. + Other functions in variant.swap/swap.pass.cpp were already using the proper test macro. * Mark what as [[maybe_unused]] when used by TEST_LIBCPP_REQUIRE. + This updates one occurrence in libcxx/test/libcxx for consistency. * Windows _putenv_s() takes 2 arguments, not 3. + See MSVC documentation: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/putenv-s-wputenv-s?view=msvc-170 + POSIX setenv() takes int overwrite, but Windows _putenv_s() always overwrites. * Avoid non-Standard zero-length arrays. + Followup to #74183 and #79792. * Add operator++() to unsized_it. + The Standard requires this due to [N4981][] [move.iter.requirements]/1 "The template parameter Iterator shall either meet the *Cpp17InputIterator* requirements ([input.iterators]) or model input_iterator ([iterator.concept.input])." + MSVC's STL requires this because it has a strengthened exception specification in move_iterator that inspects the underlying iterator's increment operator. * uniform_int_distribution forbids int8_t/uint8_t. + See [N4981][] [rand.req.genl]/1.5. MSVC's STL enforces this. + Note that when changing the distribution's IntType, we need to be careful to preserve the original value range of [0, max_input]. * fstreams are constructible from const fs::path::value_type* on wide systems. + See [ifstream.cons], [ofstream.cons], [fstream.cons]. * In msvc_stdlib_force_include.h, map _HAS_CXX23 to TEST_STD_VER 23 instead of 99. + On 2023-05-23, https://github.com/llvm/llvm-project/commit/71400505ca048507e827013eb1ea0bc863525cab started recognizing 23 as a distinct value. * Fix test name typo: destory_elements.pass.cpp => destroy_elements.pass.cpp [N4981]: https://wg21.link/N4981 | 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 7 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 2 年前 |