Daniel Dunbar
15eaebea15
Revert r178075, "Tighten up the iterator requirements ...", it breaks LLVM
...
bootstrap with libc++.
llvm-svn: 178116
2013-03-27 04:10:25 +00:00
Howard Hinnant
5a13d8dcea
Tighten up the iterator requirements for the vector member templates. This is especially important for the constructors so that is_constructible<vector<T>, I, I> gives the right answer when T can not be constructed from *I. Test case included for this latter point.
...
llvm-svn: 178075
2013-03-26 21:40:54 +00:00
Howard Hinnant
cd4a9fd301
Another vector debug mode test, and a static test on Allocator::value_type. This partially addresses http://llvm.org/bugs/show_bug.cgi?id=15576 .
...
llvm-svn: 178064
2013-03-26 19:04:56 +00:00
Howard Hinnant
1d8a5164b4
More vector debug tests.
...
llvm-svn: 178033
2013-03-26 15:45:56 +00:00
Marshall Clow
a6d24cc19d
Fixed race conditions in thread tests; exposed by UBSan
...
llvm-svn: 178029
2013-03-26 15:28:33 +00:00
Howard Hinnant
ea95898f29
Simply debug mode tests per Dmitri Gribenko's suggestion.
...
llvm-svn: 178026
2013-03-26 14:28:25 +00:00
Howard Hinnant
d9db9f90fb
Need one more swap overload for swapping two lvalue vector<bool>::reference's.
...
llvm-svn: 178016
2013-03-26 13:48:57 +00:00
Howard Hinnant
ea1bbbd135
Added debug tests for indexing, pop_back and both forms of erase. Added an improved error message for erasing a single element with end().
...
llvm-svn: 177929
2013-03-25 22:12:26 +00:00
Howard Hinnant
b14037be89
Remove some erroneous code I was using to debug debug mode.
...
llvm-svn: 177908
2013-03-25 20:46:07 +00:00
Howard Hinnant
2d752fc2f9
Debug mode tests for vector::front and back.
...
llvm-svn: 177904
2013-03-25 20:31:25 +00:00
Howard Hinnant
35b3b54548
More vector::iterator debug mode tests. Run by adding to OPTIONS -D_LIBCPP_DEBUG2=1.
...
llvm-svn: 177897
2013-03-25 20:03:19 +00:00
Howard Hinnant
92bd7c0337
Debug mode: learning to crawl. I need to set up some tests that actually test that the debug mode is working, but that won't cause problems when debug mode isn't on. This is my first prototype of such a test. It should call std::terminate() because it's comparing iterators from different containers. And std::terminate() is rigged up to exit normally. If debug mode fails, and doesn't call terminate, then the program asserts. The test is a no-op if _LIBCPP_DEBUG2 is not defined or is defined to be 0.
...
llvm-svn: 177892
2013-03-25 19:29:35 +00:00
Howard Hinnant
a60ae88db2
Marshall Clow found some divide-by-zero warnings with UBSan in rand's binomial_distribution test. This eliminates the divide-by-zeros and describes in comments the numerical difficulties the test is having. Each of the problematic tests are exploring edge cases of the distribution.
...
llvm-svn: 177826
2013-03-23 19:29:45 +00:00
Howard Hinnant
65a87ccdbf
This is a start at making the libc++ test suite friendlier to the -fnoexceptions flag. Although this is not a complete solution, it does reduce the number of test failures on OS X from 467 to 128 on OS X when -fno-exceptions is enabled, and does not impact the number of failures at all when -fno-exceptions is not enabled. The bulk of this code was donated anonymously.
...
llvm-svn: 177824
2013-03-23 17:27:16 +00:00
Howard Hinnant
7c5b88b134
Test cleanup with respect to use of deprecated tmpnam function. Also Windows port for these tests to use _tempnam. The bulk of this patch was donated anonymously. I've tested it on OS X and accept responsibility for it. If I've broken anyone's platform by switching from tmpnam to mktemp for the generation of temporary file names, just let me know. Should be easy to fix in test/support/platform_support.h
...
llvm-svn: 177755
2013-03-22 20:05:40 +00:00
Marshall Clow
c962cdf8a5
Fix buffer read overflow in money_get::do_get(). Found by UBSan
...
llvm-svn: 177694
2013-03-22 02:14:40 +00:00
Marshall Clow
1c2c986796
Fix undefined behavior in syntax_option_type::operator~ and match_flag_type::operator./a.out Found by UBSan
...
llvm-svn: 177693
2013-03-22 02:13:55 +00:00
Marshall Clow
761b5cf087
Fix bug in test; found by AddressSanitizer
...
llvm-svn: 177464
2013-03-20 00:01:48 +00:00
Howard Hinnant
4bb98d0917
Marshall Clow found this memory problem in strstream using -fsanitize=address on the test suite.
...
llvm-svn: 177452
2013-03-19 22:16:57 +00:00
Howard Hinnant
591ebe3cbb
This is an optimization which produces improved launching time. There should be no functionality change. Clients should see no ABI differences.
...
llvm-svn: 177443
2013-03-19 21:34:48 +00:00
Marshall Clow
1c00ce5070
Fix bug in test; found by AddressSanitizer
...
llvm-svn: 177355
2013-03-18 23:39:36 +00:00
Marshall Clow
69e76f80e2
Removed raw references to __sun__, __FreeBSD__, __GLIBC__ and __linux__; now just check to see if they are defined.
...
llvm-svn: 177310
2013-03-18 19:34:07 +00:00
Marshall Clow
7415c8b171
Removed raw references to _MSC_VER; now just check to see if it is defined.
...
llvm-svn: 177304
2013-03-18 18:20:48 +00:00
Marshall Clow
b56e8587af
Removed raw references to __APPLE__; now just check to see if it is defined.
...
llvm-svn: 177297
2013-03-18 17:45:34 +00:00
Marshall Clow
91907cbe82
Removed raw references to _WIN32; now just check to see if it is defined.
...
llvm-svn: 177291
2013-03-18 17:04:29 +00:00
Howard Hinnant
5efca64dd9
This should be nothing but a load-time optimization. I'm trying to reduce load time initializers and this is a big one. No visible functionality change intended.
...
llvm-svn: 177212
2013-03-16 00:17:53 +00:00
Marshall Clow
928f65a8aa
Updated link to Marshall's instructions
...
llvm-svn: 177099
2013-03-14 19:00:34 +00:00
Howard Hinnant
d70e6570fd
Some forward-looking and optimistic documentation.
...
llvm-svn: 177093
2013-03-14 18:37:48 +00:00
Howard Hinnant
41801f14ed
This SO question: http://stackoverflow.com/questions/15344402/how-can-i-read-a-0xff-in-a-file-with-libc-istream-iterator/15347225#15347225 highlighted the lack of a cast in the implementation of std::cin. Added. I unfortunately don't have a test case to add to the suite since this bug only shows itself when using std::cin. The current testsuite setup does not have a way a good way to test std::cin.
...
llvm-svn: 176822
2013-03-11 19:53:48 +00:00
Howard Hinnant
7e4844b353
Parsing floating point numbers with very long precision was broken, and this patch fixes it. This fixes http://llvm.org/bugs/show_bug.cgi?id=15445 .
...
llvm-svn: 176711
2013-03-08 19:06:24 +00:00
Howard Hinnant
c60bf548c5
Albert Wong: definition for regex_traits<_CharT>::__regex_word.
...
llvm-svn: 176640
2013-03-07 19:38:08 +00:00
Howard Hinnant
ead480d30a
Change _LIBCPP_TYPE_VIS to use __type_visibility__(default) instead of __visibility__(default) when available. This change makes just the type_info visible so that types like vectors and strings can be used as exception objects across dylib boundaries even when hidden visibility is specified globally (at the command line), and yet this allows clients to hide the member functions of things like vector and string (with global visibility commands).
...
llvm-svn: 176639
2013-03-07 19:25:03 +00:00
Howard Hinnant
6e41256f68
No functionality change at this time. I've split _LIBCPP_VISIBLE up into two flags: _LIBCPP_TYPE_VIS and _LIBCPP_FUNC_VIS. This is in preparation for taking advantage of clang's new __type_visibility__ attribute.
...
llvm-svn: 176593
2013-03-06 23:30:19 +00:00
Howard Hinnant
65f58f3fe8
Have basic_istream::read call sgetn intead of sbumpc individual characters. This addresses http://llvm.org/bugs/show_bug.cgi?id=15427 .
...
llvm-svn: 176573
2013-03-06 19:27:56 +00:00
Howard Hinnant
3fb6c6e50d
Correct silly type-o. Thanks Richard.
...
llvm-svn: 176568
2013-03-06 18:16:12 +00:00
Howard Hinnant
53b9ee061f
The bitset(unsigned long long) constructor was broken by the constexpr additions only on 32 bit platforms. Fixed. This addresses http://llvm.org/bugs/show_bug.cgi?id=15444 .
...
llvm-svn: 176559
2013-03-06 17:30:26 +00:00
Howard Hinnant
5b22e99e77
Michael van der Westhuizen: correction to the libcxx build instructions when built with libcxxrt on Linux.
...
llvm-svn: 176093
2013-02-26 16:27:55 +00:00
Howard Hinnant
a9f698009f
Alexey Samsonov: #ifdefs out undefined function in static build of libc++ w/o RTTI.
...
llvm-svn: 176026
2013-02-25 15:50:36 +00:00
Howard Hinnant
c0c9748c11
Constrain bind operator()() to not exist if the call is not valid. Fixes http://llvm.org/bugs/show_bug.cgi?id=15295 .
...
llvm-svn: 175774
2013-02-21 18:16:55 +00:00
David Chisnall
8b6a4de64a
Fix a bug in mutex_try_to_lock. This was previously trying to unlock a mutex that it didn't own, causing an assertion failure in mutex.cpp. The issue was that the unique_lock went out of scope, releasing the lock on m, then m.unlock() was called on an already-unlocked mutex.
...
This change removes the spurious m.unlock() call.
If this test was previously passing for anyone with assertions enabled, then they should investigate bugs in their pthread implementation, as pthread_unlock() should not return 0 if the mutex is currently unlocked.
llvm-svn: 175506
2013-02-19 11:28:45 +00:00
Howard Hinnant
65af0388b9
Bruce Mitchener: Minor typo fixes.
...
llvm-svn: 175274
2013-02-15 15:37:50 +00:00
Daniel Dunbar
62b943935d
[tests] Add support for a link_flags lit parameter.
...
- This is useful for testing with custom ABI libraries.
- Patch by Michael van der Westhuizen.
llvm-svn: 174997
2013-02-12 19:28:51 +00:00
Daniel Dunbar
496f1765a2
[tests] Another batch of timeout increases.
...
llvm-svn: 174902
2013-02-11 21:04:34 +00:00
Howard Hinnant
af00dc0420
Michael van der Westhuizen: Update instructions for building on Linux.
...
llvm-svn: 174733
2013-02-08 19:10:36 +00:00
Howard Hinnant
50232e50d8
Add Michael van der Westhuizen to CREDITS.TXT
...
llvm-svn: 174732
2013-02-08 19:08:06 +00:00
Howard Hinnant
0e2f292a30
Michael van der Westhuizen: update to CMake.
...
llvm-svn: 174731
2013-02-08 19:04:53 +00:00
Daniel Dunbar
ceb47bb06d
[tests] Another batch of timeout increases.
...
llvm-svn: 174726
2013-02-08 18:26:55 +00:00
Daniel Dunbar
76efb57666
[tests] Add back stdc macros I accidentally refactored out.
...
- Patch by Michael van der Westhuizen:
--
r174404 accidentally removed stdc format, limit and constant macros from the Linux test runner logic. This small patch re-adds the macros.
Making this change fixes the following tests on Linux:
- depr/depr.c.headers/inttypes_h.pass.cpp
- depr/depr.c.headers/stdint_h.pass.cpp
- input.output/file.streams/c.files/cinttypes.pass.cpp
- language.support/cstdint/cstdint.syn/cstdint.pass.cpp
--
llvm-svn: 174722
2013-02-08 17:41:28 +00:00
Daniel Dunbar
577e696425
[tests] Increase a bunch of wait limits.
...
- Basically I just ran the thread tests many many times on a busy machine and
bumped the timeouts whenever I hit a test failure.
- This is obviously subpar, but is the best I can do without the tests being
rewritten to not depend on arbitrary timeouts.
llvm-svn: 174721
2013-02-08 17:41:19 +00:00
Marshall Clow
b6e5f854f5
Change the 'result_type' from unsigned to 'uint_fast32_t'. This eliminates truncation warnings on Linux
...
llvm-svn: 174669
2013-02-07 22:12:02 +00:00