1 /*
   2  * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @summary C2 should use ldar, stlr and ldaxr+stlxr insns for volatile operations
  27  * @library /test/lib /
  28  *
  29  * @modules java.base/jdk.internal.misc
  30  *
  31  * @requires os.arch=="aarch64" & vm.debug == true &
  32  *           vm.flavor == "server" & !vm.graal.enabled &
  33  *           vm.gc.Shenandoah
  34  *
  35  * @build compiler.c2.aarch64.TestVolatiles
  36  *        compiler.c2.aarch64.TestVolatileLoad
  37  *        compiler.c2.aarch64.TestUnsafeVolatileLoad
  38  *        compiler.c2.aarch64.TestVolatileStore
  39  *        compiler.c2.aarch64.TestUnsafeVolatileStore
  40  *        compiler.c2.aarch64.TestUnsafeVolatileCAS
  41  *        compiler.c2.aarch64.TestUnsafeVolatileWeakCAS
  42  *        compiler.c2.aarch64.TestUnsafeVolatileCAE
  43  *        compiler.c2.aarch64.TestUnsafeVolatileGAS
  44  *        compiler.c2.aarch64.TestUnsafeVolatileGAA
  45  *
  46  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  47  *      TestVolatileLoad Shenandoah
  48  *
  49  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  50  *      TestVolatileStore Shenandoah
  51  *
  52  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  53  *      TestUnsafeVolatileLoad Shenandoah
  54  *
  55  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  56  *      TestUnsafeVolatileStore Shenandoah
  57  *
  58  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  59  *      TestUnsafeVolatileCAS Shenandoah
  60  *
  61  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  62  *      TestUnsafeVolatileWeakCAS Shenandoah
  63  *
  64  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  65  *      TestUnsafeVolatileCAE Shenandoah
  66  *
  67  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  68  *      TestUnsafeVolatileGAS Shenandoah
  69  *
  70  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  71  *      TestUnsafeVolatileGAA Shenandoah
  72  *
  73  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  74  *      TestVolatileLoad ShenandoahTraversal
  75  *
  76  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  77  *      TestVolatileStore ShenandoahTraversal
  78  *
  79  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  80  *      TestUnsafeVolatileLoad ShenandoahTraversal
  81  *
  82  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  83  *      TestUnsafeVolatileStore ShenandoahTraversal
  84  *
  85  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  86  *      TestUnsafeVolatileCAS ShenandoahTraversal
  87  *
  88  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  89  *      TestUnsafeVolatileWeakCAS ShenandoahTraversal
  90  *
  91  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  92  *      TestUnsafeVolatileCAE ShenandoahTraversal
  93  *
  94  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  95  *      TestUnsafeVolatileGAS ShenandoahTraversal
  96  *
  97  * @run driver compiler.c2.aarch64.TestVolatilesShenandoah
  98  *      TestUnsafeVolatileGAA ShenandoahTraversal
  99  *
 100  */
 101 
 102 package compiler.c2.aarch64;
 103 
 104 public class TestVolatilesShenandoah {
 105     public static void main(String args[]) throws Throwable
 106     {
 107         // delegate work to shared code
 108         new TestVolatiles().runtest(args[0], args[1]);
 109     }
 110 }