author | coleenp |
Wed, 10 May 2017 14:03:33 +0000 | |
changeset 46450 | 7a361ede7817 |
parent 40059 | c2304140ed64 |
permissions | -rw-r--r-- |
38710
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
1 |
/* |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
2 |
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
3 |
* Copyright 2016 Azul Systems, Inc. All Rights Reserved. |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
4 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
5 |
* |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
6 |
* This code is free software; you can redistribute it and/or modify it |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
7 |
* under the terms of the GNU General Public License version 2 only, as |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
8 |
* published by the Free Software Foundation. |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
9 |
* |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
14 |
* accompanied this code). |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
15 |
* |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
16 |
* You should have received a copy of the GNU General Public License version |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation, |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
19 |
* |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
21 |
* or visit www.oracle.com if you need additional information or have any |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
22 |
* questions. |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
23 |
*/ |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
24 |
|
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
25 |
/** |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
26 |
* @test TestOnSpinWaitEnableDisable |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
27 |
* @summary Test to ensure basic functioning of java.lang.Thread.onSpinWait |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
28 |
* @bug 8157683 |
40059 | 29 |
* |
30 |
* @run main compiler.onSpinWait.TestOnSpinWaitEnableDisable |
|
31 |
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_onSpinWait |
|
32 |
* compiler.onSpinWait.TestOnSpinWaitEnableDisable |
|
38710
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
33 |
*/ |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
34 |
|
40059 | 35 |
package compiler.onSpinWait; |
36 |
||
38710
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
37 |
public class TestOnSpinWaitEnableDisable { |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
38 |
public static void main(String[] args) { |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
39 |
for (int i = 0; i < 50_000; i++) { |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
40 |
java.lang.Thread.onSpinWait(); |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
41 |
} |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
42 |
} |
899abf16bb60
8157683: Thread.onSpinWait intrinsification doesn't have sufficient test coverage
psandoz
parents:
diff
changeset
|
43 |
} |