[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / utilities / function.objects / comparisons / equal_to.pass.cpp
blob0a10209948912986caa61423e20681d497bd5cba
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
11 // <functional>
13 // equal_to
15 #include <functional>
16 #include <type_traits>
17 #include <cassert>
19 #include "test_macros.h"
21 int main(int, char**)
23 typedef std::equal_to<int> F;
24 const F f = F();
25 #if TEST_STD_VER <= 17
26 static_assert((std::is_same<int, F::first_argument_type>::value), "" );
27 static_assert((std::is_same<int, F::second_argument_type>::value), "" );
28 static_assert((std::is_same<bool, F::result_type>::value), "" );
29 #endif
30 assert(f(36, 36));
31 assert(!f(36, 6));
32 #if TEST_STD_VER > 11
33 typedef std::equal_to<> F2;
34 const F2 f2 = F2();
35 assert(f2(36, 36));
36 assert(!f2(36, 6));
37 assert(f2(36, 36.0));
38 assert(f2(36.0, 36L));
40 constexpr bool foo = std::equal_to<int> () (36, 36);
41 static_assert ( foo, "" );
43 constexpr bool bar = std::equal_to<> () (36.0, 36);
44 static_assert ( bar, "" );
45 #endif
47 return 0;