test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesG1.java
author adinn
Fri, 29 Nov 2019 15:37:13 +0000
changeset 59326 851a389fc54d
parent 52409 87bc444ca642
permissions -rw-r--r--
8232828: AArch64: compiler/c2/aarch64/TestVolatilesG1.java fails after JDK-8225776 Reviewed-by: aph
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50874
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     1
/*
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     2
 * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     4
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     7
 * published by the Free Software Foundation.
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     8
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    13
 * accompanied this code).
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    14
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    18
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    21
 * questions.
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    22
 */
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    23
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    24
/*
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    25
 * @test
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    26
 * @summary C2 should use ldar, stlr and ldaxr+stlxr insns for volatile operations
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    27
 * @library /test/lib /
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    28
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    29
 * @modules java.base/jdk.internal.misc
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    30
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    31
 * @requires os.arch=="aarch64" & vm.debug == true &
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    32
 *           vm.flavor == "server" & !vm.graal.enabled &
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    33
 *           vm.gc.G1
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    34
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    35
 * @build compiler.c2.aarch64.TestVolatiles
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    36
 *        compiler.c2.aarch64.TestVolatileLoad
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    37
 *        compiler.c2.aarch64.TestUnsafeVolatileLoad
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    38
 *        compiler.c2.aarch64.TestVolatileStore
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    39
 *        compiler.c2.aarch64.TestUnsafeVolatileStore
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    40
 *        compiler.c2.aarch64.TestUnsafeVolatileCAS
52409
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    41
 *        compiler.c2.aarch64.TestUnsafeVolatileWeakCAS
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    42
 *        compiler.c2.aarch64.TestUnsafeVolatileCAE
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    43
 *        compiler.c2.aarch64.TestUnsafeVolatileGAS
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    44
 *        compiler.c2.aarch64.TestUnsafeVolatileGAA
50874
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    45
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    46
 * @run driver compiler.c2.aarch64.TestVolatilesG1
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    47
 *      TestVolatileLoad G1
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    48
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    49
 * @run driver compiler.c2.aarch64.TestVolatilesG1
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    50
 *      TestVolatileStore G1
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    51
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    52
 * @run driver compiler.c2.aarch64.TestVolatilesG1
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    53
 *      TestUnsafeVolatileLoad G1
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    54
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    55
 * @run driver compiler.c2.aarch64.TestVolatilesG1
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    56
 *      TestUnsafeVolatileStore G1
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    57
 *
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    58
 * @run driver compiler.c2.aarch64.TestVolatilesG1
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    59
 *      TestUnsafeVolatileCAS G1
52409
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    60
 *
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    61
 * @run driver compiler.c2.aarch64.TestVolatilesG1
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    62
 *      TestUnsafeVolatileWeakCAS G1
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    63
 *
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    64
 * @run driver compiler.c2.aarch64.TestVolatilesG1
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    65
 *      TestUnsafeVolatileCAE G1
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    66
 *
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    67
 * @run driver compiler.c2.aarch64.TestVolatilesG1
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    68
 *      TestUnsafeVolatileGAS G1
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    69
 *
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    70
 * @run driver compiler.c2.aarch64.TestVolatilesG1
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    71
 *      TestUnsafeVolatileGAA G1
50874
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    72
 */
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    73
52409
87bc444ca642 8209835: Aarch64: elide barriers on all volatile operations
roland
parents: 50874
diff changeset
    74
50874
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    75
package compiler.c2.aarch64;
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    76
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    77
public class TestVolatilesG1 {
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    78
    public static void main(String args[]) throws Throwable
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    79
    {
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    80
        // delegate work to shared code
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    81
        new TestVolatiles().runtest(args[0], args[1]);
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    82
    }
551c340ca01a 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
adinn
parents:
diff changeset
    83
}