[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / utilities / function.objects / arithmetic.operations / transparent.pass.cpp
blob839c5aa19dab9e1530862999396598c27cec8c7f
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
10 #include <functional>
11 #include <string>
13 #include "test_macros.h"
15 template <class T>
16 struct is_transparent
18 private:
19 struct two {char lx; char lxx;};
20 template <class U> static two test(...);
21 template <class U> static char test(typename U::is_transparent* = 0);
22 public:
23 static const bool value = sizeof(test<T>(0)) == 1;
27 int main(int, char**)
29 static_assert ( !is_transparent<std::plus<int>>::value, "" );
30 static_assert ( !is_transparent<std::plus<std::string>>::value, "" );
31 static_assert ( is_transparent<std::plus<void>>::value, "" );
32 static_assert ( is_transparent<std::plus<>>::value, "" );
34 static_assert ( !is_transparent<std::minus<int>>::value, "" );
35 static_assert ( !is_transparent<std::minus<std::string>>::value, "" );
36 static_assert ( is_transparent<std::minus<void>>::value, "" );
37 static_assert ( is_transparent<std::minus<>>::value, "" );
39 static_assert ( !is_transparent<std::multiplies<int>>::value, "" );
40 static_assert ( !is_transparent<std::multiplies<std::string>>::value, "" );
41 static_assert ( is_transparent<std::multiplies<void>>::value, "" );
42 static_assert ( is_transparent<std::multiplies<>>::value, "" );
44 static_assert ( !is_transparent<std::divides<int>>::value, "" );
45 static_assert ( !is_transparent<std::divides<std::string>>::value, "" );
46 static_assert ( is_transparent<std::divides<void>>::value, "" );
47 static_assert ( is_transparent<std::divides<>>::value, "" );
49 static_assert ( !is_transparent<std::modulus<int>>::value, "" );
50 static_assert ( !is_transparent<std::modulus<std::string>>::value, "" );
51 static_assert ( is_transparent<std::modulus<void>>::value, "" );
52 static_assert ( is_transparent<std::modulus<>>::value, "" );
54 static_assert ( !is_transparent<std::negate<int>>::value, "" );
55 static_assert ( !is_transparent<std::negate<std::string>>::value, "" );
56 static_assert ( is_transparent<std::negate<void>>::value, "" );
57 static_assert ( is_transparent<std::negate<>>::value, "" );
59 return 0;