1 /*
2  * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.
8  *
9  * This code is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12  * version 2 for more details (a copy is included in the LICENSE file that
13  * accompanied this code).
14  *
15  * You should have received a copy of the GNU General Public License version
16  * 2 along with this work; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  *
23  */
24 
25 #include "precompiled.hpp"
26 #include "memory/allocation.hpp"
27 #include "metaprogramming/removeExtent.hpp"
28 #include "metaprogramming/isSame.hpp"
29 #include "utilities/debug.hpp"
30 
31 class RemoveExtentTest {
32   class A: AllStatic {};
33 
34   typedef A* Aptr;
35   typedef A Aarr[];
36   typedef A Aarr10[10];
37   typedef const A cA;
38   typedef const A* cAptr;
39   typedef const A cAarr[];
40   typedef const A cAarr10[10];
41 
42   typedef RemoveExtent<Aptr>::type ra_Aptr;
43   static const bool ra_Aptr_is_Aptr = IsSame<ra_Aptr, Aptr>::value;
44   STATIC_ASSERT(ra_Aptr_is_Aptr);
45 
46   typedef RemoveExtent<Aarr>::type ra_Aarr;
47   static const bool ra_Aarr_is_A = IsSame<ra_Aarr, A>::value;
48   STATIC_ASSERT(ra_Aarr_is_A);
49 
50   typedef RemoveExtent<Aarr10>::type ra_Aarr10;
51   static const bool ra_Aarr10_is_A = IsSame<ra_Aarr10, A>::value;
52   STATIC_ASSERT(ra_Aarr10_is_A);
53 
54   typedef RemoveExtent<cAptr>::type ra_cAptr;
55   static const bool ra_cAptr_is_cAptr = IsSame<ra_cAptr, cAptr>::value;
56   STATIC_ASSERT(ra_cAptr_is_cAptr);
57 
58   typedef RemoveExtent<cAarr>::type ra_cAarr;
59   static const bool ra_cAarr_is_cA = IsSame<ra_cAarr, cA>::value;
60   STATIC_ASSERT(ra_cAarr_is_cA);
61 
62   typedef RemoveExtent<cAarr10>::type ra_cAarr10;
63   static const bool ra_cAarr10_is_cA = IsSame<ra_cAarr10, cA>::value;
64   STATIC_ASSERT(ra_cAarr10_is_cA);
65 };
66