diff options
author | 2023-10-11 14:13:05 +0100 | |
---|---|---|
committer | 2023-10-11 14:41:00 +0000 | |
commit | dbc533288a537199bdfd120dee35ae3cd3d766fa (patch) | |
tree | 6c1a9d5633085629c7944ca610252fb1ae5f9a58 | |
parent | d84c4f4d1c7bfa676371d2c30d02bc0db57f2275 (diff) |
Fix CHECKer test for no-image
Test: art/test/testrunner/testrunner.py --host --64 -b --optimizing \
--no-image -t 567-checker
Change-Id: I4afd6cbd5cb7c29a75fad0f6c321657a3eccc49d
-rw-r--r-- | test/567-checker-builder-intrinsics/src/TestSignum.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/567-checker-builder-intrinsics/src/TestSignum.java b/test/567-checker-builder-intrinsics/src/TestSignum.java index c807743b6f..818c940dac 100644 --- a/test/567-checker-builder-intrinsics/src/TestSignum.java +++ b/test/567-checker-builder-intrinsics/src/TestSignum.java @@ -102,7 +102,14 @@ public class TestSignum { private static int signBoolean(boolean x) { // Note: D8 would replace the ternary expression `x ? 1 : 0` with `x` // but explicit `if` is preserved. - int src_x; + + // Use `Integer.` here to have the clinit check now instead of later, which would block the + // optimization when run without an image. + int src_x = 0; + if (Integer.signum(src_x) == -1) { + return -1; + } + if (x) { src_x = 1; } else { |