diff options
author | Alan Modra <amodra@bigpond.net.au> | 2002-07-20 00:33:49 +0000 |
---|---|---|
committer | Alan Modra <amodra@gcc.gnu.org> | 2002-07-20 10:03:49 +0930 |
commit | a0c58ea9ac2daa30ecfffcb7a956b1b136d0e14f (patch) | |
tree | 92f18a31e3574e89f075320b18107866f85a7453 /gcc | |
parent | 8b583747adc3a9e670930481b828550fdcc18860 (diff) | |
download | gcc-a0c58ea9ac2daa30ecfffcb7a956b1b136d0e14f.zip gcc-a0c58ea9ac2daa30ecfffcb7a956b1b136d0e14f.tar.gz gcc-a0c58ea9ac2daa30ecfffcb7a956b1b136d0e14f.tar.bz2 |
New test.
From-SVN: r55599
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/loop-13.c | 36 |
2 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2375247..1665509 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-07-20 Alan Modra <amodra@bigpond.net.au> + + * gcc.c-torture/execute/loop-13.c: New test. + 2002-07-19 Neil Booth <neil@daikokuya.co.uk> * gcc.dg/cpp/expr.c: New tests. diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-13.c b/gcc/testsuite/gcc.c-torture/execute/loop-13.c new file mode 100644 index 0000000..d56c829 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/loop-13.c @@ -0,0 +1,36 @@ +/* PR opt/7130 */ +#define TYPE long + +void +scale (TYPE *alpha, TYPE *x, int n) +{ + int i, ix; + + if (*alpha != 1) + for (i = 0, ix = 0; i < n; i++, ix += 2) + { + TYPE tmpr, tmpi; + tmpr = *alpha * x[ix]; + tmpi = *alpha * x[ix + 1]; + x[ix] = tmpr; + x[ix + 1] = tmpi; + } +} + +int +main (void) +{ + int i; + TYPE x[10]; + TYPE alpha = 2; + + for (i = 0; i < 10; i++) + x[i] = i; + + scale (&alpha, x, 5); + + if (x[9] != 18) + abort (); + + return 0; +} |