8268094: Some vmTestbase/nsk tests fail after ACC_STRICT/strictfp changes

Reviewed-by: vlivanov, rehn
This commit is contained in:
David Holmes 2021-06-02 12:23:56 +00:00
parent 2963c9e677
commit dc19baca33
14 changed files with 13 additions and 339 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2021, 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
@ -57,8 +57,6 @@ import java.io.*;
* 4. adding <final> modifiers to 4 methods <br>
* 5. adding <synchronized> modifiers to public method <br>
* 6. adding <synchronized> modifiers to 4 methods <br>
* 7. adding <strictfp> modifiers to public method <br>
* 8. adding <strictfp> modifiers to 4 methods <br>
* The test checks two different cases for suspended debugee and not
* suspended one.
*
@ -82,8 +80,6 @@ public class redefineclasses007 {
{"newclass04","adding <final> modifiers to 4 methods"},
{"newclass05","adding <synchronized> modifiers to public method"},
{"newclass06","adding <synchronized> modifiers to 4 methods"},
{"newclass07","adding <strictfp> modifiers to public method"},
{"newclass08","adding <strictfp> modifiers to 4 methods"}
};
private final static String newClassFile = File.separator

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, 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
@ -48,8 +48,6 @@
* 4. newclass04 - adding <final> modifiers to 4 methods
* 5. newclass05 - adding <synchronized> modifiers to public method
* 6. newclass06 - adding <synchronized> modifiers to 4 methods
* 7. newclass07 - adding <strictfp> modifiers to public method
* 8. newclass08 - adding <strictfp> modifiers to 4 methods
* The test checks two different cases for suspended debugee and not
* suspended one.
* COMMENTS:
@ -67,7 +65,7 @@
* with full debug info
* @run driver nsk.share.ExtraClassesBuilder
* -g:lines,source,vars
* newclass01 newclass02 newclass03 newclass04 newclass05 newclass06 newclass07 newclass08
* newclass01 newclass02 newclass03 newclass04 newclass05 newclass06
*
* @run main/othervm
* nsk.jdi.VirtualMachine.redefineClasses.redefineclasses007
@ -79,4 +77,3 @@
* -transport.address=dynamic
* -debugee.vmkeys="${test.vm.opts} ${test.java.opts}"
*/

View File

@ -1,76 +0,0 @@
/*
* Copyright (c) 2002, 2018, 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.
*/
package nsk.jdi.VirtualMachine.redefineClasses;
import nsk.share.*;
import nsk.share.jpda.*;
import nsk.share.jdi.*;
// THIS TEST IS LINE NUMBER SENSITIVE
/**
* <code>redefineclasses007a</code> is deugee's part of the redefineclasses007.
* changing method modifiers (1 method to strictfp)
*/
public class redefineclasses007a {
public final static String brkpMethodName = "main";
public final static int brkpLineNumber = 49;
private static Log log;
public static void main (String argv[]) {
ArgumentHandler argHandler = new ArgumentHandler(argv);
log = new Log(System.err, argHandler);
IOPipe pipe = argHandler.createDebugeeIOPipe(log);
pipe.println("ready");
String instr = pipe.readln(); // brkpLineNumber
if (!instr.equals("continue")) {
log.complain("DEBUGEE> unexpected signal of debugger.");
System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);
}
instr = pipe.readln();
if (instr.equals("quit")) {
log.display("completed succesfully.");
System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE);
}
log.complain("DEBUGEE> unexpected signal of debugger.");
System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);
}
strictfp public void dummyMethod01(){
}
protected void dummyMethod02(){
}
private void dummyMethod03(){
}
void dummyMethod04() {
}
}

View File

@ -1,76 +0,0 @@
/*
* Copyright (c) 2002, 2018, 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.
*/
package nsk.jdi.VirtualMachine.redefineClasses;
import nsk.share.*;
import nsk.share.jpda.*;
import nsk.share.jdi.*;
// THIS TEST IS LINE NUMBER SENSITIVE
/**
* <code>redefineclasses007a</code> is deugee's part of the redefineclasses007.
* changing method modifiers (4 methods to strictfp)
*/
public class redefineclasses007a {
public final static String brkpMethodName = "main";
public final static int brkpLineNumber = 49;
private static Log log;
public static void main (String argv[]) {
ArgumentHandler argHandler = new ArgumentHandler(argv);
log = new Log(System.err, argHandler);
IOPipe pipe = argHandler.createDebugeeIOPipe(log);
pipe.println("ready");
String instr = pipe.readln(); // brkpLineNumber
if (!instr.equals("continue")) {
log.complain("DEBUGEE> unexpected signal of debugger.");
System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);
}
instr = pipe.readln();
if (instr.equals("quit")) {
log.display("completed succesfully.");
System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE);
}
log.complain("DEBUGEE> unexpected signal of debugger.");
System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);
}
strictfp public void dummyMethod01(){
}
strictfp protected void dummyMethod02(){
}
strictfp private void dummyMethod03(){
}
strictfp void dummyMethod04() {
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2021, 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
@ -56,8 +56,6 @@ import java.io.*;
* 4.newclass04 - adding <final> modifiers to 3 methods <br>
* 5.newclass05 - adding <synchronized> modifiers to public method <br>
* 6.newclass06 - adding <synchronized> modifiers to 3 methods <br>
* 7.newclass07 - adding <strictfp> modifiers to public method <br>
* 8.newclass08 - adding <strictfp> modifiers to 3 methods <br>
* The test checks two different cases for suspended debugee and not
* suspended one.
* When <code>canRedefineClasses()</code> is <code>false</code>, the test is
@ -80,8 +78,6 @@ public class redefineclasses008 {
{"newclass04","adding <final> modifiers to 3 methods"},
{"newclass05","adding <synchronized> modifiers to public method"},
{"newclass06","adding <synchronized> modifiers to 3 methods"},
{"newclass07","adding <strictfp> modifiers to public method"},
{"newclass08","adding <strictfp> modifiers to 3 methods"}
};
private final static String newClassFile = File.separator

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, 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
@ -47,8 +47,6 @@
* 4. newclass04 - adding <final> modifiers to 3 methods
* 5. newclass05 - adding <synchronized> modifiers to public method
* 6. newclass06 - adding <synchronized> modifiers to 3 methods
* 7. newclass07 - adding <strictfp> modifiers to public method
* 8. newclass08 - adding <strictfp> modifiers to 3 methods
* The test checks two different cases for suspended debugee and not
* suspended one.
* COMMENTS:
@ -69,7 +67,7 @@
* with full debug info
* @run driver nsk.share.ExtraClassesBuilder
* -g:lines,source,vars
* newclass01 newclass02 newclass03 newclass04 newclass05 newclass06 newclass07 newclass08
* newclass01 newclass02 newclass03 newclass04 newclass05 newclass06
*
* @run main/othervm
* nsk.jdi.VirtualMachine.redefineClasses.redefineclasses008
@ -81,4 +79,3 @@
* -transport.address=dynamic
* -debugee.vmkeys="${test.vm.opts} ${test.java.opts}"
*/

View File

@ -1,73 +0,0 @@
/*
* Copyright (c) 2002, 2018, 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.
*/
package nsk.jdi.VirtualMachine.redefineClasses;
import nsk.share.*;
import nsk.share.jpda.*;
import nsk.share.jdi.*;
// THIS TEST IS LINE NUMBER SENSITIVE
/**
* <code>redefineclasses008a</code> is deugee's part of the redefineclasses008.
* changing method modifiers (1 method to strictfp)
*/
public class redefineclasses008a {
public final static String brkpMethodName = "main";
public final static int brkpLineNumber = 49;
private static Log log;
public static void main (String argv[]) {
ArgumentHandler argHandler = new ArgumentHandler(argv);
log = new Log(System.err, argHandler);
IOPipe pipe = argHandler.createDebugeeIOPipe(log);
pipe.println("ready");
String instr = pipe.readln(); // brkpLineNumber
if (!instr.equals("continue")) {
log.complain("DEBUGEE> unexpected signal of debugger.");
System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);
}
instr = pipe.readln();
if (instr.equals("quit")) {
log.display("completed succesfully.");
System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE);
}
log.complain("DEBUGEE> unexpected signal of debugger.");
System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);
}
strictfp public void dummyMethod01(){
}
protected void dummyMethod02(){
}
private void dummyMethod03(){
}
}

View File

@ -1,73 +0,0 @@
/*
* Copyright (c) 2002, 2018, 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.
*/
package nsk.jdi.VirtualMachine.redefineClasses;
import nsk.share.*;
import nsk.share.jpda.*;
import nsk.share.jdi.*;
// THIS TEST IS LINE NUMBER SENSITIVE
/**
* <code>redefineclasses008a</code> is deugee's part of the redefineclasses008.
* changing method modifiers (3 methods to strictfp)
*/
public class redefineclasses008a {
public final static String brkpMethodName = "main";
public final static int brkpLineNumber = 49;
private static Log log;
public static void main (String argv[]) {
ArgumentHandler argHandler = new ArgumentHandler(argv);
log = new Log(System.err, argHandler);
IOPipe pipe = argHandler.createDebugeeIOPipe(log);
pipe.println("ready");
String instr = pipe.readln(); // brkpLineNumber
if (!instr.equals("continue")) {
log.complain("DEBUGEE> unexpected signal of debugger.");
System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);
}
instr = pipe.readln();
if (instr.equals("quit")) {
log.display("completed succesfully.");
System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE);
}
log.complain("DEBUGEE> unexpected signal of debugger.");
System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);
}
strictfp public void dummyMethod01(){
}
strictfp protected void dummyMethod02(){
}
strictfp private void dummyMethod03(){
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
@ -41,7 +41,6 @@ extern "C" {
#define ACC_SUPER 0x0020
#define ACC_INTERFACE 0x0200
#define ACC_ABSTRACT 0x0400
#define ACC_STRICT 0x0800
static jvmtiEnv *jvmti = NULL;
static jint result = PASSED;
@ -83,7 +82,6 @@ void printModifiers(jint mod) {
if (mod & ACC_SUPER) printf(" SUPER");
if (mod & ACC_INTERFACE) printf(" INTERFACE");
if (mod & ACC_ABSTRACT) printf(" ABSTRACT");
if (mod & ACC_STRICT) printf(" STRICT");
printf(" (0x%0x)\n", mod);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
@ -41,7 +41,6 @@ extern "C" {
#define ACC_SUPER 0x0020
#define ACC_INTERFACE 0x0200
#define ACC_ABSTRACT 0x0400
#define ACC_STRICT 0x0800
static jvmtiEnv *jvmti = NULL;
static jint result = PASSED;
@ -83,7 +82,6 @@ void printModifiers(jint mod) {
if (mod & ACC_SUPER) printf(" SUPER");
if (mod & ACC_INTERFACE) printf(" INTERFACE");
if (mod & ACC_ABSTRACT) printf(" ABSTRACT");
if (mod & ACC_STRICT) printf(" STRICT");
printf(" (0x%0x)\n", mod);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
@ -44,7 +44,6 @@ extern "C" {
#define ACC_NATIVE 0x0100
#define ACC_INTERFACE 0x0200
#define ACC_ABSTRACT 0x0400
#define ACC_STRICT 0x0800
typedef struct {
const char *name;
@ -146,7 +145,6 @@ void printModifiers(jint mod) {
if (mod & ACC_NATIVE) printf(" NATIVE");
if (mod & ACC_INTERFACE) printf(" INTERFACE");
if (mod & ACC_ABSTRACT) printf(" ABSTRACT");
if (mod & ACC_STRICT) printf(" STRICT");
printf(" (0x%0x)\n", mod);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
@ -61,10 +61,6 @@ public class methmod001 {
return c1;
}
strictfp float meth_2(float f1, float f2) {
return f1 / f2;
}
class Inn {
String fld;
public synchronized final void meth_inn(String s) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
@ -41,7 +41,6 @@ extern "C" {
#define ACC_SYNCHRONIZED 0x020
#define ACC_NATIVE 0x100
#define ACC_ABSTRACT 0x400
#define ACC_STRICT 0x800
static jvmtiEnv *jvmti = NULL;
static jvmtiEventCallbacks callbacks;
@ -57,7 +56,6 @@ void printModifiers(jint mod) {
if (mod & ACC_SYNCHRONIZED) printf(" SYNCHRONIZED");
if (mod & ACC_NATIVE) printf(" NATIVE");
if (mod & ACC_ABSTRACT) printf(" ABSTRACT");
if (mod & ACC_STRICT) printf(" STRICT");
printf(" (0x%0x)\n", mod);
}
@ -171,7 +169,6 @@ JNIEXPORT jint JNICALL Java_nsk_jvmti_GetMethodModifiers_methmod001_check(JNIEnv
checkMeth(jvmti, env, cls, "<init>", "()V", 0, ACC_PUBLIC);
checkMeth(jvmti, env, cls, "meth_1", "(C)C", 0, ACC_PRIVATE);
checkMeth(jvmti, env, cls, "meth_2", "(FF)F", 0, ACC_STRICT);
checkMeth(jvmti, env, cls, "check", "()I", 1, ACC_NATIVE | ACC_STATIC);
clsId = env->FindClass("nsk/jvmti/GetMethodModifiers/methmod001a");
checkMeth(jvmti, env, clsId, "meth_new", "()Lnsk/jvmti/GetMethodModifiers/methmod001;", 0, ACC_SYNCHRONIZED);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2021, 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
@ -62,8 +62,7 @@ enum {
ACC_NATIVE = 0x00000100,
ACC_INTERFACE = 0x00000200,
ACC_ABSTRACT = 0x00000400,
ACC_SUPER = 0x00000020,
ACC_STRICT = 0x00000800
ACC_SUPER = 0x00000020
};
/* Opcodes */