xref: /llvm-project/libcxx/test/std/experimental/simd/simd.class/simd_alias.pass.cpp (revision ce5652c78ac05ec2b407cc754757fa0f139a6370)
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 //===----------------------------------------------------------------------===//
8 
9 // UNSUPPORTED: c++03, c++11, c++14
10 
11 // Test the alias.
12 // template <class T, class Abi> class simd {
13 // public:
14 //   using value_type = T;
15 //   using mask_type = simd_mask<T, Abi>;
16 //   using abi_type = Abi;
17 // };
18 
19 #include "../test_utils.h"
20 #include <experimental/simd>
21 
22 namespace ex = std::experimental::parallelism_v2;
23 
24 template <class T, std::size_t>
25 struct CheckSimdAlias {
26   template <class SimdAbi>
operator ()CheckSimdAlias27   void operator()() {
28     static_assert(std::is_same_v<typename ex::simd<T, SimdAbi>::value_type, T>);
29     static_assert(std::is_same_v<typename ex::simd<T, SimdAbi>::mask_type, ex::simd_mask<T, SimdAbi>>);
30     static_assert(std::is_same_v<typename ex::simd<T, SimdAbi>::abi_type, SimdAbi>);
31   }
32 };
33 
main(int,char **)34 int main(int, char**) {
35   test_all_simd_abi<CheckSimdAlias>();
36   return 0;
37 }
38