From: Graham Stott Date: Tue, 25 Sep 2001 11:52:13 +0000 (+0000) Subject: * 20010925-1.c: New testcase for incorrect sibcall optimization. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=69d544c26c6c168325c2f036ce7c7a1807207242;p=gcc.git * 20010925-1.c: New testcase for incorrect sibcall optimization. From-SVN: r45804 --- diff --git a/gcc/testsuite/gcc.c-torture/execute/20010925-1.c b/gcc/testsuite/gcc.c-torture/execute/20010925-1.c new file mode 100644 index 00000000000..ad1ba6dd231 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20010925-1.c @@ -0,0 +1,24 @@ +extern void exit(int); +extern void abort (void); + +extern void * memcpy (void *, const void *, unsigned int); +int foo (void *, void *, unsigned int c); + +int src[10]; +int dst[10]; + +int main() +{ + if (foo (dst, src, 10) != 0) + abort(); + exit(0); +} + +int foo (void *a, void *b, unsigned int c) +{ + if (c == 0) + return 1; + + memcpy (a, b, c); + return 0; +}