From cf39369227def7bfc7d0428b47e452967f4d36ce Mon Sep 17 00:00:00 2001 From: Stefan Anzinger Date: Fri, 13 Dec 2019 17:40:37 +0100 Subject: [PATCH] Use opaque in AArch64ArrayAddressTest.useArrayIntLoop to prevent further optimization --- .../compiler/core/aarch64/test/AArch64ArrayAddressTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/org.graalvm.compiler.core.aarch64.test/src/org/graalvm/compiler/core/aarch64/test/AArch64ArrayAddressTest.java b/compiler/src/org.graalvm.compiler.core.aarch64.test/src/org/graalvm/compiler/core/aarch64/test/AArch64ArrayAddressTest.java index 28b9cddca8ce..e65e13454fbc 100644 --- a/compiler/src/org.graalvm.compiler.core.aarch64.test/src/org/graalvm/compiler/core/aarch64/test/AArch64ArrayAddressTest.java +++ b/compiler/src/org.graalvm.compiler.core.aarch64.test/src/org/graalvm/compiler/core/aarch64/test/AArch64ArrayAddressTest.java @@ -25,6 +25,7 @@ */ package org.graalvm.compiler.core.aarch64.test; +import org.graalvm.compiler.api.directives.GraalDirectives; import org.graalvm.compiler.lir.LIRInstruction; import org.graalvm.compiler.lir.aarch64.AArch64ArithmeticOp.ExtendedAddShiftOp; import org.junit.Test; @@ -155,7 +156,7 @@ public void testLoadAndStoreObject() { public static int useArrayInLoop(int[] arr) { int ret = 0; for (int i = 0; i < arr.length; i++) { - ret += arr[i]; + ret += GraalDirectives.opaque(arr[i]); } return ret; }