hotspot/test/gc/CondCardMark/Basic.java
author erikj
Thu, 14 Apr 2016 15:13:42 +0200
changeset 37299 db3b0d4c3bda
parent 33730 30e064828045
child 38152 80e5da81fb2c
permissions -rw-r--r--
8149777: Enable enhanced failure handler for "make test" Reviewed-by: ihse
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
33730
30e064828045 8140189: [TESTBUG] Get rid of "@library /../../test/lib" in jtreg tests
cjplummer
parents: 31378
diff changeset
    29
 * @library /testlibrary /test/lib
31378
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    30
 * @build Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    31
 * @run main/othervm -Xint Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    32
 * @run main/othervm -Xint -XX:+UseCondCardMark Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    33
 * @run main/othervm -XX:TieredStopAtLevel=1 Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    34
 * @run main/othervm -XX:TieredStopAtLevel=1 -XX:+UseCondCardMark Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    35
 * @run main/othervm -XX:TieredStopAtLevel=4 Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    36
 * @run main/othervm -XX:TieredStopAtLevel=4 -XX:+UseCondCardMark Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    37
 * @run main/othervm -XX:-TieredCompilation Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    38
 * @run main/othervm -XX:-TieredCompilation -XX:+UseCondCardMark Basic
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    39
*/
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    40
public class Basic {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    41
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    42
    static volatile MyObject sink;
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    43
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    44
    public static void main(String args[]) {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    45
        final int COUNT = 10000000;
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    46
        for (int c = 0; c < COUNT; c++) {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    47
             MyObject o = new MyObject();
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    48
             o.x = c;
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    49
             doStore(o);
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
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    52
        if (sink.x != COUNT-1) {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    53
             throw new IllegalStateException("Failed");
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
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    57
    public static void doStore(MyObject o) {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    58
        sink = o;
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
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    61
    static class MyObject {
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    62
        int x;
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
3d93d020e9af 8129332: Missing test case for JDK-8078438
shade
parents:
diff changeset
    65
}