aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/array-write.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/array-write.c b/test/array-write.c
new file mode 100644
index 0000000..7cb37f2
--- /dev/null
+++ b/test/array-write.c
@@ -0,0 +1,12 @@
+int main() {
+ int x[2] = {5, 10};
+ int y[2];
+ for(int i=0; i<2;i++){
+ y[i] += x[i] * (i+1);
+ }
+
+ int sum = 0;
+ for(int j=0; j <2; j++)
+ sum += y[j];
+ return sum;
+}