From 57abef333660ad821d7d54791f7646e8ec5668fd Mon Sep 17 00:00:00 2001 From: unknown author <cooker@mandrivalinux.org> Date: Tue, 10 Feb 2009 15:47:49 +0000 Subject: gcc33 pr11631 2003-07-22 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> PR optimization/11631 * gcc.c-torture/execute/20030722-1.c: New test. --- gcc/testsuite/gcc.c-torture/execute/20030722-1.c | 44 ++++++++++++++++++++++ 1 files changed, 44 insertions(+), 0 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/execute/20030722-1.c diff --git a/gcc/testsuite/gcc.c-torture/execute/20030722-1.c b/gcc/testsuite/gcc.c-torture/execute/20030722-1.c new file mode 100644 index 0000000..cfe8897 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20030722-1.c @@ -0,0 +1,44 @@ +/* Extracted from zsh sources. */ +/* Contributed by Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> */ + +extern void abort(void); +extern void exit(int); + +static void f(const char *name); +static void g(const char *name); + +static char *p; + +int main(void) +{ + p = "foo"; + do { + char *arg0 = p; + if (!(p = strrchr(arg0, '/'))) + p = arg0; + else + p++; + if (strcmp(p, "bar") != 0) + break; + } while (p); + + f(p); + g(p); + + for (;;) { + } + + return 0; +} + +static void f(const char *name) +{ +} + +static void g(const char *name) +{ + if (name) + exit(0); + else + abort(); +} -- 1.6.2.4