-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8352617: IR framework test TestCompileCommandFileWriter.java runs TestCompilePhaseCollector instead of itself #24240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. | ||
| * Copyright (c) 2022, 2025, 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 | ||
|
|
@@ -38,13 +38,13 @@ | |
|
|
||
| /* | ||
| * @test | ||
| * @requires vm.debug == true & vm.flagless | ||
| * @requires vm.flagless | ||
| * @summary Test compile command file writer. | ||
| * @library /test/lib /testlibrary_tests / | ||
| * @build jdk.test.whitebox.WhiteBox | ||
| * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox | ||
| * @run junit/othervm -Xbootclasspath/a:. -DSkipWhiteBoxInstall=true -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions | ||
| * -XX:+WhiteBoxAPI compiler.lib.ir_framework.flag.TestCompilePhaseCollector | ||
| * @run junit/othervm -Xbootclasspath/a:. -DSkipWhiteBoxInstall=true -XX:+UnlockDiagnosticVMOptions | ||
| * -XX:+WhiteBoxAPI compiler.lib.ir_framework.flag.TestCompileCommandFileWriter | ||
| */ | ||
| public class TestCompileCommandFileWriter { | ||
|
|
||
|
|
@@ -81,6 +81,8 @@ public void testMix() throws IOException { | |
| } | ||
|
|
||
| private void check(Class<?> testClass, boolean findIdeal, boolean findOpto, CompilePhase... compilePhases) throws IOException { | ||
| var compilerDirectivesFlagBuilder = new CompilerDirectivesFlagBuilder(testClass); | ||
| compilerDirectivesFlagBuilder.build(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was tempted to write since we don't use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess it's fine to go with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there is no strong preference, I'll just leave it as it is: having the variable doesn't hurt, as far as I know, and it helps slightly if one wants to debug, to make a breakpoint, to inspect the state of the object etc.. |
||
| try (Scanner scanner = new Scanner(Paths.get(FlagVM.TEST_VM_COMPILE_COMMANDS_FILE))) { | ||
| boolean foundIdeal = false; | ||
| boolean foundOpto = false; | ||
|
|
@@ -132,29 +134,29 @@ public void test() { | |
|
|
||
| static class OptoOnly1 { | ||
| @Test | ||
| @IR(failOn = IRNode.ALLOC) | ||
| @IR(failOn = IRNode.FIELD_ACCESS) | ||
| public void test() { | ||
| } | ||
| } | ||
|
|
||
| static class OptoOnly2 { | ||
| @Test | ||
| @IR(failOn = IRNode.ALLOC, phase = PRINT_OPTO_ASSEMBLY) | ||
| @IR(failOn = IRNode.FIELD_ACCESS, phase = PRINT_OPTO_ASSEMBLY) | ||
| public void test() { | ||
| } | ||
| } | ||
|
|
||
| static class Both1 { | ||
| @Test | ||
| @IR(failOn = IRNode.STORE) | ||
| @IR(failOn = IRNode.ALLOC) | ||
| @IR(failOn = IRNode.FIELD_ACCESS) | ||
| public void test() { | ||
| } | ||
| } | ||
|
|
||
| static class Both2 { | ||
| @Test | ||
| @IR(failOn = {IRNode.STORE, IRNode. ALLOC}) | ||
| @IR(failOn = {IRNode.STORE, IRNode. FIELD_ACCESS}) | ||
| public void test() { | ||
| } | ||
| } | ||
|
|
@@ -183,7 +185,7 @@ public void test() { | |
|
|
||
| static class Mix2 { | ||
| @Test | ||
| @IR(failOn = IRNode.ALLOC, phase = AFTER_PARSING) | ||
| @IR(failOn = IRNode.FIELD_ACCESS, phase = AFTER_PARSING) | ||
| @IR(failOn = IRNode.STORE, phase = PRINT_OPTO_ASSEMBLY) | ||
| public void test() { | ||
| } | ||
|
|
@@ -193,15 +195,15 @@ static class Mix3 { | |
| @Test | ||
| @IR(failOn = IRNode.STORE, phase = AFTER_PARSING) | ||
| @IR(failOn = IRNode.STORE, phase = PRINT_IDEAL) | ||
| @IR(failOn = IRNode.ALLOC, phase = PRINT_OPTO_ASSEMBLY) | ||
| @IR(failOn = IRNode.FIELD_ACCESS, phase = PRINT_OPTO_ASSEMBLY) | ||
| public void test() { | ||
| } | ||
| } | ||
|
|
||
| static class Mix4 { | ||
| @Test | ||
| @IR(failOn = IRNode.STORE, phase = {AFTER_PARSING, PRINT_IDEAL}) | ||
| @IR(failOn = IRNode.ALLOC, phase = PRINT_OPTO_ASSEMBLY) | ||
| @IR(failOn = IRNode.FIELD_ACCESS, phase = PRINT_OPTO_ASSEMBLY) | ||
| public void test() { | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.