| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LLVM uses .h as its extension for header files.
Files renamed using:
for f in libcxx/test/support/*.hpp; do git mv $f ${f%.hpp}.h; done
References to the files updated using:
for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do
a=$(basename $f);
echo $a;
rg -l $a libcxx | xargs sed -i '' "s/$a/${a%.hpp}.h/";
done
HPP include guards updated manually using:
for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do
echo ${f%.hpp}.h ;
done | xargs mvim
Differential Revision: https://reviews.llvm.org/D66104
llvm-svn: 369481
|
|
|
|
|
|
| |
Updated all the heap tests to check this.
llvm-svn: 369448
|
|
|
|
|
|
| |
Thanks to Zoe for the (big, but simple) patch. NFC intended.
llvm-svn: 362252
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
These algorithms require a ForwardIterator or better. Ensure
we diagnose the contract violation at compile time instead of
of silently doing the wrong thing.
Further algorithms will be audited in upcoming patches.
llvm-svn: 340426
|
|
|
|
| |
llvm-svn: 324959
|
|
|
|
| |
llvm-svn: 324165
|
|
|
|
| |
llvm-svn: 323159
|
|
|
|
|
|
| |
for_each/for_each_n/lexicographical_compare
llvm-svn: 323147
|
|
|
|
| |
llvm-svn: 323072
|
|
|
|
|
|
| |
std::merge. merge requires std::copy, which isn't constexpr yet.
llvm-svn: 323070
|
|
|
|
|
|
| |
binary_search
llvm-svn: 322529
|
|
|
|
|
|
| |
should have been 'bool'. Fix that. It doesn't change the behavior of any of the tests, but it's more accurate.
llvm-svn: 322505
|
|
|
|
|
|
| |
and <utility>. This commit is all the is_XXX algorithms.
llvm-svn: 322489
|
|
|
|
| |
llvm-svn: 316917
|
|
|
|
|
|
| |
Yaroshevskiy for both the bug report and the fix.
llvm-svn: 316914
|
|
|
|
| |
llvm-svn: 311967
|
|
|
|
|
|
| |
Dörrie for the suggested fix.
llvm-svn: 311952
|
|
|
|
| |
llvm-svn: 309464
|
|
|
|
| |
llvm-svn: 300625
|
|
|
|
|
|
| |
in c++17. Use shuffle() instead. No change to libc++, just the tests.
llvm-svn: 294328
|
|
|
|
| |
llvm-svn: 289363
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
loss of data", part 6/7.
test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp
(Affects 64-bit architectures.) Include <cstddef> so we can take/return std::ptrdiff_t
(instead of int) in random_shuffle()'s RNG. (C++14 D.12 [depr.alg.random.shuffle]/2 says that
difference_type is used, and we're shuffling a plain array.)
test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp
test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp
(Affects 64-bit architectures.) Include <iterator> because we're already using iterator_traits.
Then, store the result of subtracting two RanIts as difference_type instead of long
(which truncates on LLP64 architectures like MSVC x64).
test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_flist.pass.cpp
test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_one.pass.cpp
(Affects 64-bit architectures.) Include <cstddef> so we can store the result of
subtracting two pointers as std::ptrdiff_t (instead of int).
test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp
(Affects 32-bit architectures.) Sometimes, size_t is too small. That's the case here,
where tellg() returns pos_type (N4606 27.7.2.3 [istream.unformatted]/39). Implementations can
have 64-bit pos_type (to handle large files) even when they have 32-bit size_t.
Fixes D27543.
llvm-svn: 289110
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
part 12/12.
Various changes:
test/std/algorithms/alg.sorting/alg.merge/inplace_merge.pass.cpp
This is comparing value_type to unsigned. value_type is sometimes int and sometimes struct S (implicitly constructible from int).
static_cast<value_type>(unsigned) silences the warning and doesn't do anything bad (as the values in question are small).
test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
This is comparing an int remote-element to size_t. The values in question are small and non-negative,
so either type is fine. I think that converting int to size_t is marginally better here than the reverse.
test/std/containers/sequences/deque/deque.cons/size.pass.cpp
DefaultOnly::count is int (and non-negative). When comparing to unsigned, use static_cast<unsigned>.
test/std/strings/basic.string/string.access/index.pass.cpp
We're comparing char to '0' through '9', but formed with the type size_t. Add static_cast<char>.
test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
Include <cstddef> for pedantic correctness (this test was already mentioning std::size_t).
"v[i] == (i & 1)" was comparing bool to size_t. Saying "v[i] == ((i & 1) != 0)" smashes the RHS to bool.
llvm-svn: 288749
|
|
|
|
|
|
|
|
|
|
|
|
| |
part 10/12.
Add static_cast<int>. In these cases, the values are guaranteed to be small-ish,
and they're being compared to int elements.
test/std/containers/sequences/deque/deque.capacity/access.pass.cpp
Use int instead of unsigned to iterate from 0 to 10.
llvm-svn: 288747
|
|
|
|
| |
llvm-svn: 287829
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
part 5/12.
Various changes:
test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp
Change M from unsigned to int. It's compared against "int x",
and we binary_search() for it within a vector<int>.
test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp
test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval_param.pass.cpp
Add static_cast<unsigned> when comparing int to unsigned.
test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
Change unsigned indices to int when we're being given int as a bound.
llvm-svn: 287825
|
|
|
|
|
|
|
|
| |
part 3/12.
Change unsigned to int in parameters.
llvm-svn: 287823
|
|
|
|
|
|
|
|
|
|
| |
part 2/12.
Add static_cast<std::size_t> when comparing int to std::size_t.
Also, include <cstddef> when it wasn't already being included.
llvm-svn: 287822
|
|
|
|
|
|
|
|
|
|
| |
part 1/12.
Change loop indices from int to std::size_t.
Also, include <cstddef> when it wasn't already being included.
llvm-svn: 287820
|
|
|
|
| |
llvm-svn: 283643
|
|
|
|
|
|
| |
on result'. We already did this, just added tests
llvm-svn: 274252
|
|
|
|
|
|
| |
STL@microsoft.com
llvm-svn: 273820
|
|
|
|
|
|
|
|
|
| |
TEST_STD_VER.
This is a huge cleanup that helps make the libc++ test suite more portable.
Patch from STL@microsoft.com. Thanks STL!
llvm-svn: 272716
|
|
|
|
|
|
|
|
|
| |
Adds XFAIL/UNSUPPORTED lit tags as appropriate. Gets a clean test run
for -std=c++98 on Fedora 20.
NFC.
llvm-svn: 271741
|
|
|
|
| |
llvm-svn: 271435
|
|
|
|
| |
llvm-svn: 267852
|
|
|
|
|
|
| |
STL@microsoft.com
llvm-svn: 267844
|
|
|
|
|
|
| |
values' for C++17
llvm-svn: 262871
|
|
|
|
| |
llvm-svn: 243641
|
|
|
|
|
|
| |
and the suggested fix.
llvm-svn: 243530
|
|
|
|
| |
llvm-svn: 242626
|
|
|
|
| |
llvm-svn: 236952
|
|
|
|
| |
llvm-svn: 228840
|
|
|
|
|
|
| |
in the initializer_list
llvm-svn: 228839
|
|
|
|
|
|
| |
optimization; if either half of the merge was small (i.e, less than 9 items), it did an inplace merge rather than allocating a buffer and doing a faster/smarter merge. However, this failed to satisfy the complexity requirements in the standard. Remove that code. Add tests to check the complexity, and add the same tests for std::merge, since we are in that section of the test suite anyway.
llvm-svn: 227811
|
|
llvm-svn: 224658
|