@@ -281,7 +281,7 @@ private void addBaseTests() {
281
281
BaseTest baseTest = new BaseTest (test , shouldExcludeTest (m .getName ()));
282
282
allTests .add (baseTest );
283
283
if (PRINT_VALID_IR_RULES ) {
284
- irMatchRulePrinter .emitRuleEncoding (m , baseTest .isSkipped ());
284
+ irMatchRulePrinter .emitRuleEncoding (m , baseTest .isSkipped ());
285
285
}
286
286
} catch (TestFormatException e ) {
287
287
// Failure logged. Continue and report later.
@@ -462,19 +462,20 @@ private void dontCompileWithCompiler(Executable ex, Compiler compiler) {
462
462
private void applyForceCompileCommand (Executable ex ) {
463
463
ForceCompile forceCompileAnno = getAnnotation (ex , ForceCompile .class );
464
464
if (forceCompileAnno != null ) {
465
- CompLevel complevel = forceCompileAnno .value ();
466
- TestFormat .check (complevel != CompLevel .SKIP && complevel != CompLevel .WAIT_FOR_COMPILATION ,
465
+ CompLevel compLevel = forceCompileAnno .value ();
466
+ TestFormat .check (compLevel != CompLevel .SKIP && compLevel != CompLevel .WAIT_FOR_COMPILATION ,
467
467
"Cannot define compilation level SKIP or WAIT_FOR_COMPILATION in @ForceCompile at " + ex );
468
- complevel = restrictCompLevel (forceCompileAnno .value ());
468
+ compLevel = restrictCompLevel (forceCompileAnno .value ());
469
469
if (FLIP_C1_C2 ) {
470
- complevel = complevel .flipCompLevel ();
470
+ compLevel = compLevel .flipCompLevel ();
471
+ compLevel = restrictCompLevel (compLevel .flipCompLevel ());
471
472
}
472
473
if (EXCLUDE_RANDOM ) {
473
- complevel = complevel .excludeCompilationRandomly (ex );
474
+ compLevel = compLevel .excludeCompilationRandomly (ex );
474
475
}
475
- if (complevel != CompLevel .SKIP ) {
476
- enqueueForCompilation (ex , complevel );
477
- forceCompileMap .put (ex , complevel );
476
+ if (compLevel != CompLevel .SKIP ) {
477
+ enqueueForCompilation (ex , compLevel );
478
+ forceCompileMap .put (ex , compLevel );
478
479
}
479
480
}
480
481
}
@@ -504,7 +505,7 @@ private void setupDeclaredTests() {
504
505
} else {
505
506
TestFormat .checkNoThrow (!m .isAnnotationPresent (IR .class ), "Found @IR annotation on non-@Test method " + m );
506
507
TestFormat .checkNoThrow (!m .isAnnotationPresent (Warmup .class ) || getAnnotation (m , Run .class ) != null ,
507
- "Found @Warmup annotation on non-@Test or non-@Run method " + m );
508
+ "Found @Warmup annotation on non-@Test or non-@Run method " + m );
508
509
}
509
510
} catch (TestFormatException e ) {
510
511
// Failure logged. Continue and report later.
@@ -530,6 +531,7 @@ private void addDeclaredTest(Method m) {
530
531
CompLevel compLevel = restrictCompLevel (testAnno .compLevel ());
531
532
if (FLIP_C1_C2 ) {
532
533
compLevel = compLevel .flipCompLevel ();
534
+ compLevel = restrictCompLevel (compLevel .flipCompLevel ());
533
535
}
534
536
if (EXCLUDE_RANDOM ) {
535
537
compLevel = compLevel .excludeCompilationRandomly (m );
@@ -727,8 +729,8 @@ private void checkCustomRunTest(Method m, String testName, Method testMethod, De
727
729
"Cannot use @Arguments at test method " + testMethod + " in combination with @Run method " + m );
728
730
Warmup warmupAnno = getAnnotation (testMethod , Warmup .class );
729
731
TestFormat .checkNoThrow (warmupAnno == null ,
730
- "Cannot set @Warmup at @Test method " + testMethod + " when used with its @Run method "
731
- + m + ". Use @Warmup at @Run method instead." );
732
+ "Cannot set @Warmup at @Test method " + testMethod + " when used with its @Run method "
733
+ + m + ". Use @Warmup at @Run method instead." );
732
734
Test testAnno = getAnnotation (testMethod , Test .class );
733
735
TestFormat .checkNoThrow (runMode != RunMode .STANDALONE || testAnno .compLevel () == CompLevel .ANY ,
734
736
"Setting explicit compilation level for @Test method " + testMethod + " has no effect "
@@ -864,7 +866,7 @@ enum TriState {
864
866
865
867
public static void compile (Method m , CompLevel compLevel ) {
866
868
TestRun .check (compLevel != CompLevel .SKIP && compLevel != CompLevel .WAIT_FOR_COMPILATION ,
867
- "Invalid compilation request with level " + compLevel );
869
+ "Invalid compilation request with level " + compLevel );
868
870
enqueueForCompilation (m , compLevel );
869
871
}
870
872
@@ -907,7 +909,7 @@ public static void assertDeoptimizedByC2(Method m) {
907
909
*/
908
910
private static boolean notUnstableDeoptAssertion (Method m , CompLevel level ) {
909
911
return (USE_COMPILER && !XCOMP && !IGNORE_COMPILER_CONTROLS && !TEST_C1 &&
910
- (!EXCLUDE_RANDOM || WHITE_BOX .isMethodCompilable (m , level .getValue (), false )));
912
+ (!EXCLUDE_RANDOM || WHITE_BOX .isMethodCompilable (m , level .getValue (), false )));
911
913
}
912
914
913
915
public static void assertCompiledByC1 (Method m ) {
@@ -962,7 +964,7 @@ private static TriState compiledAtLevel(Method m, CompLevel level) {
962
964
default -> throw new TestRunException ("compiledAtLevel() should not be called with " + level );
963
965
}
964
966
}
965
- if (!USE_COMPILER || XCOMP || TEST_C1 || IGNORE_COMPILER_CONTROLS ||
967
+ if (!USE_COMPILER || XCOMP || TEST_C1 || IGNORE_COMPILER_CONTROLS || FLIP_C1_C2 ||
966
968
(EXCLUDE_RANDOM && !WHITE_BOX .isMethodCompilable (m , level .getValue (), false ))) {
967
969
return TriState .Maybe ;
968
970
}
0 commit comments