8055783: Group 9e: golden files for tests in tools/javac dir

Reviewed-by: jjg, mcimadamore
This commit is contained in:
Sonali Goel 2014-10-01 14:15:40 -07:00
parent 3fad9f6677
commit 1f9a38f175
15 changed files with 38 additions and 215 deletions

View file

@ -1,32 +1,9 @@
/*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6306967
* @summary Variable x is used before initialized
* @author Wei Tao
* @compile/fail T6306967.java
* @compile/fail/ref=T6306967.out -XDrawDiagnostics T6306967.java
*/
public class T6306967 {

View file

@ -0,0 +1,2 @@
T6306967.java:18:28: compiler.err.var.might.not.have.been.initialized: x
1 error

View file

@ -1,32 +1,9 @@
/*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6379327
* @summary Erroneous catch block not detected with anonymous class declaration
* @author Peter Jones, Wei Tao
* @compile/fail T6379327.java
* @compile/fail/ref=T6379327.out -XDrawDiagnostics T6379327.java
*/
import java.security.*;

View file

@ -0,0 +1,2 @@
T6379327.java:19:11: compiler.err.except.never.thrown.in.try: java.lang.ClassNotFoundException
1 error

View file

@ -1,32 +1,9 @@
/*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6407257
* @summary javac locks up when encountering cyclic inheritance
* @author Peter von der Ah\u00e9
* @compile/fail T6407257.java
* @compile/fail/ref=T6407257.out -XDrawDiagnostics T6407257.java
*/
class T6407257a extends T6407257a {}

View file

@ -0,0 +1,2 @@
T6407257.java:9:1: compiler.err.cyclic.inheritance: T6407257a
1 error

View file

@ -1,32 +1,9 @@
/*
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 6663588
* @summary Compiler goes into infinite loop for Cyclic Inheritance test case
* @author Maurizio Cimadamore
* @compile/fail T6663588.java
* @compile/fail/ref=T6663588.out -XDrawDiagnostics T6663588.java
*/
public class T6663588<T extends T6663588.Inner> extends T6663588 {

View file

@ -0,0 +1,2 @@
T6663588.java:9:8: compiler.err.cyclic.inheritance: T6663588
1 error

View file

@ -1,36 +1,14 @@
/*
* Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4035346
* @test /nodynamiccopyright/
* @bug 4035346 4097402
* @summary Compiler used to allow this initialization, despite the overflow.
* @author turnidge
*
* @compile/fail UncaughtOverflow.java
* @compile/fail/ref=UncaughtOverflow.out -XDrawDiagnostics UncaughtOverflow.java
*/
public
class UncaughtOverflow {
int i = 100000000000;
int i1 = 100000000000;
int i2 = -2147483649;
}

View file

@ -0,0 +1,3 @@
UncaughtOverflow.java:12:14: compiler.err.int.number.too.large: 100000000000
UncaughtOverflow.java:13:15: compiler.err.int.number.too.large: -2147483649
2 errors

View file

@ -1,36 +0,0 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4097402
* @summary Compiler used to allow this initialization, despite the overflow.
* @author turnidge
*
* @compile/fail UncaughtOverflow2.java
*/
public
class UncaughtOverflow2 {
int i = -2147483649;
}

View file

@ -1,40 +1,16 @@
/*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @test /nodynamiccopyright/
* @bug 5013488
* @summary Compiler AssertionError: com.sun.tools.javac.util.Bits.incl(Bits.java:73)
*
* @compile/fail UseEnum.java
* @compile/fail/ref=UseEnum.out -XDrawDiagnostics UseEnum.java
*/
import static java.lang.System.out;
class UseEnum {
public static void main(String args[]) {
enum Animal {cat, dog, bird, fish};
public static void main(String args[]) {
Animal pet;
pet = Animal.cat;

View file

@ -0,0 +1,2 @@
UseEnum.java:19:29: compiler.err.cant.resolve.location: kindname.variable, beast, , , (compiler.misc.location: kindname.class, UseEnum, null)
1 error

View file

@ -1,33 +1,10 @@
/*
* Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @test /nodynamiccopyright/
* @bug 4034979
* @summary The compiler should never allow void[] to appear as a type
* in a program.
*
* @compile/fail VoidArray.java
* @compile/fail/ref=VoidArray.out -XDrawDiagnostics VoidArray.java
*/
public

View file

@ -0,0 +1,7 @@
VoidArray.java:12:9: compiler.err.expected: token.identifier
VoidArray.java:12:13: compiler.err.expected: token.identifier
VoidArray.java:14:9: compiler.err.expected: token.identifier
VoidArray.java:14:12: compiler.err.invalid.meth.decl.ret.type.req
VoidArray.java:14:24: compiler.err.expected: token.identifier
VoidArray.java:14:28: compiler.err.expected3: ',', ')', '['
6 errors