Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / utilities / meta / meta.trans / meta.trans.cv / add_cv.pass.cpp
blob2a0cb2091b4cdee3d1444d25f571ef4b7972fabb
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 // type_traits
11 // add_cv
13 #include <type_traits>
15 #include "test_macros.h"
17 template <class T, class U>
18 void test_add_cv_imp()
20 ASSERT_SAME_TYPE(const volatile U, typename std::add_cv<T>::type);
21 #if TEST_STD_VER > 11
22 ASSERT_SAME_TYPE(const volatile U, std::add_cv_t<T>);
23 #endif
26 template <class T>
27 void test_add_cv()
29 test_add_cv_imp<T, const volatile T>();
30 test_add_cv_imp<const T, const volatile T>();
31 test_add_cv_imp<volatile T, volatile const T>();
32 test_add_cv_imp<const volatile T, const volatile T>();
35 int main(int, char**)
37 test_add_cv<void>();
38 test_add_cv<int>();
39 test_add_cv<int[3]>();
40 test_add_cv<int&>();
41 test_add_cv<const int&>();
42 test_add_cv<int*>();
43 test_add_cv<const int*>();
45 return 0;