summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYohann Roussel <yroussel@google.com>2014-09-09 15:20:00 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-09-09 15:20:01 +0000
commit431ed35b8553cdb411733b3adefc453e88703725 (patch)
tree6018b5a45713d8c77a8115d584c37fbb08f18772
parent6702d04ba66302957b7d9fd333a80684015ee6ce (diff)
parentca1402550d9558baa7e63552962f5d357247da2e (diff)
downloadtoolchain_jack-431ed35b8553cdb411733b3adefc453e88703725.tar.gz
toolchain_jack-431ed35b8553cdb411733b3adefc453e88703725.tar.bz2
toolchain_jack-431ed35b8553cdb411733b3adefc453e88703725.zip
Merge "A test for phantom lookup conflicting with defined type." into ub-jack
-rw-r--r--jack-tests/.classpath2
-rw-r--r--jack-tests/tests/com/android/jack/lookup/test001/jack/Invoking.java27
-rw-r--r--jack-tests/tests/com/android/jack/lookup/test001/lib/I.java23
-rw-r--r--jack-tests/tests/com/android/jack/lookup/test001/liboverride/I.java23
-rw-r--r--jack/tests/com/android/jack/AllTests.java1
-rw-r--r--jack/tests/com/android/jack/LookupTest.java62
6 files changed, 137 insertions, 1 deletions
diff --git a/jack-tests/.classpath b/jack-tests/.classpath
index 2d628b0c..a8a949d9 100644
--- a/jack-tests/.classpath
+++ b/jack-tests/.classpath
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry excluding="com/android/jack/classpath/test002/lib1override/|com/android/jack/compiletime/|com/android/jack/enums/test003/link/Other.java|com/android/jack/enums/test003/link/Values.java|com/android/jack/error/test001/jack/A.java|com/android/jack/error/test002/jack/A.java|com/android/jack/java7/boxing/|com/android/jack/java7/exceptions/|com/android/jack/java7/parser/|com/android/jack/java7/switches/|com/android/jack/java7/trywithresources/|com/android/jack/nopackage/jack/" kind="src" path="tests"/>
+ <classpathentry excluding="com/android/jack/classpath/test002/lib1override/|com/android/jack/compiletime/|com/android/jack/enums/test003/link/Other.java|com/android/jack/enums/test003/link/Values.java|com/android/jack/error/test001/jack/A.java|com/android/jack/error/test002/jack/A.java|com/android/jack/java7/boxing/|com/android/jack/java7/exceptions/|com/android/jack/java7/parser/|com/android/jack/java7/switches/|com/android/jack/java7/trywithresources/|com/android/jack/nopackage/jack/|com/android/jack/lookup/test001/liboverride/" kind="src" path="tests"/>
<classpathentry kind="lib" path="libs/junit4.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/jack-tests/tests/com/android/jack/lookup/test001/jack/Invoking.java b/jack-tests/tests/com/android/jack/lookup/test001/jack/Invoking.java
new file mode 100644
index 00000000..0f5b1960
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/lookup/test001/jack/Invoking.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2014 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.lookup.test001.jack;
+
+import com.android.jack.lookup.test001.lib.I;
+
+public class Invoking {
+
+ public static void m(I i) {
+ i.m();
+ }
+
+}
diff --git a/jack-tests/tests/com/android/jack/lookup/test001/lib/I.java b/jack-tests/tests/com/android/jack/lookup/test001/lib/I.java
new file mode 100644
index 00000000..536f5fe3
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/lookup/test001/lib/I.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2014 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.lookup.test001.lib;
+
+public interface I {
+
+ void m();
+
+}
diff --git a/jack-tests/tests/com/android/jack/lookup/test001/liboverride/I.java b/jack-tests/tests/com/android/jack/lookup/test001/liboverride/I.java
new file mode 100644
index 00000000..ff506e42
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/lookup/test001/liboverride/I.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2014 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.lookup.test001.lib;
+
+public abstract class I {
+
+ public abstract void m();
+
+}
diff --git a/jack/tests/com/android/jack/AllTests.java b/jack/tests/com/android/jack/AllTests.java
index d9fdbc6a..b367f2c1 100644
--- a/jack/tests/com/android/jack/AllTests.java
+++ b/jack/tests/com/android/jack/AllTests.java
@@ -86,6 +86,7 @@ import org.junit.runners.Suite.SuiteClasses;
InnerTest.class,
InvokesTest.class,
JarjarTest.class,
+ LookupTest.class,
MainTest.class,
MarkerCollectorTest.class,
MergerAllTests.class,
diff --git a/jack/tests/com/android/jack/LookupTest.java b/jack/tests/com/android/jack/LookupTest.java
new file mode 100644
index 00000000..ddb92b3c
--- /dev/null
+++ b/jack/tests/com/android/jack/LookupTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2014 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;
+
+import com.android.jack.category.KnownBugs;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.io.File;
+
+public class LookupTest {
+
+ @Category(KnownBugs.class)
+ @Test
+ public void test001() throws Exception {
+ File lib = TestTools.createTempDir("Lookup001Lib", "");
+ TestTools.compileSourceToJack(
+ new Options(),
+ TestTools.getJackTestLibFolder("lookup/test001"),
+ TestTools.getDefaultBootclasspathString(),
+ lib,
+ false);
+
+ File libOverride = TestTools.createTempDir("Lookup001LibOverride", "");
+ TestTools.compileSourceToJack(
+ new Options(),
+ new File(TestTools.getJackTestFolder("lookup/test001"), "liboverride"),
+ TestTools.getDefaultBootclasspathString(),
+ libOverride,
+ false);
+
+ File jacks = TestTools.createTempDir("Lookup001Jacks", "");
+ TestTools.compileSourceToJack(
+ new Options(),
+ TestTools.getJackTestsWithJackFolder("lookup/test001"),
+ TestTools.getDefaultBootclasspathString() + File.pathSeparator + lib.getAbsolutePath(),
+ jacks,
+ false);
+
+ Options options = new Options();
+ options.addJayceImport(jacks);
+ options.addJayceImport(libOverride);
+ options.outZip = TestTools.createTempFile("Lookup001", ".zip");
+ Jack.run(options);
+ }
+
+}