hotspot/test/compiler/compilercontrol/logcompilation/LogTest.java
author ppunegov
Wed, 11 May 2016 20:06:38 +0300
changeset 38296 a15a5e67d500
child 39428 24cb2cb4ae0b
permissions -rw-r--r--
8150247: CompilerControl: LogCompilation testing Summary: add a test for standalone LogCompilation testing Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38296
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
     1
/*
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
     2
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
     4
 *
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
     7
 * published by the Free Software Foundation.
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
     8
 *
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    13
 * accompanied this code).
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    14
 *
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    18
 *
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    21
 * questions.
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    22
 */
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    23
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    24
/*
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    25
 * @test
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    26
 * @bug 8137167
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    27
 * @summary Tests LogCompilation executed standalone without log commands or directives
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    28
 * @modules java.base/jdk.internal.misc
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    29
 * @library /testlibrary /test/lib /compiler/testlibrary ../share /
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    30
 * @build compiler.compilercontrol.logcompilation.LogTest
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    31
 *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    32
 *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    33
 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    34
 *                              sun.hotspot.WhiteBox$WhiteBoxPermission
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    35
 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    36
 *  -XX:+UnlockDiagnosticVMOptions compiler.compilercontrol.logcompilation.LogTest
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    37
 */
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    38
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    39
package compiler.compilercontrol.logcompilation;
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    40
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    41
import compiler.compilercontrol.share.processors.LogProcessor;
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    42
import compiler.compilercontrol.share.scenario.Scenario;
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    43
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    44
public class LogTest {
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    45
    public static void main(String[] args) {
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    46
        Scenario.Builder builder = Scenario.getBuilder();
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    47
        builder.addFlag("-XX:+UnlockDiagnosticVMOptions");
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    48
        builder.addFlag("-XX:+LogCompilation");
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    49
        builder.addFlag("-XX:LogFile=" + LogProcessor.LOG_FILE);
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    50
        Scenario scenario = builder.build();
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    51
        scenario.execute();
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    52
    }
a15a5e67d500 8150247: CompilerControl: LogCompilation testing
ppunegov
parents:
diff changeset
    53
}