test.exp: New file.

* libjava.lang/test.exp: New file.
	* libjava.lang/err9.out: New file.
	* libjava.lang/err9.java: New file.
	* libjava.lang/err8.out: New file.
	* libjava.lang/err8.java: New file.
	* libjava.lang/err7.out: New file.
	* libjava.lang/err7.java: New file.
	* libjava.lang/err6.out: New file.
	* libjava.lang/err6.java: New file.
	* libjava.lang/err5.out: New file.
	* libjava.lang/err5.java: New file.
	* libjava.lang/err4.out: New file.
	* libjava.lang/err4.java: New file.
	* libjava.lang/err3.out: New file.
	* libjava.lang/err3.java: New file.
	* libjava.lang/err2.out: New file.
	* libjava.lang/err2.java: New file.
	* libjava.lang/err13.out: New file.
	* libjava.lang/err13.java: New file.
	* libjava.lang/err12.out: New file.
	* libjava.lang/err12.java: New file.
	* libjava.lang/err11.out: New file.
	* libjava.lang/err11.java: New file.
	* libjava.lang/err10.out: New file.
	* libjava.lang/err10.java: New file.
	* libjava.lang/err1.out: New file.
	* libjava.lang/err1.java: New file.
	* libjava.lang/N19990310_5.out: New file.
	* libjava.lang/N19990310_5.java: New file.
	* libjava.lang/N19990310_4.out: New file.
	* libjava.lang/N19990310_4.java: New file.
	* libjava.lang/N19990310_3.out: New file.
	* libjava.lang/N19990310_3.java: New file.
	* libjava.lang/N19990310_02.out: New file.
	* libjava.lang/N19990310_02.java: New file.
	* libjava.lang/G19990303_02.out: New file.
	* libjava.lang/G19990303_02.java: New file.
	* libjava.lang/G19990303_01.out: New file.
	* libjava.lang/G19990303_01.java: New file.
	* libjava.lang/G19990302_02.out: New file.
	* libjava.lang/G19990302_02.java: New file.
	* libjava.lang/G19990301_01.out: New file.
	* libjava.lang/G19990301_01.java: New file.
	* libjava.compile/N19990317.java: New file.
	* libjava.compile/N19990310_01.java: New file.
	* libjava.compile/G19990225_01.java: New file.
	* libjava.compile/G19990217_02.java: New file.
	* libjava.compile/G19990217_01.java: New file.
	* libjava.compile/G19990210_3.java: New file.
	* libjava.compile/G19990210_2.java: New file.
	* libjava.compile/G19990210_1.java: New file.

From-SVN: r28087
This commit is contained in:
Tom Tromey 1999-07-13 16:20:44 +00:00 committed by Tom Tromey
parent e65132c873
commit f160279bf8
51 changed files with 752 additions and 0 deletions

View File

@ -1,3 +1,58 @@
1999-07-13 Tom Tromey <tromey@cygnus.com>
* libjava.lang/test.exp: New file.
* libjava.lang/err9.out: New file.
* libjava.lang/err9.java: New file.
* libjava.lang/err8.out: New file.
* libjava.lang/err8.java: New file.
* libjava.lang/err7.out: New file.
* libjava.lang/err7.java: New file.
* libjava.lang/err6.out: New file.
* libjava.lang/err6.java: New file.
* libjava.lang/err5.out: New file.
* libjava.lang/err5.java: New file.
* libjava.lang/err4.out: New file.
* libjava.lang/err4.java: New file.
* libjava.lang/err3.out: New file.
* libjava.lang/err3.java: New file.
* libjava.lang/err2.out: New file.
* libjava.lang/err2.java: New file.
* libjava.lang/err13.out: New file.
* libjava.lang/err13.java: New file.
* libjava.lang/err12.out: New file.
* libjava.lang/err12.java: New file.
* libjava.lang/err11.out: New file.
* libjava.lang/err11.java: New file.
* libjava.lang/err10.out: New file.
* libjava.lang/err10.java: New file.
* libjava.lang/err1.out: New file.
* libjava.lang/err1.java: New file.
* libjava.lang/N19990310_5.out: New file.
* libjava.lang/N19990310_5.java: New file.
* libjava.lang/N19990310_4.out: New file.
* libjava.lang/N19990310_4.java: New file.
* libjava.lang/N19990310_3.out: New file.
* libjava.lang/N19990310_3.java: New file.
* libjava.lang/N19990310_02.out: New file.
* libjava.lang/N19990310_02.java: New file.
* libjava.lang/G19990303_02.out: New file.
* libjava.lang/G19990303_02.java: New file.
* libjava.lang/G19990303_01.out: New file.
* libjava.lang/G19990303_01.java: New file.
* libjava.lang/G19990302_02.out: New file.
* libjava.lang/G19990302_02.java: New file.
* libjava.lang/G19990301_01.out: New file.
* libjava.lang/G19990301_01.java: New file.
* libjava.compile/N19990317.java: New file.
* libjava.compile/N19990310_01.java: New file.
* libjava.compile/G19990225_01.java: New file.
* libjava.compile/G19990217_02.java: New file.
* libjava.compile/G19990217_01.java: New file.
* libjava.compile/G19990210_3.java: New file.
* libjava.compile/G19990210_2.java: New file.
* libjava.compile/G19990210_1.java: New file.
1999-07-06 Tom Tromey <tromey@cygnus.com>
* libjava.lang/Final.xfail: Output fails, not exec.

View File

@ -0,0 +1,18 @@
/*-------------------------------------------------------------------------*/
/* File name : G19990210_1 */
/* : */
/* Cause : */
/* : */
/* Message : G19990210_1.java: In class `G19990210_1': */
/* G19990210_1.java: In method `foo()': */
/* G19990210_1.java:8: Unreachable statement. */
/* return 0; */
/* ^ */
/* 1 error */
/*-------------------------------------------------------------------------*/
public class G19990210_1 {
int foo() {
try { ; } finally { ; }
return 0;
}
}

View File

@ -0,0 +1,18 @@
/*-------------------------------------------------------------------------*/
/* File name : G19990210_2 */
/* : */
/* Cause : */
/* : */
/* Message : G19990210_2.java: In class `G19990210_2': */
/* : G19990210_2.java: In method `foo()': */
/* : G19990210_2.java:5: Missing return statement. */
/* : } */
/* : ^ */
/* : 1 error */
/*-------------------------------------------------------------------------*/
public class G19990210_2 {
public int foo () {
return 1;
;
}
}

View File

@ -0,0 +1,23 @@
/*-------------------------------------------------------------------------*/
/* File name : G19990210_3 */
/* : */
/* Cause : */
/* : */
/* Message : G19990210_3.java: In class `G19990210_3': */
/* : G19990210_3.java: In method `foo()': */
/* : G19990210_3.java:23: Invalid argument to `++'. */
/* : o.i++; */
/* : ^ */
/* : 1 error */
/*-------------------------------------------------------------------------*/
public class G19990210_3 {
static void foo() {
bar o = new bar();
synchronized(o) {
o.i++;
}
}
}
class bar {
static int i;
}

View File

@ -0,0 +1,16 @@
/*-------------------------------------------------------------------------*/
/* File name : G19990217_01 */
/* : */
/* Cause : Compiler seems to run endlessly. */
/* : */
/* Message : No message. It's not stop to compile. */
/*-------------------------------------------------------------------------*/
public class G19990217_01 {
int foo() {
try {
return 0;
}
finally { ; }
}
}

View File

@ -0,0 +1,16 @@
/*-------------------------------------------------------------------------*/
/* File name : G19990217_02 */
/* : */
/* Cause : */
/* : */
/* Message : Can't access class `foo.bar'. */
/* : Only public classes and interfaces in other packages can be */
/* : accessed. */
/* : public class G19990217_02 extends bar { */
/* : ^ */
/*-------------------------------------------------------------------------*/
package foo;
public class G19990217_02 extends bar {
}
class bar {
}

View File

@ -0,0 +1,7 @@
public class G19990225_01 {
static int foo ;
static {
foo = 0;
}
}

View File

@ -0,0 +1,18 @@
/*--------------------------------------------------------------------------*/
/* name : N19990310_01 */
/* : */
/* cause : When compare string with connected strings, error. */
/* : */
/* Message : Internal compiler error: program jc1 got */
/* : fatal signal 11 */
/*--------------------------------------------------------------------------*/
public class N19990310_01 {
public static void main(String[] args) {
if ( "Hello" == ("Hel"+"lo") ) {
}
System.out.println("OK");
}
}

View File

@ -0,0 +1,23 @@
/*--------------------------------------------------------------------------*/
/* Name : N19990317.java */
/* : */
/* Cause : When initialize valiable whose name is equal to method */
/* : return value, error. */
/* : */
/* Message : Internal compiler error: program jc1 got */
/* : fatal signal 11 */
/*--------------------------------------------------------------------------*/
class Point {}
public class N19990317 {
Point func() {
return null;
}
public static void main(String[] args) {
int Point = 2;
System.out.println("OK");
}
}

View File

@ -0,0 +1,12 @@
public class G19990301_01 {
public static void main(String args[]) {
foo pd = new foo();
System.out.println ("Pass 1");
pd.s = "test";
System.out.println ("Pass 2");
}
}
class foo {
static String s = "test";
}

View File

@ -0,0 +1,2 @@
Pass 1
Pass 2

View File

@ -0,0 +1,15 @@
public class G19990302_02 {
public static void main(String args[]) {
try {
Object[] arrayObj = new String[3];
String[] arrayStr = new String[3];
System.out.println ("Pass 1");
arrayObj[0] = arrayStr; // String object <-- String array object
System.out.println ("Pass 2");
} catch (ArrayStoreException e) {
System.out.println ("ArrayStoreException");
}
System.out.println ("Pass 3");
}
}

View File

@ -0,0 +1,3 @@
Pass 1
ArrayStoreException
Pass 3

View File

@ -0,0 +1,19 @@
public class G19990303_01
{
public static void main (String[] args)
{
try
{
Object[] ar = new String[3];
String[] as = new String[3];
System.out.println("1");
ar[0] = as;
System.out.println("2");
}
catch (Exception _)
{
System.out.println("X");
}
System.out.println("3");
}
}

View File

@ -0,0 +1,3 @@
1
X
3

View File

@ -0,0 +1,19 @@
public class G19990303_02
{
public static void main (String[] args)
{
int i = -1;
try
{
System.out.println ("Pass 1");
int[][][] arrayInt = new int[i][1][1];
int ii = arrayInt[i - 1][0][0];
System.out.println ("Pass 2");
}
catch (NegativeArraySizeException e)
{
System.out.println ("Pass NegativeArraySizeException");
}
System.out.println ("Pass 3");
}
}

View File

@ -0,0 +1,3 @@
Pass 1
Pass NegativeArraySizeException
Pass 3

View File

@ -0,0 +1,22 @@
/*--------------------------------------------------------------------------*/
/* Name : N19990310_02 */
/* : */
/* Cause : Array value calculation in for,while,do while loop is not */
/* : correct */
/* : */
/* Message : NG:[3]-->[2] */
/*--------------------------------------------------------------------------*/
public class N19990310_02 {
public static void main(String[] args) {
int y[] = {2};
for ( int i = 0; i < 1; i++ ) {
y[i] += 1;
if ( y[i] != 3 ) {
System.out.println("NG:[3]-->[" +y[i]+ "]");
}
else
System.out.println("OK");
}
}
}

View File

@ -0,0 +1 @@
OK

View File

@ -0,0 +1,24 @@
/*--------------------------------------------------------------------------*/
/* Name : N19990310_3 */
/* : */
/* Cause : Evaluation order miss, when make integer array. */
/* : */
/* Message : NG:[4]-->[1] */
/*--------------------------------------------------------------------------*/
public class N19990310_3 {
public static void main(String[] args) {
int x = 4;
int ary[][] = new int[x][x=1];
if ( ary.length == 4 ) {
System.out.println("OK");
} else {
System.out.println("NG:[4]-->[" +ary.length+ "]");
}
}
}

View File

@ -0,0 +1 @@
OK

View File

@ -0,0 +1,27 @@
/*--------------------------------------------------------------------------*/
/* Name : N19990310_4.java */
/* : */
/* Cause : assignment operator makes error in char,byte,short variable */
/* : */
/* Message : In class `N19990310_4': */
/* : In method `main(java.lang.String[])': */
/* : Incompatible type for `='. Explicit cast needed to convert `*/
/* : `int' to `char'. */
/* : x += (x = 3); */
/* : ^ */
/* : 1 error */
/*--------------------------------------------------------------------------*/
public class N19990310_4 {
public static void main(String[] args) {
char x = 9;
x += (x = 3);
if ( x == 12 ) {
System.out.println("OK");
} else {
System.out.println("NG");
}
}
}

View File

@ -0,0 +1 @@
OK

View File

@ -0,0 +1,29 @@
/*--------------------------------------------------------------------------*/
/* Name : N19990310_5.java */
/* : */
/* Cause : A assignment operator makes error in char,byte,short array */
/* : element */
/* : */
/* Message : In class `N19990310_5': */
/* : In method `main(java.lang.String[])': */
/* : Incompatible type for `='. Explicit cast needed to convert `*/
/* : `int' to `char'. */
/* : a[0] += (a[0] = 3); */
/* : ^ */
/* : 1 error */
/*--------------------------------------------------------------------------*/
public class N19990310_5 {
public static void main(String[] args) {
char[] a = {9};
a[0] += (a[0] = 3);
if ( a[0] == 12 ) {
System.out.println("OK");
} else {
System.out.println("NG");
}
}
}

View File

@ -0,0 +1 @@
OK

View File

@ -0,0 +1,25 @@
/*-------------------------------------------------------------------------*/
/* File name : err1.java */
/* : */
/* Cause : When I make class-type Object. */
/* : */
/* Message : Internal compiler error: program jc1 got */
/* : fatal signal 11 */
/*-------------------------------------------------------------------------*/
class A {
int counter = 100;
}
public class err1 {
public static void main(String[] args) {
A array[] = new A[10]; //err
array[0] = new A();
if ( array[0].counter == 100 ) {
System.out.println("OK");
} else {
System.out.println("NG:[100]-->[" +array[0].counter+ "]");
}
}
}

View File

@ -0,0 +1 @@
OK

View File

@ -0,0 +1,23 @@
/*--------------------------------------------------------------------------*/
/* File name : err10.java */
/* : */
/* Cause : Operator >>> doesn't work correctly when value is negative. */
/* : */
/* Message : NG : a = -2 */
/*--------------------------------------------------------------------------*/
public class err10 {
public static void main(String[] args) {
int a = -3;
a = a>>>1;
if ( a == 2147483646 ) {
System.out.println("OK");
} else {
System.out.println("NG:[2147483646]-->[" +a+ "]");
}
}
}

View File

@ -0,0 +1 @@
OK

View File

@ -0,0 +1,30 @@
/*--------------------------------------------------------------------------*/
/* File name : err11.java */
/* : */
/* Cause : If I declare both array which have more than 10 element */
/* : and switch statement, make error. */
/* : */
/* Message : err11.java:1: Missing class name. */
/* : public class err11 */
/* : ^ */
/* : err11.java:1: Class or interface declaration expected. */
/* : public class err11 */
/* : ^ */
/* : 2 errors */
/*--------------------------------------------------------------------------*/
public class err11
{
public static void main(String args[])
{
int i;
short ary1[] = {12,23,34,45,56,67,78,89,90,111};
for(i=0; i<10; i++) {
switch(ary1[i]) {
case 111 : System.out.println("OK");
default : break;
}
}
}
}

View File

@ -0,0 +1 @@
OK

View File

@ -0,0 +1,27 @@
/*--------------------------------------------------------------------------*/
/* File name : err12.java */
/* : */
/* Cause : Cast negative floating point to char makes error */
/* : */
/* Message : Internal compiler error in functi on convert_move */
/*--------------------------------------------------------------------------*/
public class err12 {
public static void main(String[] args){
char x1, x2;
float y = -10000f;
x1 = (char)y; // err
x2 = (char)-10000f; // ok
if ( x1 == x2 ) {
System.out.println("OK");
} else {
System.out.println("NG");
System.out.println("x1:[65520]-->[" +(x1-0)+"]");
System.out.println("x2:[65520]-->[" +(x2-0)+"]");
}
}
}

View File

@ -0,0 +1 @@
OK

View File

@ -0,0 +1,21 @@
/*--------------------------------------------------------------------------*/
/* File name : err13.java */
/* : */
/* Cause : Conversion from zero to String type is not correct. */
/* : */
/* Message : NG : test */
/*--------------------------------------------------------------------------*/
public class err13 {
public static void main(String[] args) {
String s = "test";
s += 0;
if ( s.equals("test0") ) {
System.out.println("OK");
} else {
System.out.println("NG : " +s);
}
}
}

View File

@ -0,0 +1 @@
OK

View File

@ -0,0 +1,28 @@
/*--------------------------------------------------------------------------*/
/* File name : err2.java */
/* : */
/* Cause : Operator "+=" error in char,byte,short type */
/* : */
/* Message : err2.java: In class `err2': */
/* : err2.java: In method `main(java.lang.String[])': */
/* : err2.java:22: Incompatible type for `='. Explicit cast */
/* : needed to convert `int' to `byte'. */
/* : a %= b; */
/* : ^ */
/* : 1 error */
/*--------------------------------------------------------------------------*/
public class err2 {
public static void main(String[] args) {
byte a = -16;
byte b = 10;
a %= b;
if ( a == -6 ) {
System.out.println("OK");
} else {
System.out.println("a = " +a);
}
}
}

View File

@ -0,0 +1 @@
OK

View File

@ -0,0 +1,34 @@
/*--------------------------------------------------------------------------*/
/* File name : err3.java */
/* : */
/* Cause : Evaluation sequence of the formula which used */
/* : the substitution operator is not performed correctly. */
/* : */
/* Message : NG1:[27]-->[9] */
/* : NG2:[27]-->[9] */
/* : */
/* Note : JLS 15.6 Evaluation Order (p305) */
/* S15.6.1 Evaluate Left-Hand Operand First */
/* : A formula should be evaluated to 9*3 instead of 3*3. */
/*--------------------------------------------------------------------------*/
public class err3 {
public static void main(String[] args) {
int x = 9;
x *= (x = 3);
if ( x == 27 ) {
System.out.println("OK1");
} else {
System.out.println("NG1:[27]-->["+x+"]");
}
int y = 9;
y = y * (y = 3);
if ( y == 27 ) {
System.out.println("OK2");
} else {
System.out.println("NG2:[27]-->["+y+"]");
}
}
}

View File

@ -0,0 +1,2 @@
OK1
OK2

View File

@ -0,0 +1,34 @@
/*--------------------------------------------------------------------------*/
/* file_name : err4.java */
/* : */
/* Cause : Evaluation of the array which used the substitution */
/* : operator is not performed correctly. */
/* : */
/* Message : NG1:[27}-->[9.0] */
/* : NG1:[27}-->[9.0] */
/*--------------------------------------------------------------------------*/
public class err4 {
public static void main(String[] args) {
// TEST1
float []a = {9f};
a[0] *= (a[0] = 3f);
if ( a[0] == 27 ) {
System.out.println("OK1");
} else {
System.out.println("NG1:[27}-->["+a[0]+"]");
}
//TEST2
float [] b = {9f};
b[0] = (float)(b[0] * (b[0] = 3f));
if ( b[0] == 27 ) {
System.out.println("OK1");
} else {
System.out.println("NG1:[27}-->["+b[0]+"]");
}
}
}

View File

@ -0,0 +1,2 @@
OK1
OK1

View File

@ -0,0 +1,35 @@
/*--------------------------------------------------------------------------*/
/* file_name : err5.java */
/* : */
/* Cause : Evaluation order of method argument is not correct. */
/* : */
/* Message : NG */
/* : a:[1]-->[2] */
/* : b:[3]-->[3] */
/* : c:[2]-->[2] */
/* : */
/* Note : JLS 15.6 Evaluation Order */
/* S15.6.4 Argument Lists are Evaluated Left-to-Right(p309) */
/* [Each argument expression appears to be fully evaluated */
/* before any part of any argument expression to its right.] */
/*--------------------------------------------------------------------------*/
public class err5 {
public static void main(String[] args) {
int x = 1;
err5 obj = new err5();
obj.print(x, x = 3, x = 2);
}
void print(int a, int b, int c) {
if ( a == 1 && b == 3 && c == 2 ) {
System.out.println("OK");
} else {
System.out.println("NG");
System.out.println("a:[1]-->["+a+"]");
System.out.println("b:[3]-->["+b+"]");
System.out.println("c:[2]-->["+c+"]");
}
}
}

View File

@ -0,0 +1 @@
OK

View File

@ -0,0 +1,26 @@
/*--------------------------------------------------------------------------*/
/* File name : err6.java */
/* : */
/* Cause : Array evaluation order */
/* : */
/* Message : NG:[1]-->[4] */
/* : */
/* Note : JLS 15.9 Array Creation Expressions (p315--) */
/* : p318 line3 */
/* :[Each dimension expression is fully evaluated */
/* : before any part of any dimension expression to its right.] */
/*--------------------------------------------------------------------------*/
public class err6 {
public static void main(String[] args) {
int[] x = { 10, 11, 12, 1, 14 };
int[] y = { 1, 2, 3, 4, 5, 6 };
if ( x[(x=y)[2]] == 1 ) {
System.out.println("OK");
} else {
System.out.println("NG:[1]-->[" +x[(x=y)[2]]+ "]");
}
}
}

View File

@ -0,0 +1 @@
OK

View File

@ -0,0 +1,23 @@
/*--------------------------------------------------------------------------*/
/* File name : err7.java */
/* : */
/* Cause : When exists both array (more than 10 elements) and */
/* "for" or "while" or "do while" statement , error. */
/* : */
/* Message : /var/tmp/cc1oQM8i.s: Assembler messages: */
/* : /var/tmp/cc1oQM8i.s:243: Fatal error: Symbol $L2 already def*/
/* : fined. */
/*--------------------------------------------------------------------------*/
public class err7 {
public static void main(String[] args) {
int[] ary = {0,1,2,3,4,5,6,7,8,9};
while ( true ) {
break;
}
System.out.println("OK");
}
}

View File

@ -0,0 +1 @@
OK

View File

@ -0,0 +1,23 @@
/*--------------------------------------------------------------------------*/
/* File name : err8.java */
/* : */
/* Cause : When "do while" statement has only "break", error. */
/* : */
/* Message : err8.java: In class `err8': xxxxxx */
/* : err8.java: In method `main(java.lang.String[])': */
/* : err8.java:20: Unreachable statement. */
/* : } while (true) ; */
/* : ^ */
/* : 1 error */
/*--------------------------------------------------------------------------*/
public class err8 {
public static void main(String[] args) {
do {
break;
} while (true) ;
System.out.println("OK");
}
}

View File

@ -0,0 +1 @@
OK

View File

@ -0,0 +1,32 @@
/*--------------------------------------------------------------------------*/
/* File name : err9.java */
/* : */
/* Cause : When I use "labeled continue" in "for"statement, error */
/* : */
/* Message : In class `err9': */
/* : In method `main(java.lang.String[])': */
/* : 22: `continue' must be in loop. */
/* : continue movehere; */
/* : ^ */
/* : 1 error */
/*--------------------------------------------------------------------------*/
public class err9 {
public static void main(String[] args) {
int y = 0;
movehere: for ( int x = 0; x < 10; x++ ) {
if ( x > 2 ) {
continue movehere;
}
y++;
}
if ( y == 3 ) {
System.out.println("OK");
} else {
System.out.println("NG:[3]-->[" +y+ "]");
}
}
}

View File

@ -0,0 +1 @@
OK