hotspot/test/gc/CondCardMark/Basic.java
author fyuan
Fri, 12 Aug 2016 14:36:14 +0800
changeset 40270 738587047b89
parent 38152 80e5da81fb2c
child 40631 ed82623d7831
permissions -rw-r--r--
8161340: ProblemList.txt update for sun/security/tools/keytool/autotest.sh Summary: Remove sun/security/tools/keytool/autotest.sh from ProblemList.txt due to JDK-8130302 has been resolved Reviewed-by: weijun Contributed-by: John Jiang <sha.jiang@oracle.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31378
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
     1
/*
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
     2
 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
     4
 *
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
     7
 * published by the Free Software Foundation.
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
     8
 *
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    13
 * accompanied this code).
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    14
 *
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    18
 *
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    21
 * questions.
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    22
 */
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    23
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    24
/**
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    25
 * @test
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    26
 * @bug 8076987
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    27
 * @bug 8078438
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    28
 * @summary Verify UseCondCardMark works
38152
80e5da81fb2c 8154258: [TESTBUG] Various serviceability tests fail compilation
dsamersoff
parents: 33730
diff changeset
    29
 * @modules java.base/jdk.internal.misc
33730
30e064828045 8140189: [TESTBUG] Get rid of "@library /../../test/lib" in jtreg tests
cjplummer
parents: 31378
diff changeset
    30
 * @library /testlibrary /test/lib
31378
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    31
 * @build Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    32
 * @run main/othervm -Xint Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    33
 * @run main/othervm -Xint -XX:+UseCondCardMark Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    34
 * @run main/othervm -XX:TieredStopAtLevel=1 Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    35
 * @run main/othervm -XX:TieredStopAtLevel=1 -XX:+UseCondCardMark Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    36
 * @run main/othervm -XX:TieredStopAtLevel=4 Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    37
 * @run main/othervm -XX:TieredStopAtLevel=4 -XX:+UseCondCardMark Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    38
 * @run main/othervm -XX:-TieredCompilation Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    39
 * @run main/othervm -XX:-TieredCompilation -XX:+UseCondCardMark Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    40
*/
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    41
public class Basic {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    42
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    43
    static volatile MyObject sink;
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    44
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    45
    public static void main(String args[]) {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    46
        final int COUNT = 10000000;
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    47
        for (int c = 0; c < COUNT; c++) {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    48
             MyObject o = new MyObject();
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    49
             o.x = c;
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    50
             doStore(o);
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    51
        }
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    52
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    53
        if (sink.x != COUNT-1) {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    54
             throw new IllegalStateException("Failed");
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    55
        }
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    56
    }
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    57
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    58
    public static void doStore(MyObject o) {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    59
        sink = o;
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    60
    }
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    61
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    62
    static class MyObject {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    63
        int x;
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    64
    }
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    65
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    66
}