summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/unsorted/scal.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/unsorted/scal.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/unsorted/scal.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/unsorted/scal.c b/gcc/testsuite/gcc.c-torture/unsorted/scal.c
new file mode 100644
index 000000000..94e22aa80
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/unsorted/scal.c
@@ -0,0 +1,19 @@
+int g1, g2;
+
+void
+write_at (addr, off, val)
+ int *addr;
+ int off;
+ int val;
+{
+ g2 = 1;
+ addr[off] = val;
+ g2++;
+}
+
+main ()
+{
+ g2 = 12;
+ write_at (&g1, &g2 - &g1, 12345);
+ printf ("%d\n", g2);
+}