langtools/test/tools/javac/warnings/suppress/T6707032.java
author akulyakh
Thu, 21 May 2015 11:41:04 -0700
changeset 30730 d3ce7619db2c
parent 25301 e5da086c7d43
permissions -rw-r--r--
8076543: Add @modules as needed to the langtools tests Reviewed-by: jjg, shurailine
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25301
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
     1
/**
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
     3
 * @bug 6707032
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
     4
 * @summary Verify that \\@SuppressWarnings("divzero") works for constant initializers
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 25301
diff changeset
     5
 * @modules jdk.compiler/com.sun.tools.javac.api
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 25301
diff changeset
     6
 *          jdk.compiler/com.sun.tools.javac.code
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 25301
diff changeset
     7
 *          jdk.compiler/com.sun.tools.javac.file
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 25301
diff changeset
     8
 *          jdk.compiler/com.sun.tools.javac.tree
25301
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
     9
 * @build VerifySuppressWarnings
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    10
 * @compile/ref=T6707032.out -XDrawDiagnostics -Xlint:divzero T6707032.java
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    11
 * @run main VerifySuppressWarnings T6707032.java
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    12
 */
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    13
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    14
public class T6707032 {
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    15
    public static final int D1 = T6707032b.D0;
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    16
    public static final int D2 = 1/0;
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    17
}
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    18
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    19
class T6707032b {
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    20
    public static final int D0 = 1/0;
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    21
    public static final int D3 = T6707032.D2;
e5da086c7d43 6707032: Division by zero warning not suppressed properly in some cases
jlahoda
parents:
diff changeset
    22
}