Merge changes Ic8b327c9,I8caad537

* changes:
  Add main dex tracing test for instanceof and checkcast
  Add main dex tracing test for a new array reference
diff --git a/src/main/java/com/android/tools/r8/jar/JarRegisterEffectsVisitor.java b/src/main/java/com/android/tools/r8/jar/JarRegisterEffectsVisitor.java
index 3395753..b445efc 100644
--- a/src/main/java/com/android/tools/r8/jar/JarRegisterEffectsVisitor.java
+++ b/src/main/java/com/android/tools/r8/jar/JarRegisterEffectsVisitor.java
@@ -39,7 +39,7 @@
     if (opcode == org.objectweb.asm.Opcodes.NEW) {
       registry.registerNewInstance(type);
     } else if (opcode == Opcodes.CHECKCAST) {
-        registry.registerCheckCast(type);
+      registry.registerCheckCast(type);
     } else {
       registry.registerTypeReference(type);
     }
diff --git a/src/test/examples/multidex005/ArrayReference.java b/src/test/examples/multidex005/ArrayReference.java
new file mode 100644
index 0000000..b877486
--- /dev/null
+++ b/src/test/examples/multidex005/ArrayReference.java
@@ -0,0 +1,12 @@
+// Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+package multidex005;
+
+public class ArrayReference {
+
+  public Object directReference() {
+    return new DirectlyReferenced[1];
+  }
+}
diff --git a/src/test/examples/multidex005/CheckCastReference.java b/src/test/examples/multidex005/CheckCastReference.java
new file mode 100644
index 0000000..3e04911
--- /dev/null
+++ b/src/test/examples/multidex005/CheckCastReference.java
@@ -0,0 +1,12 @@
+// Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+package multidex005;
+
+public class CheckCastReference {
+
+  public Object directReference(Object obj) {
+    return (DirectlyReferenced) obj;
+  }
+}
diff --git a/src/test/examples/multidex005/InstanceOfReference.java b/src/test/examples/multidex005/InstanceOfReference.java
new file mode 100644
index 0000000..136deb8
--- /dev/null
+++ b/src/test/examples/multidex005/InstanceOfReference.java
@@ -0,0 +1,12 @@
+// Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+package multidex005;
+
+public class InstanceOfReference {
+
+  public boolean directReference(Object obj) {
+    return obj instanceof DirectlyReferenced;
+  }
+}
diff --git a/src/test/examples/multidex005/main-dex-rules-10.txt b/src/test/examples/multidex005/main-dex-rules-10.txt
new file mode 100644
index 0000000..1c4629f
--- /dev/null
+++ b/src/test/examples/multidex005/main-dex-rules-10.txt
@@ -0,0 +1,7 @@
+# Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+-keep public class *.CheckCastReference {
+  <init>();
+}
diff --git a/src/test/examples/multidex005/main-dex-rules-8.txt b/src/test/examples/multidex005/main-dex-rules-8.txt
new file mode 100644
index 0000000..6e86e48
--- /dev/null
+++ b/src/test/examples/multidex005/main-dex-rules-8.txt
@@ -0,0 +1,7 @@
+# Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+-keep public class *.ArrayReference {
+  <init>();
+}
diff --git a/src/test/examples/multidex005/main-dex-rules-9.txt b/src/test/examples/multidex005/main-dex-rules-9.txt
new file mode 100644
index 0000000..d27beec
--- /dev/null
+++ b/src/test/examples/multidex005/main-dex-rules-9.txt
@@ -0,0 +1,7 @@
+# Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+-keep public class *.InstanceOfReference {
+  <init>();
+}
diff --git a/src/test/examples/multidex005/ref-list-10.txt b/src/test/examples/multidex005/ref-list-10.txt
new file mode 100644
index 0000000..d110f05
--- /dev/null
+++ b/src/test/examples/multidex005/ref-list-10.txt
@@ -0,0 +1,8 @@
+Lmultidex005/CheckCastReference;
+Lmultidex005/DirectlyReferenced;
+Lmultidex005/Interface1;
+Lmultidex005/Interface2;
+Lmultidex005/Interface3;
+Lmultidex005/SuperClass;
+Lmultidex005/SuperInterface;
+Lmultidex005/SuperSuperClass;
diff --git a/src/test/examples/multidex005/ref-list-8.txt b/src/test/examples/multidex005/ref-list-8.txt
new file mode 100644
index 0000000..3937484
--- /dev/null
+++ b/src/test/examples/multidex005/ref-list-8.txt
@@ -0,0 +1,8 @@
+Lmultidex005/ArrayReference;
+Lmultidex005/DirectlyReferenced;
+Lmultidex005/Interface1;
+Lmultidex005/Interface2;
+Lmultidex005/Interface3;
+Lmultidex005/SuperClass;
+Lmultidex005/SuperInterface;
+Lmultidex005/SuperSuperClass;
diff --git a/src/test/examples/multidex005/ref-list-9.txt b/src/test/examples/multidex005/ref-list-9.txt
new file mode 100644
index 0000000..c36015f
--- /dev/null
+++ b/src/test/examples/multidex005/ref-list-9.txt
@@ -0,0 +1,8 @@
+Lmultidex005/DirectlyReferenced;
+Lmultidex005/InstanceOfReference;
+Lmultidex005/Interface1;
+Lmultidex005/Interface2;
+Lmultidex005/Interface3;
+Lmultidex005/SuperClass;
+Lmultidex005/SuperInterface;
+Lmultidex005/SuperSuperClass;
diff --git a/src/test/java/com/android/tools/r8/maindexlist/MainDexTracingTest.java b/src/test/java/com/android/tools/r8/maindexlist/MainDexTracingTest.java
index 31170d3..3e5a03a 100644
--- a/src/test/java/com/android/tools/r8/maindexlist/MainDexTracingTest.java
+++ b/src/test/java/com/android/tools/r8/maindexlist/MainDexTracingTest.java
@@ -219,6 +219,21 @@
   }
 
   @Test
+  public void traceMainDexList005_8() throws Throwable {
+    doTest5(8);
+  }
+
+  @Test
+  public void traceMainDexList005_9() throws Throwable {
+    doTest5(9);
+  }
+
+  @Test
+  public void traceMainDexList005_10() throws Throwable {
+    doTest5(10);
+  }
+
+  @Test
   public void traceMainDexList006() throws Throwable {
     doTest(
         "traceMainDexList006",