Path: blob/master/test/hotspot/gtest/metaprogramming/test_isArray.cpp
41144 views
/*1* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#include "precompiled.hpp"25#include "memory/allocation.hpp"26#include "metaprogramming/isArray.hpp"27#include "utilities/debug.hpp"2829class IsArrayTest: AllStatic {30class A: AllStatic {};3132static const bool ia_A = IsArray<A>::value;33STATIC_ASSERT(!ia_A);3435static const bool ia_Aptr = IsArray<A*>::value;36STATIC_ASSERT(!ia_Aptr);3738static const bool ia_Aarr = IsArray<A[]>::value;39STATIC_ASSERT(ia_Aarr);4041static const bool ia_Aarr10 = IsArray<A[10]>::value;42STATIC_ASSERT(ia_Aarr10);4344static const bool ia_Aptrarr10 = IsArray<A*[10]>::value;45STATIC_ASSERT(ia_Aptrarr10);4647static const bool ia_Aarr10arr10 = IsArray<A[10][10]>::value;48STATIC_ASSERT(ia_Aarr10arr10);4950static const bool ia_cAarr = IsArray<const A[]>::value;51STATIC_ASSERT(ia_cAarr);5253static const bool ia_vAarr = IsArray<volatile A[]>::value;54STATIC_ASSERT(ia_vAarr);5556static const bool ia_cAarr10 = IsArray<const A[10]>::value;57STATIC_ASSERT(ia_cAarr10);5859static const bool ia_vAarr10 = IsArray<volatile A[10]>::value;60STATIC_ASSERT(ia_vAarr10);6162static const bool ia_voidptr = IsArray<void*>::value;63STATIC_ASSERT(!ia_voidptr);6465static const bool ia_intptrt = IsArray<intptr_t>::value;66STATIC_ASSERT(!ia_intptrt);6768static const bool ia_char = IsArray<char>::value;69STATIC_ASSERT(!ia_char);70};717273