hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java
author adlertz
Fri, 24 Jan 2014 13:06:52 +0100
changeset 22804 401135897b65
parent 22196 b48393754f75
child 29678 dd2f3932c21e
permissions -rw-r--r--
8031498: Cleanup and re-factorize PhaseChaitin::build_ifg_physical Summary: Created sub-functions, added data structures, improved naming and removed unnecessary code Reviewed-by: kvn, roland, rbackman
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19532
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
     1
/*
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
     4
 *
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
     8
 *
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    13
 * accompanied this code).
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    14
 *
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    18
 *
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    21
 * questions.
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    22
 */
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    23
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    24
/*
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    25
 * @test
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    26
 * @bug 7051189 8023393
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    27
 * @summary Need to suppress info message if -Xcheck:jni is used with libjsig.so
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    28
 * @library /testlibrary
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    29
 * @run main XCheckJSig
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    30
 */
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    31
22196
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    32
import java.io.File;
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    33
import java.util.Map;
19532
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    34
import com.oracle.java.testlibrary.*;
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    35
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    36
public class XCheckJSig {
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    37
    public static void main(String args[]) throws Throwable {
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    38
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    39
        System.out.println("Regression test for bugs 7051189 and 8023393");
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    40
        if (!Platform.isSolaris() && !Platform.isLinux() && !Platform.isOSX()) {
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    41
            System.out.println("Test only applicable on Solaris, Linux, and Mac OSX, skipping");
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    42
            return;
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    43
        }
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    44
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    45
        String jdk_path = System.getProperty("test.jdk");
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    46
        String os_arch = Platform.getOsArch();
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    47
        String libjsig;
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    48
        String env_var;
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    49
        if (Platform.isOSX()) {
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    50
            env_var = "DYLD_INSERT_LIBRARIES";
22196
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    51
            libjsig = jdk_path + "/jre/lib/libjsig.dylib"; // jdk location
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    52
            if (!(new File(libjsig).exists())) {
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    53
                libjsig = jdk_path + "/lib/libjsig.dylib"; // jre location
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    54
            }
19532
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    55
        } else {
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    56
            env_var = "LD_PRELOAD";
22196
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    57
            libjsig = jdk_path + "/jre/lib/" + os_arch + "/libjsig.so"; // jdk location
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    58
            if (!(new File(libjsig).exists())) {
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    59
                libjsig = jdk_path + "/lib/" + os_arch + "/libjsig.so"; // jre location
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    60
            }
19532
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    61
        }
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    62
        // If this test fails, these might be useful to know.
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    63
        System.out.println("libjsig: " + libjsig);
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    64
        System.out.println("osArch: " + os_arch);
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    65
22196
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    66
        // Make sure the libjsig file exists.
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    67
        if (!(new File(libjsig).exists())) {
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    68
            System.out.println("File " + libjsig + " not found, skipping");
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    69
            return;
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    70
        }
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    71
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    72
        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xcheck:jni", "-version");
19532
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    73
        Map<String, String> env = pb.environment();
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    74
        env.put(env_var, libjsig);
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    75
        OutputAnalyzer output = new OutputAnalyzer(pb.start());
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    76
        output.shouldNotContain("libjsig is activated");
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    77
        output.shouldHaveExitValue(0);
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    78
22196
b48393754f75 8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents: 21769
diff changeset
    79
        pb = ProcessTools.createJavaProcessBuilder("-Xcheck:jni", "-verbose:jni", "-version");
19532
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    80
        env = pb.environment();
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    81
        env.put(env_var, libjsig);
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    82
        output = new OutputAnalyzer(pb.start());
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    83
        output.shouldContain("libjsig is activated");
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    84
        output.shouldHaveExitValue(0);
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    85
    }
6a9f968b7b05 7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff changeset
    86
}