summaryrefslogtreecommitdiffstats
path: root/jack-tests/tests/com/android/jack/shrob/test030
diff options
context:
space:
mode:
Diffstat (limited to 'jack-tests/tests/com/android/jack/shrob/test030')
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/dx/Tests.java35
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/info.txt2
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/jack/A.java23
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/jack/B.java20
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/jack/I.java21
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/jack/Kept.java24
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/proguard.flags0017
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001.mapping4
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/refsFlattenPackage/expected-001.txt10
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithMapping/expected-001.txt10
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithoutMapping/expected-001.txt10
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/refsRepackageClasses/expected-001.txt10
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/refsSeed/expected-001.txt7
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/refsShrinking/expected-001.txt10
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test030/test.mk25
15 files changed, 218 insertions, 0 deletions
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/dx/Tests.java b/jack-tests/tests/com/android/jack/shrob/test030/dx/Tests.java
new file mode 100644
index 0000000..da31627
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/dx/Tests.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2013 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 com.android.jack.shrob.test030.dx;
+
+
+import com.android.jack.shrob.test030.jack.B;
+import com.android.jack.shrob.test030.jack.I;
+import com.android.jack.shrob.test030.jack.Kept;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+
+public class Tests {
+
+ @Test
+ public void test() {
+ I i = new B();
+ Assert.assertEquals(5, Kept.kept(i));
+ }
+}
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/info.txt b/jack-tests/tests/com/android/jack/shrob/test030/info.txt
new file mode 100644
index 0000000..9d262e0
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/info.txt
@@ -0,0 +1,2 @@
+This test creates a class with a method m() and its subclass which implements an interface that defines a method m as well.
+Both m() methods should be kept. \ No newline at end of file
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test030/jack/A.java
new file mode 100644
index 0000000..6d7b52e
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/jack/A.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2013 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 com.android.jack.shrob.test030.jack;
+
+public class A {
+ public int m() {
+ return 5;
+ }
+}
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test030/jack/B.java
new file mode 100644
index 0000000..6d01d8c
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/jack/B.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2013 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 com.android.jack.shrob.test030.jack;
+
+public class B extends A implements I {
+}
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/jack/I.java b/jack-tests/tests/com/android/jack/shrob/test030/jack/I.java
new file mode 100644
index 0000000..549c3f2
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/jack/I.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2013 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 com.android.jack.shrob.test030.jack;
+
+public interface I {
+ int m();
+}
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/jack/Kept.java b/jack-tests/tests/com/android/jack/shrob/test030/jack/Kept.java
new file mode 100644
index 0000000..36f33b7
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/jack/Kept.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2013 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 com.android.jack.shrob.test030.jack;
+
+
+public class Kept {
+ public static int kept(I i) {
+ return i.m();
+ }
+}
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001
new file mode 100644
index 0000000..286c4f3
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001
@@ -0,0 +1,7 @@
+-keep class **.Kept {
+ *;
+}
+
+-keep class **.B {
+ *;
+} \ No newline at end of file
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001.mapping
new file mode 100644
index 0000000..a8740da
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001.mapping
@@ -0,0 +1,4 @@
+com.android.jack.shrob.test030.jack.I -> com.android.jack.shrob.test030.jack.a:
+ int m() -> a
+com.android.jack.shrob.test030.jack.A -> com.android.jack.shrob.test030.jack.b:
+ int m() -> a
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test030/refsFlattenPackage/expected-001.txt
new file mode 100644
index 0000000..d6ac978
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/refsFlattenPackage/expected-001.txt
@@ -0,0 +1,10 @@
+com.android.jack.shrob.test030.jack.Kept -> com.android.jack.shrob.test030.jack.Kept:
+ void <init>() -> <init>
+ int kept(com.android.jack.shrob.test030.jack.I) -> kept
+com.android.jack.shrob.test030.jack.I -> com.android.jack.shrob.test030.jack.V:
+ int m() -> z__
+com.android.jack.shrob.test030.jack.B -> com.android.jack.shrob.test030.jack.B:
+ void <init>() -> <init>
+com.android.jack.shrob.test030.jack.A -> com.android.jack.shrob.test030.jack.N:
+ void <init>() -> <init>
+ int m() -> z__
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithMapping/expected-001.txt
new file mode 100644
index 0000000..5ba496e
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithMapping/expected-001.txt
@@ -0,0 +1,10 @@
+com.android.jack.shrob.test030.jack.Kept -> com.android.jack.shrob.test030.jack.Kept:
+ void <init>() -> <init>
+ int kept(com.android.jack.shrob.test030.jack.I) -> kept
+com.android.jack.shrob.test030.jack.I -> com.android.jack.shrob.test030.jack.a:
+ int m() -> a
+com.android.jack.shrob.test030.jack.B -> com.android.jack.shrob.test030.jack.B:
+ void <init>() -> <init>
+com.android.jack.shrob.test030.jack.A -> com.android.jack.shrob.test030.jack.b:
+ void <init>() -> <init>
+ int m() -> a
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithoutMapping/expected-001.txt
new file mode 100644
index 0000000..d6ac978
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithoutMapping/expected-001.txt
@@ -0,0 +1,10 @@
+com.android.jack.shrob.test030.jack.Kept -> com.android.jack.shrob.test030.jack.Kept:
+ void <init>() -> <init>
+ int kept(com.android.jack.shrob.test030.jack.I) -> kept
+com.android.jack.shrob.test030.jack.I -> com.android.jack.shrob.test030.jack.V:
+ int m() -> z__
+com.android.jack.shrob.test030.jack.B -> com.android.jack.shrob.test030.jack.B:
+ void <init>() -> <init>
+com.android.jack.shrob.test030.jack.A -> com.android.jack.shrob.test030.jack.N:
+ void <init>() -> <init>
+ int m() -> z__
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test030/refsRepackageClasses/expected-001.txt
new file mode 100644
index 0000000..33ab2e4
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/refsRepackageClasses/expected-001.txt
@@ -0,0 +1,10 @@
+com.android.jack.shrob.test030.jack.A -> N:
+ void <init>() -> <init>
+ int m() -> z__
+com.android.jack.shrob.test030.jack.B -> com.android.jack.shrob.test030.jack.B:
+ void <init>() -> <init>
+com.android.jack.shrob.test030.jack.I -> V:
+ int m() -> z__
+com.android.jack.shrob.test030.jack.Kept -> com.android.jack.shrob.test030.jack.Kept:
+ void <init>() -> <init>
+ int kept(com.android.jack.shrob.test030.jack.I) -> kept
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test030/refsSeed/expected-001.txt
new file mode 100644
index 0000000..0f7bbb2
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/refsSeed/expected-001.txt
@@ -0,0 +1,7 @@
+com.android.jack.shrob.test030.jack.A: A()
+com.android.jack.shrob.test030.jack.A: int m()
+com.android.jack.shrob.test030.jack.B
+com.android.jack.shrob.test030.jack.B: B()
+com.android.jack.shrob.test030.jack.Kept
+com.android.jack.shrob.test030.jack.Kept: Kept()
+com.android.jack.shrob.test030.jack.Kept: int kept(com.android.jack.shrob.test030.jack.I)
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test030/refsShrinking/expected-001.txt
new file mode 100644
index 0000000..7332628
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/refsShrinking/expected-001.txt
@@ -0,0 +1,10 @@
+Lcom/android/jack/shrob/test030/jack/Kept;:
+<init>()V
+kept(Lcom/android/jack/shrob/test030/jack/I;)I
+Lcom/android/jack/shrob/test030/jack/I;:
+m()I
+Lcom/android/jack/shrob/test030/jack/A;:
+<init>()V
+m()I
+Lcom/android/jack/shrob/test030/jack/B;:
+<init>()V
diff --git a/jack-tests/tests/com/android/jack/shrob/test030/test.mk b/jack-tests/tests/com/android/jack/shrob/test030/test.mk
new file mode 100644
index 0000000..4bf92c6
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test030/test.mk
@@ -0,0 +1,25 @@
+# Copyright (C) 2013 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.
+
+private_path:= $(call my-dir)
+
+include $(JACK_CLEAR_VARS)
+
+JACKTEST_MODULE := shrob/test030
+JACKTEST_ARGS := --proguard-flags $(private_path)/proguard.flags001 --proguard-flags $(private_path)/../dontobfuscate.flags
+JACKTEST_WITHJACK_SRC := $(call all-java-files-under, $(abspath $(private_path)/jack/))
+JACKTEST_WITHDX_SRC := $(private_path)/dx/Tests.java
+JACKTEST_JUNIT := com.android.jack.$(subst /,.,$(JACKTEST_MODULE)).dx.Tests
+
+include $(JACK_RUN_TEST)