equal
deleted
inserted
replaced
25 * @test |
25 * @test |
26 * @bug 8024039 |
26 * @bug 8024039 |
27 * @summary javac, previous solution for JDK-8022186 was incorrect |
27 * @summary javac, previous solution for JDK-8022186 was incorrect |
28 * @library /tools/lib |
28 * @library /tools/lib |
29 * @modules jdk.compiler/com.sun.tools.javac.api |
29 * @modules jdk.compiler/com.sun.tools.javac.api |
30 * jdk.compiler/com.sun.tools.javac.file |
|
31 * jdk.compiler/com.sun.tools.javac.main |
30 * jdk.compiler/com.sun.tools.javac.main |
32 * jdk.compiler/com.sun.tools.javac.util |
31 * jdk.compiler/com.sun.tools.javac.util |
33 * jdk.jdeps/com.sun.tools.classfile |
32 * jdk.jdeps/com.sun.tools.classfile |
34 * jdk.jdeps/com.sun.tools.javap |
33 * @build toolbox.ToolBox toolbox.JavacTask |
35 * @build ToolBox |
|
36 * @run main NoDeadCodeGenerationOnTrySmtTest |
34 * @run main NoDeadCodeGenerationOnTrySmtTest |
37 */ |
35 */ |
38 |
36 |
39 import java.io.File; |
37 import java.io.File; |
40 import java.nio.file.Paths; |
38 import java.nio.file.Paths; |
42 import com.sun.tools.classfile.ClassFile; |
40 import com.sun.tools.classfile.ClassFile; |
43 import com.sun.tools.classfile.Code_attribute; |
41 import com.sun.tools.classfile.Code_attribute; |
44 import com.sun.tools.classfile.Code_attribute.Exception_data; |
42 import com.sun.tools.classfile.Code_attribute.Exception_data; |
45 import com.sun.tools.classfile.Method; |
43 import com.sun.tools.classfile.Method; |
46 import com.sun.tools.javac.util.Assert; |
44 import com.sun.tools.javac.util.Assert; |
|
45 |
|
46 import toolbox.JavacTask; |
|
47 import toolbox.ToolBox; |
47 |
48 |
48 public class NoDeadCodeGenerationOnTrySmtTest { |
49 public class NoDeadCodeGenerationOnTrySmtTest { |
49 |
50 |
50 static final String testSource = |
51 static final String testSource = |
51 "public class Test {\n" + |
52 "public class Test {\n" + |
91 checkClassFile(new File(Paths.get(System.getProperty("user.dir"), |
92 checkClassFile(new File(Paths.get(System.getProperty("user.dir"), |
92 "Test.class").toUri()), methodsToLookFor); |
93 "Test.class").toUri()), methodsToLookFor); |
93 } |
94 } |
94 |
95 |
95 void compileTestClass() throws Exception { |
96 void compileTestClass() throws Exception { |
96 tb.new JavacTask() |
97 new JavacTask(tb) |
97 .sources(testSource) |
98 .sources(testSource) |
98 .run(); |
99 .run(); |
99 } |
100 } |
100 |
101 |
101 void checkClassFile(final File cfile, String[] methodsToFind) throws Exception { |
102 void checkClassFile(final File cfile, String[] methodsToFind) throws Exception { |