--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsChar.java Thu Sep 01 08:39:27 2016 -0700
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsChar.java Thu Sep 01 10:16:57 2016 -0700
@@ -97,9 +97,23 @@
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@Test(dataProvider = "typesProvider")
@@ -221,12 +235,64 @@
});
checkUOE(() -> {
+ char o = (char) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
char o = (char) vh.getAndAdd(array, ci, VALUE_1);
});
checkUOE(() -> {
+ char o = (char) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
char o = (char) vh.addAndGet(array, ci, VALUE_1);
});
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
+ });
}
static void testArrayUnsupported(ByteBufferSource bs, VarHandleSource vhs) {
@@ -290,12 +356,64 @@
});
checkUOE(() -> {
+ char o = (char) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
char o = (char) vh.getAndAdd(array, ci, VALUE_1);
});
checkUOE(() -> {
+ char o = (char) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
char o = (char) vh.addAndGet(array, ci, VALUE_1);
});
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
+ });
}
else {
checkUOE(() -> {
@@ -333,13 +451,64 @@
checkUOE(() -> {
char o = (char) vh.getAndSet(array, ci, VALUE_1);
});
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
checkUOE(() -> {
char o = (char) vh.getAndAdd(array, ci, VALUE_1);
});
checkUOE(() -> {
+ char o = (char) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
char o = (char) vh.addAndGet(array, ci, VALUE_1);
});
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
+ });
}
}
@@ -385,6 +554,7 @@
});
+
}
}
@@ -434,6 +604,7 @@
});
+
}
}
}
@@ -518,6 +689,7 @@
});
+
}
}
}
@@ -564,6 +736,7 @@
assertEquals(x, VALUE_2, "setOpaque char value");
}
+
}
}
}
@@ -609,6 +782,7 @@
assertEquals(x, VALUE_2, "setOpaque char value");
}
+
}
}
}