diff options
| author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-11 21:00:19 +0000 |
|---|---|---|
| committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-11 21:00:19 +0000 |
| commit | 13100710a1bb77aa9ca2c761e7bd28166a96cf48 (patch) | |
| tree | d53570dbea388988701a8badd790d7f31b962ce2 | |
| parent | b65ada3a750307c93c634d6d95a03b5076abd297 (diff) | |
| download | ppe42-gcc-13100710a1bb77aa9ca2c761e7bd28166a96cf48.tar.gz ppe42-gcc-13100710a1bb77aa9ca2c761e7bd28166a96cf48.zip | |
* gcc.c-torture/execute/20000910-1.c: New test.
* gcc.c-torture/execute/20000910-2.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36328 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20000910-1.c | 27 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20000910-2.c | 28 |
3 files changed, 60 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3fbaaa09bfd..f9a0543cc4a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2000-09-11 Alexandre Oliva <aoliva@redhat.com> + + * gcc.c-torture/execute/20000910-1.c: New test. + * gcc.c-torture/execute/20000910-2.c: Likewise. + 2000-09-11 Robert Lipe <robertl@sco.com> * gcc.dg/pragma-align.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/20000910-1.c b/gcc/testsuite/gcc.c-torture/execute/20000910-1.c new file mode 100644 index 00000000000..0c3c602dd6d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20000910-1.c @@ -0,0 +1,27 @@ +/* Copyright (C) 2000 Free Software Foundation */ +/* by Alexandre Oliva <aoliva@redhat.com> */ + +#include <stdlib.h> + +void bar (int); +void foo (int *); + +int main () { + static int a[] = { 0, 1, 2 }; + int *i = &a[sizeof(a)/sizeof(*a)]; + + while (i-- > a) + foo (i); + + exit (0); +} + +void baz (int, int); + +void bar (int i) { baz (i, i); } +void foo (int *i) { bar (*i); } + +void baz (int i, int j) { + if (i != j) + abort (); +} diff --git a/gcc/testsuite/gcc.c-torture/execute/20000910-2.c b/gcc/testsuite/gcc.c-torture/execute/20000910-2.c new file mode 100644 index 00000000000..0023d2451e0 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20000910-2.c @@ -0,0 +1,28 @@ +/* Copyright (C) 2000 Free Software Foundation */ +/* by Alexandre Oliva <aoliva@redhat.com> */ + +#include <stdlib.h> +#include <string.h> + +char *list[] = { "*", "e" }; + +static int bar (const char *fmt) { + return (strchr (fmt, '*') != 0); +} + +static void foo () { + int i; + for (i = 0; i < sizeof (list) / sizeof (*list); i++) { + const char *fmt = list[i]; + if (bar (fmt)) + continue; + if (i == 0) + abort (); + else + exit (0); + } +} + +int main () { + foo (); +} |

