OSDN Git Service

* 20010925-1.c: New testcase for incorrect sibcall optimization.
authorgrahams <grahams@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 25 Sep 2001 11:52:13 +0000 (11:52 +0000)
committergrahams <grahams@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 25 Sep 2001 11:52:13 +0000 (11:52 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45804 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/gcc.c-torture/execute/20010925-1.c [new file with mode: 0644]

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 (file)
index 0000000..ad1ba6d
--- /dev/null
@@ -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;
+}