thrust / dependencies /libcudacxx /libcxx /test /std /language.support /cmp /cmp.weakeq /cmp.weakeq.pass.cpp
Download dependencies/libcudacxx/libcxx/test/std/language.support/cmp/cmp.weakeq/cmp.weakeq.pass.cpp from camenduru/thrust: direct link, hf CLI and curl.
- Browser
- Download file 1.78 kB
-
https://huggingface.co/camenduru/thrust/resolve/main/dependencies/libcudacxx/libcxx/test/std/language.support/cmp/cmp.weakeq/cmp.weakeq.pass.cpp
- Command line
-
hf download hf://camenduru/thrust/dependencies/libcudacxx/libcxx/test/std/language.support/cmp/cmp.weakeq/cmp.weakeq.pass.cpp
-
curl -L -o cmp.weakeq.pass.cpp https://huggingface.co/camenduru/thrust/resolve/main/dependencies/libcudacxx/libcxx/test/std/language.support/cmp/cmp.weakeq/cmp.weakeq.pass.cpp
1.78 kB
| //===----------------------------------------------------------------------===// | |
| // | |
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| // See https://llvm.org/LICENSE.txt for license information. | |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| // | |
| //===----------------------------------------------------------------------===// | |
| // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 | |
| // <compare> | |
| // class weak_equality | |
| const volatile void* volatile sink; | |
| void test_static_members() { | |
| DoNotOptimize(&std::weak_equality::equivalent); | |
| DoNotOptimize(&std::weak_equality::nonequivalent); | |
| } | |
| void test_signatures() { | |
| auto& Eq = std::weak_equality::equivalent; | |
| ASSERT_NOEXCEPT(Eq == 0); | |
| ASSERT_NOEXCEPT(0 == Eq); | |
| ASSERT_NOEXCEPT(Eq != 0); | |
| ASSERT_NOEXCEPT(0 != Eq); | |
| ASSERT_NOEXCEPT(0 <=> Eq); | |
| ASSERT_NOEXCEPT(Eq <=> 0); | |
| ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::weak_equality); | |
| ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::weak_equality); | |
| } | |
| constexpr bool test_constexpr() { | |
| auto& Eq = std::weak_equality::equivalent; | |
| auto& NEq = std::weak_equality::nonequivalent; | |
| assert((Eq == 0) == true); | |
| assert((0 == Eq) == true); | |
| assert((NEq == 0) == false); | |
| assert((0 == NEq) == false); | |
| assert((Eq != 0) == false); | |
| assert((0 != Eq) == false); | |
| assert((NEq != 0) == true); | |
| assert((0 != NEq) == true); | |
| std::weak_equality res = (Eq <=> 0); | |
| ((void)res); | |
| res = (0 <=> Eq); | |
| ((void)res); | |
| return true; | |
| } | |
| int main(int, char**) { | |
| test_static_members(); | |
| test_signatures(); | |
| static_assert(test_constexpr(), "constexpr test failed"); | |
| return 0; | |
| } | |