aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2003-11-27 06:20:11 +0100
committerEric Botcazou <ebotcazou@gcc.gnu.org>2003-11-27 05:20:11 +0000
commit316d0b19813c17613fe2dd80f8bba4fd2001eca3 (patch)
tree946c3c7c87e191ddb13beb07b342cb71173d930b /gcc/testsuite
parent27f0f55216eeea3cc81612ecbc235d7704382a77 (diff)
downloadgcc-316d0b19813c17613fe2dd80f8bba4fd2001eca3.zip
gcc-316d0b19813c17613fe2dd80f8bba4fd2001eca3.tar.gz
gcc-316d0b19813c17613fe2dd80f8bba4fd2001eca3.tar.bz2
re PR middle-end/8028 (__builtin_apply() passes wrong arguments)
PR middle-end/8028 PR middle-end/9890 PR middle-end/11151 PR middle-end/12210 PR middle-end/12503 PR middle-end/12692 * builtins.c (expand_builtin_apply): Use virtual_outgoing_args_rtx as the base address to copy the memory arguments to. From-SVN: r73976
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/builtin-apply2.c39
2 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4b8fe13..20faca0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2003-11-27 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/builtin-apply2.c: New test.
+
2003-11-26 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.c-torture/compile/20031023-4.c: Don't XFAIL on SPARC64.
diff --git a/gcc/testsuite/gcc.dg/builtin-apply2.c b/gcc/testsuite/gcc.dg/builtin-apply2.c
new file mode 100644
index 0000000..56b27a1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-apply2.c
@@ -0,0 +1,39 @@
+/* PR target/12503 */
+/* Origin: <pierre.nguyen-tuong@asim.lip6.fr> */
+
+/* Verify that __builtin_apply behaves correctly on targets
+ with pre-pushed arguments (e.g. SPARC). */
+
+/* { dg-do run } */
+
+
+#define INTEGER_ARG 5
+
+typedef __SIZE_TYPE__ size_t;
+
+extern void abort(void);
+
+void foo(char *name, double d, double e, double f, int g)
+{
+ if (g != INTEGER_ARG)
+ abort();
+}
+
+void bar(char *name, ...)
+{
+ size_t size;
+ void *arguments;
+
+ size = sizeof(char *) + 3 * sizeof(double) + sizeof(int);
+
+ arguments = __builtin_apply_args();
+
+ __builtin_apply(foo, arguments, size);
+}
+
+int main(void)
+{
+ bar("eeee", 5.444567, 8.90765, 4.567789, INTEGER_ARG);
+
+ return 0;
+}