Skip to content

Commit 927aeb2

Browse files
marc-chevalierchhagedorn
authored andcommitted
8352617: IR framework test TestCompileCommandFileWriter.java runs TestCompilePhaseCollector instead of itself
Reviewed-by: chagedorn, thartmann
1 parent 0bfa636 commit 927aeb2

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/flag/TestCompileCommandFileWriter.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -38,13 +38,13 @@
3838

3939
/*
4040
* @test
41-
* @requires vm.debug == true & vm.flagless
41+
* @requires vm.flagless
4242
* @summary Test compile command file writer.
4343
* @library /test/lib /testlibrary_tests /
4444
* @build jdk.test.whitebox.WhiteBox
4545
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
46-
* @run junit/othervm -Xbootclasspath/a:. -DSkipWhiteBoxInstall=true -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
47-
* -XX:+WhiteBoxAPI compiler.lib.ir_framework.flag.TestCompilePhaseCollector
46+
* @run junit/othervm -Xbootclasspath/a:. -DSkipWhiteBoxInstall=true -XX:+UnlockDiagnosticVMOptions
47+
* -XX:+WhiteBoxAPI compiler.lib.ir_framework.flag.TestCompileCommandFileWriter
4848
*/
4949
public class TestCompileCommandFileWriter {
5050

@@ -81,6 +81,8 @@ public void testMix() throws IOException {
8181
}
8282

8383
private void check(Class<?> testClass, boolean findIdeal, boolean findOpto, CompilePhase... compilePhases) throws IOException {
84+
var compilerDirectivesFlagBuilder = new CompilerDirectivesFlagBuilder(testClass);
85+
compilerDirectivesFlagBuilder.build();
8486
try (Scanner scanner = new Scanner(Paths.get(FlagVM.TEST_VM_COMPILE_COMMANDS_FILE))) {
8587
boolean foundIdeal = false;
8688
boolean foundOpto = false;
@@ -132,29 +134,29 @@ public void test() {
132134

133135
static class OptoOnly1 {
134136
@Test
135-
@IR(failOn = IRNode.ALLOC)
137+
@IR(failOn = IRNode.FIELD_ACCESS)
136138
public void test() {
137139
}
138140
}
139141

140142
static class OptoOnly2 {
141143
@Test
142-
@IR(failOn = IRNode.ALLOC, phase = PRINT_OPTO_ASSEMBLY)
144+
@IR(failOn = IRNode.FIELD_ACCESS, phase = PRINT_OPTO_ASSEMBLY)
143145
public void test() {
144146
}
145147
}
146148

147149
static class Both1 {
148150
@Test
149151
@IR(failOn = IRNode.STORE)
150-
@IR(failOn = IRNode.ALLOC)
152+
@IR(failOn = IRNode.FIELD_ACCESS)
151153
public void test() {
152154
}
153155
}
154156

155157
static class Both2 {
156158
@Test
157-
@IR(failOn = {IRNode.STORE, IRNode. ALLOC})
159+
@IR(failOn = {IRNode.STORE, IRNode. FIELD_ACCESS})
158160
public void test() {
159161
}
160162
}
@@ -183,7 +185,7 @@ public void test() {
183185

184186
static class Mix2 {
185187
@Test
186-
@IR(failOn = IRNode.ALLOC, phase = AFTER_PARSING)
188+
@IR(failOn = IRNode.FIELD_ACCESS, phase = AFTER_PARSING)
187189
@IR(failOn = IRNode.STORE, phase = PRINT_OPTO_ASSEMBLY)
188190
public void test() {
189191
}
@@ -193,15 +195,15 @@ static class Mix3 {
193195
@Test
194196
@IR(failOn = IRNode.STORE, phase = AFTER_PARSING)
195197
@IR(failOn = IRNode.STORE, phase = PRINT_IDEAL)
196-
@IR(failOn = IRNode.ALLOC, phase = PRINT_OPTO_ASSEMBLY)
198+
@IR(failOn = IRNode.FIELD_ACCESS, phase = PRINT_OPTO_ASSEMBLY)
197199
public void test() {
198200
}
199201
}
200202

201203
static class Mix4 {
202204
@Test
203205
@IR(failOn = IRNode.STORE, phase = {AFTER_PARSING, PRINT_IDEAL})
204-
@IR(failOn = IRNode.ALLOC, phase = PRINT_OPTO_ASSEMBLY)
206+
@IR(failOn = IRNode.FIELD_ACCESS, phase = PRINT_OPTO_ASSEMBLY)
205207
public void test() {
206208
}
207209
}

0 commit comments

Comments
 (0)