< prev index next >
test/gc/shenandoah/compiler/TestMaybeNullUnsafeAccess.java
Print this page
rev 10715 : [backport] Cleanup up superfluous newlines
rev 10772 : [backport] Update copyrights
rev 10782 : [backport] Shenandoah should @require Shenandoah, @key gc, and have good @test
rev 10786 : [backport] Reformat Shenandoah tests
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2017, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
@@ -20,20 +20,23 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
- * @test
+ * @test TestMaybeNullUnsafeAccess
* @summary cast on before unsafe access moved in dominating null check null path causes crash
- *
+ * @key gc
* @library /testlibrary
+ *
* @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation TestMaybeNullUnsafeAccess
*
*/
import sun.misc.Unsafe;
+
import java.lang.reflect.Field;
+
import com.oracle.java.testlibrary.*;
public class TestMaybeNullUnsafeAccess {
static final sun.misc.Unsafe UNSAFE = Utils.getUnsafe();
@@ -51,14 +54,13 @@
throw new RuntimeException(e);
}
}
static A test_helper(Object o) {
- return (A)o;
+ return (A) o;
}
-
static int test(Object o) {
int f = 0;
for (int i = 0; i < 100; i++) {
A a = test_helper(o);
f = UNSAFE.getInt(a, F_OFFSET);
< prev index next >