1
1
/*
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.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
38
38
39
39
/*
40
40
* @test
41
- * @requires vm.debug == true & vm. flagless
41
+ * @requires vm.flagless
42
42
* @summary Test compile command file writer.
43
43
* @library /test/lib /testlibrary_tests /
44
44
* @build jdk.test.whitebox.WhiteBox
45
45
* @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
48
48
*/
49
49
public class TestCompileCommandFileWriter {
50
50
@@ -81,6 +81,8 @@ public void testMix() throws IOException {
81
81
}
82
82
83
83
private void check (Class <?> testClass , boolean findIdeal , boolean findOpto , CompilePhase ... compilePhases ) throws IOException {
84
+ var compilerDirectivesFlagBuilder = new CompilerDirectivesFlagBuilder (testClass );
85
+ compilerDirectivesFlagBuilder .build ();
84
86
try (Scanner scanner = new Scanner (Paths .get (FlagVM .TEST_VM_COMPILE_COMMANDS_FILE ))) {
85
87
boolean foundIdeal = false ;
86
88
boolean foundOpto = false ;
@@ -132,29 +134,29 @@ public void test() {
132
134
133
135
static class OptoOnly1 {
134
136
@ Test
135
- @ IR (failOn = IRNode .ALLOC )
137
+ @ IR (failOn = IRNode .FIELD_ACCESS )
136
138
public void test () {
137
139
}
138
140
}
139
141
140
142
static class OptoOnly2 {
141
143
@ Test
142
- @ IR (failOn = IRNode .ALLOC , phase = PRINT_OPTO_ASSEMBLY )
144
+ @ IR (failOn = IRNode .FIELD_ACCESS , phase = PRINT_OPTO_ASSEMBLY )
143
145
public void test () {
144
146
}
145
147
}
146
148
147
149
static class Both1 {
148
150
@ Test
149
151
@ IR (failOn = IRNode .STORE )
150
- @ IR (failOn = IRNode .ALLOC )
152
+ @ IR (failOn = IRNode .FIELD_ACCESS )
151
153
public void test () {
152
154
}
153
155
}
154
156
155
157
static class Both2 {
156
158
@ Test
157
- @ IR (failOn = {IRNode .STORE , IRNode . ALLOC })
159
+ @ IR (failOn = {IRNode .STORE , IRNode . FIELD_ACCESS })
158
160
public void test () {
159
161
}
160
162
}
@@ -183,7 +185,7 @@ public void test() {
183
185
184
186
static class Mix2 {
185
187
@ Test
186
- @ IR (failOn = IRNode .ALLOC , phase = AFTER_PARSING )
188
+ @ IR (failOn = IRNode .FIELD_ACCESS , phase = AFTER_PARSING )
187
189
@ IR (failOn = IRNode .STORE , phase = PRINT_OPTO_ASSEMBLY )
188
190
public void test () {
189
191
}
@@ -193,15 +195,15 @@ static class Mix3 {
193
195
@ Test
194
196
@ IR (failOn = IRNode .STORE , phase = AFTER_PARSING )
195
197
@ 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 )
197
199
public void test () {
198
200
}
199
201
}
200
202
201
203
static class Mix4 {
202
204
@ Test
203
205
@ 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 )
205
207
public void test () {
206
208
}
207
209
}
0 commit comments