summaryrefslogtreecommitdiffstats
path: root/test/449-checker-bce
diff options
context:
space:
mode:
Diffstat (limited to 'test/449-checker-bce')
-rw-r--r--test/449-checker-bce/src/Main.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/449-checker-bce/src/Main.java b/test/449-checker-bce/src/Main.java
index 9391533411..30aa870acb 100644
--- a/test/449-checker-bce/src/Main.java
+++ b/test/449-checker-bce/src/Main.java
@@ -314,6 +314,29 @@ public class Main {
array[10] = 1; // Bounds check can't be eliminated.
}
+
+ static byte readData() {
+ return 1;
+ }
+
+ // CHECK-START: void Main.circularBufferProducer() BCE (before)
+ // CHECK: BoundsCheck
+ // CHECK: ArraySet
+
+ // CHECK-START: void Main.circularBufferProducer() BCE (after)
+ // CHECK-NOT: BoundsCheck
+ // CHECK: ArraySet
+
+ static void circularBufferProducer() {
+ byte[] array = new byte[4096];
+ int i = 0;
+ while (true) {
+ array[i & (array.length - 1)] = readData();
+ i++;
+ }
+ }
+
+
// CHECK-START: void Main.pyramid1(int[]) BCE (before)
// CHECK: BoundsCheck
// CHECK: ArraySet