Path: blob/master/test/hotspot/gtest/metaprogramming/test_isIntegral.cpp
41145 views
/*1* Copyright (c) 2017, 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/isIntegral.hpp"27#include "utilities/debug.hpp"2829class IsIntegralTest: AllStatic {30class A: AllStatic {};3132static const bool ii_voidptr = IsIntegral<void*>::value;33STATIC_ASSERT(!ii_voidptr);3435static const bool ii_Aptr = IsIntegral<A*>::value;36STATIC_ASSERT(!ii_Aptr);3738static const bool ii_cAptr = IsIntegral<const A*>::value;39STATIC_ASSERT(!ii_cAptr);4041static const bool ii_vAptr = IsIntegral<volatile A*>::value;42STATIC_ASSERT(!ii_vAptr);4344static const bool ii_Avptr = IsIntegral<A* volatile>::value;45STATIC_ASSERT(!ii_Avptr);4647static const bool ii_intptrt = IsIntegral<intptr_t>::value;48STATIC_ASSERT(ii_intptrt);4950static const bool ii_char = IsIntegral<char>::value;51STATIC_ASSERT(ii_char);5253static const bool ii_cintptrt = IsIntegral<const intptr_t>::value;54STATIC_ASSERT(ii_cintptrt);5556static const bool ii_vintptrt = IsIntegral<volatile intptr_t>::value;57STATIC_ASSERT(ii_vintptrt);5859static const bool ii_cvintptrt = IsIntegral<const volatile intptr_t>::value;60STATIC_ASSERT(ii_cvintptrt);61};626364