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