[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / utilities / function.objects / comparisons / constexpr_init.pass.cpp
blob279aa9f850933e5355fcaf7d75ff74483ddd0488
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 // UNSUPPORTED: c++03, c++11
11 // <functional>
13 // equal_to, not_equal_to, less, et al.
15 // Test that these types can be constructed w/o an initializer in a constexpr
16 // context. This is specifically testing gcc.gnu.org/PR83921
19 #include <functional>
20 #include "test_macros.h"
22 template <class T>
23 constexpr bool test_constexpr_context() {
24 std::equal_to<T> eq;
25 ((void)eq);
26 std::not_equal_to<T> neq;
27 ((void)neq);
28 std::less<T> l;
29 ((void)l);
30 std::less_equal<T> le;
31 ((void)le);
32 std::greater<T> g;
33 ((void)g);
34 std::greater_equal<T> ge;
35 ((void)ge);
36 return true;
39 static_assert(test_constexpr_context<int>(), "");
40 static_assert(test_constexpr_context<void>(), "");
43 int main(int, char**) {
46 return 0;