Include catched types as direct dependencies

When tracing for main dex list.
Leaving such catched exception to a secondary dex would cause a main dex
class to fail verification if it is <clinit> before MultiDex.install.

Change-Id: Ic47dd5564b9b16a29a170f33cf22a92295374922
diff --git a/src/test/examples/multidex006/ClassForMainDex.java b/src/test/examples/multidex006/ClassForMainDex.java
new file mode 100644
index 0000000..86c2e9a
--- /dev/null
+++ b/src/test/examples/multidex006/ClassForMainDex.java
@@ -0,0 +1,25 @@
+// Copyright (c) 2018, 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 multidex006;
+
+/**
+ * Class directly referenced from Activity, will be kept in main dex. The class is not referenced
+ * by <clinit> or <init>, its direct references are not kept in main dex.
+ */
+public class ClassForMainDex {
+
+  public static void method1() {
+    try {
+      doNothing();
+    } catch (NotThrownException e) {
+      // ignore
+    }
+  }
+
+  public static void doNothing() {
+
+  }
+
+}
diff --git a/src/test/examples/multidex006/NotThrownException.java b/src/test/examples/multidex006/NotThrownException.java
new file mode 100644
index 0000000..4aa5e6c
--- /dev/null
+++ b/src/test/examples/multidex006/NotThrownException.java
@@ -0,0 +1,8 @@
+// Copyright (c) 2018, 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 multidex006;
+
+public class NotThrownException extends RuntimeException {
+}
diff --git a/src/test/examples/multidex006/main-dex-rules-1.txt b/src/test/examples/multidex006/main-dex-rules-1.txt
new file mode 100644
index 0000000..333d866
--- /dev/null
+++ b/src/test/examples/multidex006/main-dex-rules-1.txt
@@ -0,0 +1,6 @@
+# Copyright (c) 2018, 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 *.ClassForMainDex {
+}
\ No newline at end of file
diff --git a/src/test/examples/multidex006/ref-list-1.txt b/src/test/examples/multidex006/ref-list-1.txt
new file mode 100644
index 0000000..b39deba
--- /dev/null
+++ b/src/test/examples/multidex006/ref-list-1.txt
@@ -0,0 +1,2 @@
+Lmultidex006/ClassForMainDex;
+Lmultidex006/NotThrownException;