mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8055783: Group 9e: golden files for tests in tools/javac dir
Reviewed-by: jjg, mcimadamore
This commit is contained in:
parent
3fad9f6677
commit
1f9a38f175
15 changed files with 38 additions and 215 deletions
|
@ -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 {
|
||||
|
|
2
langtools/test/tools/javac/T6306967.out
Normal file
2
langtools/test/tools/javac/T6306967.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
T6306967.java:18:28: compiler.err.var.might.not.have.been.initialized: x
|
||||
1 error
|
|
@ -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.*;
|
||||
|
|
2
langtools/test/tools/javac/T6379327.out
Normal file
2
langtools/test/tools/javac/T6379327.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
T6379327.java:19:11: compiler.err.except.never.thrown.in.try: java.lang.ClassNotFoundException
|
||||
1 error
|
|
@ -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 {}
|
||||
|
|
2
langtools/test/tools/javac/T6407257.out
Normal file
2
langtools/test/tools/javac/T6407257.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
T6407257.java:9:1: compiler.err.cyclic.inheritance: T6407257a
|
||||
1 error
|
|
@ -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 {
|
||||
|
|
2
langtools/test/tools/javac/T6663588.out
Normal file
2
langtools/test/tools/javac/T6663588.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
T6663588.java:9:8: compiler.err.cyclic.inheritance: T6663588
|
||||
1 error
|
|
@ -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;
|
||||
}
|
||||
|
|
3
langtools/test/tools/javac/UncaughtOverflow.out
Normal file
3
langtools/test/tools/javac/UncaughtOverflow.out
Normal 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
|
|
@ -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;
|
||||
}
|
|
@ -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 {
|
||||
|
||||
enum Animal {cat, dog, bird, fish};
|
||||
public static void main(String args[]) {
|
||||
enum Animal {cat, dog, bird, fish};
|
||||
Animal pet;
|
||||
|
||||
pet = Animal.cat;
|
||||
|
|
2
langtools/test/tools/javac/UseEnum.out
Normal file
2
langtools/test/tools/javac/UseEnum.out
Normal 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
|
|
@ -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
|
||||
|
|
7
langtools/test/tools/javac/VoidArray.out
Normal file
7
langtools/test/tools/javac/VoidArray.out
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue