Merge changes from topic "vh-fences-coverage"

* changes:
  Coverage: mark VarHandles as exempt from jacoco
  Add a coverage test for VarHandle fences
diff --git a/JavaLibrary.bp b/JavaLibrary.bp
index 1223ecd..8490ded 100644
--- a/JavaLibrary.bp
+++ b/JavaLibrary.bp
@@ -279,6 +279,7 @@
             "java.lang.Object",
             "java.lang.String",
             "java.lang.invoke.MethodHandle",
+            "java.lang.invoke.VarHandle",
             "java.lang.ref.Reference",
             "java.lang.reflect.Proxy",
             "java.util.AbstractMap",
diff --git a/luni/src/test/java/libcore/java/lang/invoke/VarHandleTest.java b/luni/src/test/java/libcore/java/lang/invoke/VarHandleTest.java
new file mode 100644
index 0000000..8d373b2
--- /dev/null
+++ b/luni/src/test/java/libcore/java/lang/invoke/VarHandleTest.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package libcore.java.lang.invoke;
+
+import java.lang.invoke.VarHandle;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class VarHandleTest {
+    @Test
+    public void fences() {
+        // In theory, these should log coverage for these fences, but they are implemented
+        // as intrinsics in the runtime and the compiler.
+        VarHandle.acquireFence();
+        VarHandle.releaseFence();
+        VarHandle.fullFence();
+        VarHandle.loadLoadFence();
+        VarHandle.storeStoreFence();
+    }
+}