xref: /llvm-project/libcxx/test/std/experimental/simd/simd.reference/reference_alias.pass.cpp (revision e7a45c6d768b755644ce44e095332924009887a3)
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 // simd::reference::value_type
13 // simd_mask::reference::value_type
14 
15 #include "../test_utils.h"
16 #include <experimental/simd>
17 
18 namespace ex = std::experimental::parallelism_v2;
19 
20 template <class T, std::size_t>
21 struct CheckRefAlias {
22   template <class SimdAbi>
operator ()CheckRefAlias23   void operator()() {
24     static_assert(std::is_same_v<typename ex::simd<T, SimdAbi>::reference::value_type, T>);
25     static_assert(std::is_same_v<typename ex::simd_mask<T, SimdAbi>::reference::value_type, bool>);
26   }
27 };
28 
main(int,char **)29 int main(int, char**) {
30   test_all_simd_abi<CheckRefAlias>();
31   return 0;
32 }
33