Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / utilities / meta / meta.unary / meta.unary.comp / array.pass.cpp
blobc702e3646c7b8e5606b68cddb965f1adfa99f927
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 // array
13 #include <type_traits>
15 #include "test_macros.h"
17 template <class T>
18 void test_array_imp()
20 static_assert(!std::is_reference<T>::value, "");
21 static_assert(!std::is_arithmetic<T>::value, "");
22 static_assert(!std::is_fundamental<T>::value, "");
23 static_assert( std::is_object<T>::value, "");
24 static_assert(!std::is_scalar<T>::value, "");
25 static_assert( std::is_compound<T>::value, "");
26 static_assert(!std::is_member_pointer<T>::value, "");
29 template <class T>
30 void test_array()
32 test_array_imp<T>();
33 test_array_imp<const T>();
34 test_array_imp<volatile T>();
35 test_array_imp<const volatile T>();
38 typedef char array[3];
39 typedef const char const_array[3];
40 typedef char incomplete_array[];
42 class incomplete_type;
44 int main(int, char**)
46 test_array<array>();
47 test_array<const_array>();
48 test_array<incomplete_array>();
49 test_array<incomplete_type[]>();
51 return 0;