test file
authorbdemsky <bdemsky>
Mon, 19 Nov 2007 22:25:49 +0000 (22:25 +0000)
committerbdemsky <bdemsky>
Mon, 19 Nov 2007 22:25:49 +0000 (22:25 +0000)
Robust/src/Tests/Prefetch/ArrayTest.java [new file with mode: 0644]

diff --git a/Robust/src/Tests/Prefetch/ArrayTest.java b/Robust/src/Tests/Prefetch/ArrayTest.java
new file mode 100644 (file)
index 0000000..dde8f7b
--- /dev/null
@@ -0,0 +1,32 @@
+public class ArrayTest {
+    Item x;    
+    public ArrayTest() {
+    }
+    
+    public static void main(String[] args) {
+       ArrayTest[] n=new ArrayTest[10];
+       for(int i=0;i<10;i++) {
+           n[i]=new ArrayTest();       
+           n[i].x=new Item();
+           n[i].x.i=new Integer(10);
+       }
+       addItems(n);
+    }
+    
+    public static int addItems(ArrayTest [] array) {
+       int sum=0;
+       for(int i=0;i<array.length;i++) {
+           ArrayTest a=array[i];
+           sum=sum+a.x.i.intValue();
+       }
+       return sum;
+    }
+}
+
+public class Item {
+    Integer i;
+    public Item() {
+       
+    }
+
+}