* gcc.c-torture/execute/20010118-1.c: New test.
authorJakub Jelinek <jakub@redhat.com>
Fri, 19 Jan 2001 10:35:13 +0000 (11:35 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 19 Jan 2001 10:35:13 +0000 (11:35 +0100)
From-SVN: r39131

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20010118-1.c [new file with mode: 0644]

index 9c5b6169fa74d54401446e231ed9ab5c4db4c221..efeee5df66b8d2ece11936a77801b762a513b2f7 100644 (file)
@@ -1,3 +1,7 @@
+2001-01-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.c-torture/execute/20010118-1.c: New test.
+
 2001-01-19  Nathan Sidwell  <nathan@codesourcery.com>
 
        * g++.old-deja/g++.pt/deduct3.C: New test.
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010118-1.c b/gcc/testsuite/gcc.c-torture/execute/20010118-1.c
new file mode 100644 (file)
index 0000000..ee5197c
--- /dev/null
@@ -0,0 +1,37 @@
+typedef struct {
+  int a, b, c, d, e, f;
+} A;
+
+void foo (A *v, int w, int x, int *y, int *z)
+{
+}
+
+void
+bar (A *v, int x, int y, int w, int h)
+{
+  if (v->a != x || v->b != y) {
+    int oldw = w;
+    int oldh = h;
+    int e = v->e;
+    int f = v->f;
+    int dx, dy;
+    foo(v, 0, 0, &w, &h);
+    dx = (oldw - w) * (double) e/2.0;
+    dy = (oldh - h) * (double) f/2.0;
+    x += dx;
+    y += dy;
+    v->a = x;
+    v->b = y;
+    v->c = w;
+    v->d = h;
+  }
+}
+
+int main ()
+{
+  A w = { 100, 110, 20, 30, -1, -1 };
+  bar (&w,400,420,50,70);
+  if (w.d != 70)
+    abort();
+  exit(0);
+}