test/hotspot/jtreg/gc/CondCardMark/Basic.java
author jiangli
Fri, 02 Nov 2018 19:30:31 -0400
changeset 52397 1322829d1501
parent 47216 71c04702a3d5
child 53523 4c5184c56dc2
permissions -rw-r--r--
8209564: runtime/appcds/CDSandJFR.java timeout on tier6 on sparc Summary: Set timeout 500 in CDSandJFR.java Reviewed-by: dcubed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31378
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
     1
/*
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 38152
diff changeset
     2
 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
31378
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
31378
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    30
 * @run main/othervm -Xint Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    31
 * @run main/othervm -Xint -XX:+UseCondCardMark Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    32
 * @run main/othervm -XX:TieredStopAtLevel=1 Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    33
 * @run main/othervm -XX:TieredStopAtLevel=1 -XX:+UseCondCardMark Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    34
 * @run main/othervm -XX:TieredStopAtLevel=4 Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    35
 * @run main/othervm -XX:TieredStopAtLevel=4 -XX:+UseCondCardMark Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    36
 * @run main/othervm -XX:-TieredCompilation Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    37
 * @run main/othervm -XX:-TieredCompilation -XX:+UseCondCardMark Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    38
*/
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    39
public class 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
    static volatile MyObject sink;
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
    public static void main(String args[]) {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    44
        final int COUNT = 10000000;
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    45
        for (int c = 0; c < COUNT; c++) {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    46
             MyObject o = new MyObject();
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    47
             o.x = c;
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    48
             doStore(o);
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    49
        }
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    50
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    51
        if (sink.x != COUNT-1) {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    52
             throw new IllegalStateException("Failed");
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    53
        }
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    54
    }
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
    public static void doStore(MyObject o) {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    57
        sink = o;
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    58
    }
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    59
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    60
    static class MyObject {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    61
        int x;
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    62
    }
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    63
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    64
}