[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / utilities / function.objects / arithmetic.operations / modulus.pass.cpp
blob4ce6a0f325437399e42e567363df3f1e79822c89
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 // modulus
15 #include <functional>
16 #include <type_traits>
17 #include <cassert>
19 #include "test_macros.h"
21 int main(int, char**)
23 typedef std::modulus<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<int, F::result_type>::value), "" );
29 #endif
30 assert(f(36, 8) == 4);
31 #if TEST_STD_VER > 11
32 typedef std::modulus<> F2;
33 const F2 f2 = F2();
34 assert(f2(36, 8) == 4);
35 assert(f2(36L, 8) == 4);
36 assert(f2(36, 8L) == 4);
38 constexpr int foo = std::modulus<int> () (3, 2);
39 static_assert ( foo == 1, "" );
41 constexpr int bar = std::modulus<> () (3L, 2);
42 static_assert ( bar == 1, "" );
43 #endif
45 return 0;