aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/array-out-of-bounds.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/array-out-of-bounds.c b/test/array-out-of-bounds.c
new file mode 100644
index 0000000..425bf39
--- /dev/null
+++ b/test/array-out-of-bounds.c
@@ -0,0 +1,9 @@
+int main() {
+ int x[2] = {1, 2};
+ int y[2] = {3, 4};
+ x[2] = 0;
+ int sum = 0;
+ for(int i=0; i<2; i++)
+ sum += (x[i] * y[i]);
+
+}