History log of /llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp (Results 1 – 10 of 10)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1
# c9535d7b 29-Jan-2024 Stephan T. Lavavej <stl@nuwen.net>

[libc++][test] Silence MSVC warnings (#79791)

* `libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp`
emits a bunch of warnings, all caused by what appears to be intentional
code:

[libc++][test] Silence MSVC warnings (#79791)

* `libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp`
emits a bunch of warnings, all caused by what appears to be intentional
code:
+ Silence MSVC warning C4245: conversion from `'int'` to `'wchar_t'`,
signed/unsigned mismatch
- Caused by: `test<U>(0, -1);`
+ Silence MSVC warning C4305: 'argument': truncation from `'int'` to
`'bool'`
- Caused by: `test<U>(0, -1);`
+ Silence MSVC warning C4310: cast truncates constant value
- Caused by: `test<U>(T(-129), U(-129));`
+ Silence MSVC warning C4805: `'=='`: unsafe mix of type `'char'` and
type `'bool'` in operation
- Caused by: `bool expect_match = val == to_find;`
*
`libcxx/test/std/algorithms/alg.nonmodifying/alg.fold/left_folds.pass.cpp`
+ Silence MSVC warning C4244: 'argument': conversion from `'double'` to
`'const int'`, possible loss of data
- Caused by `[](int const x, double const y) { return x + y; }`
deliberately being given `double`s to truncate.
*
`libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.pointer.pass.cpp`
+ Silence MSVC warnings about C++20 deprecated `volatile`.
- Caused by: `runtime_test< volatile T>();`

show more ...


Revision tags: llvmorg-19-init
# b203d532 23-Dec-2023 Nikolas Klauser <nikolasklauser@berlin.de>

[libc++] Optimize std::find if types are integral and have the same signedness (#70345)

Fixes #70238


# f7407411 15-Dec-2023 Nikolas Klauser <nikolasklauser@berlin.de>

[libc++] Optimize std::find for segmented iterators (#67224)

```
--------------------------------------------------------------------------
Benchmark o

[libc++] Optimize std::find for segmented iterators (#67224)

```
--------------------------------------------------------------------------
Benchmark old new
--------------------------------------------------------------------------
bm_find<std::deque<char>>/1 6.06 ns 10.6 ns
bm_find<std::deque<char>>/2 15.5 ns 10.6 ns
bm_find<std::deque<char>>/3 19.0 ns 10.6 ns
bm_find<std::deque<char>>/4 20.8 ns 10.6 ns
bm_find<std::deque<char>>/5 22.0 ns 10.6 ns
bm_find<std::deque<char>>/6 23.0 ns 10.5 ns
bm_find<std::deque<char>>/7 24.8 ns 10.7 ns
bm_find<std::deque<char>>/8 25.7 ns 10.6 ns
bm_find<std::deque<char>>/16 28.3 ns 10.6 ns
bm_find<std::deque<char>>/64 44.2 ns 27.0 ns
bm_find<std::deque<char>>/512 133 ns 37.6 ns
bm_find<std::deque<char>>/4096 867 ns 53.1 ns
bm_find<std::deque<char>>/32768 6838 ns 160 ns
bm_find<std::deque<char>>/262144 52897 ns 1495 ns
bm_find<std::deque<char>>/1048576 215621 ns 6077 ns
bm_find<std::deque<short>>/1 6.03 ns 6.28 ns
bm_find<std::deque<short>>/2 15.8 ns 15.8 ns
bm_find<std::deque<short>>/3 20.5 ns 20.3 ns
bm_find<std::deque<short>>/4 21.0 ns 21.0 ns
bm_find<std::deque<short>>/5 23.0 ns 22.1 ns
bm_find<std::deque<short>>/6 22.6 ns 23.0 ns
bm_find<std::deque<short>>/7 23.4 ns 23.7 ns
bm_find<std::deque<short>>/8 24.4 ns 24.9 ns
bm_find<std::deque<short>>/16 26.6 ns 27.2 ns
bm_find<std::deque<short>>/64 43.2 ns 40.9 ns
bm_find<std::deque<short>>/512 124 ns 90.7 ns
bm_find<std::deque<short>>/4096 845 ns 525 ns
bm_find<std::deque<short>>/32768 7273 ns 3194 ns
bm_find<std::deque<short>>/262144 53710 ns 24385 ns
bm_find<std::deque<short>>/1048576 216086 ns 96195 ns
bm_find<std::deque<int>>/1 6.03 ns 10.3 ns
bm_find<std::deque<int>>/2 15.6 ns 10.3 ns
bm_find<std::deque<int>>/3 19.1 ns 10.3 ns
bm_find<std::deque<int>>/4 22.3 ns 10.3 ns
bm_find<std::deque<int>>/5 23.5 ns 10.4 ns
bm_find<std::deque<int>>/6 23.1 ns 10.3 ns
bm_find<std::deque<int>>/7 23.7 ns 10.2 ns
bm_find<std::deque<int>>/8 24.5 ns 10.2 ns
bm_find<std::deque<int>>/16 27.9 ns 26.6 ns
bm_find<std::deque<int>>/64 42.6 ns 32.2 ns
bm_find<std::deque<int>>/512 123 ns 43.0 ns
bm_find<std::deque<int>>/4096 874 ns 93.5 ns
bm_find<std::deque<int>>/32768 7031 ns 751 ns
bm_find<std::deque<int>>/262144 57723 ns 6169 ns
bm_find<std::deque<int>>/1048576 230867 ns 35851 ns
bm_ranges_find<std::deque<char>>/1 5.97 ns 10.6 ns
bm_ranges_find<std::deque<char>>/2 16.0 ns 10.5 ns
bm_ranges_find<std::deque<char>>/3 19.5 ns 10.5 ns
bm_ranges_find<std::deque<char>>/4 21.1 ns 10.6 ns
bm_ranges_find<std::deque<char>>/5 22.8 ns 10.5 ns
bm_ranges_find<std::deque<char>>/6 22.8 ns 10.6 ns
bm_ranges_find<std::deque<char>>/7 23.4 ns 10.8 ns
bm_ranges_find<std::deque<char>>/8 24.1 ns 10.5 ns
bm_ranges_find<std::deque<char>>/16 26.9 ns 10.6 ns
bm_ranges_find<std::deque<char>>/64 50.2 ns 27.2 ns
bm_ranges_find<std::deque<char>>/512 126 ns 38.3 ns
bm_ranges_find<std::deque<char>>/4096 868 ns 53.8 ns
bm_ranges_find<std::deque<char>>/32768 6695 ns 161 ns
bm_ranges_find<std::deque<char>>/262144 54411 ns 1497 ns
bm_ranges_find<std::deque<char>>/1048576 241699 ns 6042 ns
bm_ranges_find<std::deque<short>>/1 6.39 ns 6.31 ns
bm_ranges_find<std::deque<short>>/2 15.8 ns 15.9 ns
bm_ranges_find<std::deque<short>>/3 19.0 ns 19.8 ns
bm_ranges_find<std::deque<short>>/4 20.8 ns 20.9 ns
bm_ranges_find<std::deque<short>>/5 21.8 ns 22.1 ns
bm_ranges_find<std::deque<short>>/6 23.0 ns 23.0 ns
bm_ranges_find<std::deque<short>>/7 23.2 ns 23.9 ns
bm_ranges_find<std::deque<short>>/8 23.7 ns 24.4 ns
bm_ranges_find<std::deque<short>>/16 26.6 ns 26.8 ns
bm_ranges_find<std::deque<short>>/64 43.4 ns 39.7 ns
bm_ranges_find<std::deque<short>>/512 131 ns 90.5 ns
bm_ranges_find<std::deque<short>>/4096 851 ns 523 ns
bm_ranges_find<std::deque<short>>/32768 7370 ns 3166 ns
bm_ranges_find<std::deque<short>>/262144 60778 ns 24814 ns
bm_ranges_find<std::deque<short>>/1048576 229288 ns 99273 ns
bm_ranges_find<std::deque<int>>/1 6.43 ns 10.2 ns
bm_ranges_find<std::deque<int>>/2 16.6 ns 10.2 ns
bm_ranges_find<std::deque<int>>/3 19.6 ns 10.2 ns
bm_ranges_find<std::deque<int>>/4 21.0 ns 10.2 ns
bm_ranges_find<std::deque<int>>/5 21.9 ns 10.4 ns
bm_ranges_find<std::deque<int>>/6 22.7 ns 10.2 ns
bm_ranges_find<std::deque<int>>/7 23.9 ns 10.2 ns
bm_ranges_find<std::deque<int>>/8 23.8 ns 10.2 ns
bm_ranges_find<std::deque<int>>/16 27.2 ns 27.1 ns
bm_ranges_find<std::deque<int>>/64 42.4 ns 32.4 ns
bm_ranges_find<std::deque<int>>/512 122 ns 43.0 ns
bm_ranges_find<std::deque<int>>/4096 895 ns 93.7 ns
bm_ranges_find<std::deque<int>>/32768 6890 ns 756 ns
bm_ranges_find<std::deque<int>>/262144 54025 ns 6102 ns
bm_ranges_find<std::deque<int>>/1048576 221558 ns 32783 ns
```

show more ...


# 64addd65 14-Dec-2023 Stephan T. Lavavej <stl@nuwen.net>

[libc++][test] Enhance ADDITIONAL_COMPILE_FLAGS, use TEST_MEOW_DIAGNOSTIC_IGNORED sparingly (#75317)

This is the last PR that's needed (for now) to get libc++'s tests
working with MSVC's STL.

Th

[libc++][test] Enhance ADDITIONAL_COMPILE_FLAGS, use TEST_MEOW_DIAGNOSTIC_IGNORED sparingly (#75317)

This is the last PR that's needed (for now) to get libc++'s tests
working with MSVC's STL.

The ADDITIONAL_COMPILE_FLAGS machinery is very useful, but also very
problematic for MSVC, as it doesn't understand most of Clang's compiler
options. We've been dealing with this by simply marking anything that
uses ADDITIONAL_COMPILE_FLAGS as FAIL or SKIPPED, but that creates
significant gaps in test coverage.

Fortunately, ADDITIONAL_COMPILE_FLAGS also supports "features", which
can be slightly enhanced to send Clang-compatible and MSVC-compatible
options to the right compilers.

This patch adds the gcc-style-warnings and cl-style-warnings Lit features,
and uses that to pass the appropriate warning flags to tests. It also uses
TEST_MEOW_DIAGNOSTIC_IGNORED for a few local suppressions of MSVC
warnings.

show more ...


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5
# 1fd08edd 24-May-2023 Nikolas Klauser <nikolasklauser@berlin.de>

[libc++] Forward to std::{,w}memchr in std::find

Reviewed By: #libc, ldionne

Spies: Mordante, libcxx-commits, ldionne, mikhail.ramalho

Differential Revision: https://reviews.llvm.org/D144394


Revision tags: llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1
# 773ae441 24-Apr-2021 Christopher Di Bella <cjdb@google.com>

[libcxx][nfc] prefixes test type `input_iterator` with `cpp17_`

C++20 revised the definition of what it means to be an iterator. While
all _Cpp17InputIterators_ satisfy `std::input_iterator`, the re

[libcxx][nfc] prefixes test type `input_iterator` with `cpp17_`

C++20 revised the definition of what it means to be an iterator. While
all _Cpp17InputIterators_ satisfy `std::input_iterator`, the reverse
isn't true. D100271 introduces a new test adaptor to accommodate this
new definition (`cpp20_input_iterator`).

In order to help readers immediately distinguish which input iterator
adaptor is _Cpp17InputIterator_, the current `input_iterator` adaptor
has been prefixed with `cpp17_`.

Differential Revision: https://reviews.llvm.org/D101242

show more ...


Revision tags: llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1, llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3, llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2, llvmorg-8.0.1-rc1, llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4, llvmorg-8.0.0-rc3, llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2
# 2df59c50 04-Feb-2019 JF Bastien <jfbastien@apple.com>

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

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

show more ...


Revision tags: llvmorg-8.0.0-rc1
# 57b08b09 19-Jan-2019 Chandler Carruth <chandlerc@gmail.com>

Update more file headers across all of the LLVM projects in the monorepo
to reflect the new license. These used slightly different spellings that
defeated my regular expressions.

We understand that

Update more file headers across all of the LLVM projects in the monorepo
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

show more ...


Revision tags: llvmorg-7.0.1, llvmorg-7.0.1-rc3, llvmorg-7.0.1-rc2, llvmorg-7.0.1-rc1, llvmorg-7.0.0, llvmorg-7.0.0-rc3, llvmorg-7.0.0-rc2, llvmorg-7.0.0-rc1, llvmorg-6.0.1, llvmorg-6.0.1-rc3, llvmorg-6.0.1-rc2, llvmorg-6.0.1-rc1, llvmorg-5.0.2, llvmorg-5.0.2-rc2, llvmorg-5.0.2-rc1, llvmorg-6.0.0, llvmorg-6.0.0-rc3, llvmorg-6.0.0-rc2, llvmorg-6.0.0-rc1
# 8694428e 15-Jan-2018 Marshall Clow <mclow.lists@gmail.com>

More P0202 constexpr-ifying. All the find_XXX algorithms in this commit.

llvm-svn: 322504


Revision tags: llvmorg-5.0.1, llvmorg-5.0.1-rc3, llvmorg-5.0.1-rc2, llvmorg-5.0.1-rc1, llvmorg-5.0.0, llvmorg-5.0.0-rc5, llvmorg-5.0.0-rc4, llvmorg-5.0.0-rc3, llvmorg-5.0.0-rc2, llvmorg-5.0.0-rc1, llvmorg-4.0.1, llvmorg-4.0.1-rc3, llvmorg-4.0.1-rc2, llvmorg-4.0.1-rc1, llvmorg-4.0.0, llvmorg-4.0.0-rc4, llvmorg-4.0.0-rc3, llvmorg-4.0.0-rc2, llvmorg-4.0.0-rc1, llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1, llvmorg-3.9.0, llvmorg-3.9.0-rc3, llvmorg-3.9.0-rc2, llvmorg-3.9.0-rc1, llvmorg-3.8.1, llvmorg-3.8.1-rc1, llvmorg-3.8.0, llvmorg-3.8.0-rc3, llvmorg-3.8.0-rc2, llvmorg-3.8.0-rc1, llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1, llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1, llvmorg-3.6.1, llvmorg-3.6.1-rc1, llvmorg-3.5.2, llvmorg-3.5.2-rc1, llvmorg-3.6.0, llvmorg-3.6.0-rc4, llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2, llvmorg-3.6.0-rc1
# 5a83710e 20-Dec-2014 Eric Fiselier <eric@efcs.ca>

Move test into test/std subdirectory.

llvm-svn: 224658