aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorGraham Stott <grahams@gcc.gnu.org>2001-09-25 11:52:13 +0000
committerGraham Stott <grahams@gcc.gnu.org>2001-09-25 11:52:13 +0000
commit69d544c26c6c168325c2f036ce7c7a1807207242 (patch)
treea351b1780467015db87e80ff5a2b7cbf1d9c2be1 /gcc/testsuite
parent87f8b15fd840240e97460b513c180a6a15a4b083 (diff)
downloadgcc-69d544c26c6c168325c2f036ce7c7a1807207242.zip
gcc-69d544c26c6c168325c2f036ce7c7a1807207242.tar.gz
gcc-69d544c26c6c168325c2f036ce7c7a1807207242.tar.bz2
* 20010925-1.c: New testcase for incorrect sibcall optimization.
From-SVN: r45804
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010925-1.c24
1 files changed, 24 insertions, 0 deletions
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 0000000..ad1ba6d
--- /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;
+}