summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/input.output/iostreams.base
Commit message (Collapse)AuthorAgeFilesLines
* [libcxx][test][NFC] Fix comment typos.Stephan T. Lavavej2019-10-222-2/+2
| | | | (Testing git commit access.)
* [libc++] Mark iostreams test as XFAIL on older macOSesLouis Dionne2019-09-231-0/+12
| | | | llvm-svn: 372620
* Only initialize the streams cout/wcout/cerr/wcerr etc once, rather than any ↵Marshall Clow2019-09-131-0/+32
| | | | | | time Init::Init is called. Fixes PR#43300 llvm-svn: 371864
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-3181-0/+157
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* [libc++] Increase portability of xalloc testLouis Dionne2019-03-011-5/+3
| | | | | | | | | | Do not assume that xalloc() starts at 0, which is not specified by the Standard. Thanks to Andrey Maksimov for the patch. Differential Revision: https://reviews.llvm.org/D58299 llvm-svn: 355160
* Support tests in freestandingJF Bastien2019-02-0492-92/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1992-368/+276
| | | | | | | | | | | | | | | | | | 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
* [libcxx] [test] Remove nonportable locale assumption in ↵Billy Robert O'Neal III2018-08-081-3/+3
| | | | | | | | | | basic.ios.members/narrow.pass.cpp I'm not sure if libcxx is asserting UTF-8 here; but on Windows the full char value is always passed through in its entirety, since the default codepage is something like Windows-1252. The replacement character is only used for non-chars there; and that should be a more portable test everywhere. (Still pending review at https://reviews.llvm.org/D47395 which has been open since may; will ask for forgiveness rather than permission :) ) llvm-svn: 339213
* [libcxx] [test] Remove nonportable that errc::is_a_directory produces "Is a ↵Billy Robert O'Neal III2018-04-252-2/+6
| | | | | | | | | | directory" from ios_base::failure tests These io_error asserts that std::errc::is_a_directory has message "Is a directory". On MSVC++ it reports "is a directory" (with a lowercase I). That doesn't matter for the ios_failure component being tested, so just implement in terms of system_category().message(). Reviewed as https://reviews.llvm.org/D45715 llvm-svn: 330791
* More configuration changes for running the test suite against MSVC's STLEric Fiselier2017-01-182-0/+6
| | | | llvm-svn: 292337
* Recommit r290750: Fix PR19460 - std::ios is convertible to int.Eric Fiselier2016-12-301-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two problems with the initial fix. 1. The added tests flushed out that we misconfigured _LIBCPP_EXPLICIT with GCC. 2. Because the boolean type was a member function template it caused weird link errors. I'm assuming due to the vague linkage rules. This time the bool type is a non-template member function pointer. That seems to have fixed the failing tests. Plus it will end up generating less symbols overall, since the bool type is no longer per instantiation. original commit message below ----------------------------- std::basic_ios has an operator bool(). In C++11 and later it is explicit, and only allows contextual implicit conversions. However explicit isn't available in C++03 which causes std::istream (et al) to have an implicit conversion to int. This can easily cause ambiguities when calling operator<< and operator>>. This patch uses a "bool-like" type in C++03 to work around this. The "bool-like" type is an arbitrary pointer to member function type. It will not convert to either int or void*, but will convert to bool. llvm-svn: 290754
* Revert r290750 - Fix PR19460 - std::ios is convertible to int.Eric Fiselier2016-12-301-9/+0
| | | | llvm-svn: 290752
* Add missing include in test.Eric Fiselier2016-12-301-0/+2
| | | | llvm-svn: 290751
* Fix PR19460 - std::ios is convertible to int.Eric Fiselier2016-12-301-0/+7
| | | | | | | | | | | | | | | std::basic_ios has an operator bool(). In C++11 and later it is explicit, and only allows contextual implicit conversions. However explicit isn't available in C++03 which causes std::istream (et al) to have an implicit conversion to int. This can easily cause ambiguities when calling operator<< and operator>>. This patch uses a "bool-like" type in C++03 to work around this. The "bool-like" type is an arbitrary pointer to member function type. It will not convert to either int or void*, but will convert to bool. llvm-svn: 290750
* Fix unused parameters and variablesEric Fiselier2016-12-231-3/+1
| | | | llvm-svn: 290459
* Protect std::ios tests under libcpp-no-exceptionsRoger Ferrer Ibanez2016-11-145-5/+27
| | | | | | | | | Skip tests that expect an exception be thrown. Also add some missing asserts in the original test. Differential Revision: https://reviews.llvm.org/D26512 llvm-svn: 286823
* Implement is_error_code_v and is_error_condition_v for c++17. Rework the ↵Marshall Clow2016-09-241-0/+25
| | | | | | tests for is_error_code and is_error_condition, since they were really lacking. Thanks to Alisdair for the heads-up that we were missing these. llvm-svn: 282331
* Move remaining _LIBCPP_VERSION tests into test/libcxxEric Fiselier2016-06-221-20/+0
| | | | llvm-svn: 273367
* Remove more names of unreferenced parameters. Patch from STL@microsoft.comEric Fiselier2016-04-292-10/+10
| | | | llvm-svn: 267962
* Rename a few tests that had typos in their names. No functional change. ↵Marshall Clow2016-04-231-0/+0
| | | | | | Thanks to STL for the catch llvm-svn: 267287
* [libcxx] Add appropriate 'REQUIRE' directives to tests that require en_US.UTF-8.Daniel Sanders2016-01-213-0/+6
| | | | | | | | | | Reviewers: mclow.lists, hans Subscribers: bcraig, cfe-commits Differential Revision: http://reviews.llvm.org/D16406 llvm-svn: 258403
* [libcxx] Fixup a few fumbles in the initial no-exceptions XFAILs list.Asiri Rathnayake2015-11-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial buildbot run found a few missing bits in the initial XFAIL list for the no-exceptions libc++ variant. These discrepancies are as follows: [1] Following two tests need XFAILs on the no-exceptions library variant. My local runs had these two disabled for other reasons (unsupported): - localization/locales/locale/locale.cons/char_pointer.pass.cpp - numerics/complex.number/complex.ops/complex_divide_complex.pass.cpp [2] These three does not need XFAILs, they were failing on my local runs for other reasons: - depr/depr.c.headers/uchar_h.pass.cpp - input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp - .../category.collate/locale.collate.byname/transform.pass.cpp (these are failing on my box for the default build as well) The current patch fixes both the cases above. Additionally, I've run the following scan to make sure I've covered all the cases: > grep ' catch \| try \| throw ' -R . | perl -pe 's|(.*?):.*|\1|' | sort | \ uniq > 1.txt > grep 'libcpp-no-exceptions' -R . | perl -pe 's|(.*?):.*|\1|' | sort | \ uniq > 2.txt > diff 1.txt 2.txt This showed up a few extra interesting cases: [3] These two tests do not use try/catch/throw statements, but they fail at runtime. Need to be investigated, I've left the XFAILs in. - std/thread/futures/futures.shared_future/dtor.pass.cpp - std/thread/futures/futures.unique_future/dtor.pass.cpp [4] These tests use a macro named TEST_HAS_NO_EXCEPTIONS to conditionally exclude try/catch/throw statements when running without exceptions. I'm not entirely sure why this was needed (AFAIK, we didn't have a no-exceptions library build before). The macro's defintion is quite similar to that of _LIBCPP_NO_EXCEPTIONS. I will investigate if this can be reused for my test fixes or if it should be replaced with _LIBCPP_NO_EXCEPTIONS. - std/experimental/any/* Change-Id: I9ad1e0edd78f305406eaa0ab148b1ab693f7e26a llvm-svn: 252870
* 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
* Add a test for LWG#2462: std::ios_base::failure is overspecifiedMarshall Clow2015-10-251-0/+3
| | | | llvm-svn: 251250
* Move test into test/std subdirectory.Eric Fiselier2014-12-2092-0/+3471
llvm-svn: 224658
OpenPOWER on IntegriCloud