aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/builtin-apply2.c11
-rw-r--r--gcc/testsuite/gcc.dg/builtin-apply3.c31
3 files changed, 37 insertions, 10 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index cd7670f..cbac848 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2003-11-28 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/builtin-apply2.c: Set size of stack argument data to 64.
+ * gcc.dg/builtin-apply3.c: New test.
+
2003-11-27 Eric Botcazou <ebotcazou@libertysurf.fr>
* lib/compat.exp (compat-obj): New xfaildata parameter.
diff --git a/gcc/testsuite/gcc.dg/builtin-apply2.c b/gcc/testsuite/gcc.dg/builtin-apply2.c
index 56b27a1..a1ba20f 100644
--- a/gcc/testsuite/gcc.dg/builtin-apply2.c
+++ b/gcc/testsuite/gcc.dg/builtin-apply2.c
@@ -9,8 +9,6 @@
#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)
@@ -21,14 +19,7 @@ void foo(char *name, double d, double e, double f, int g)
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);
+ __builtin_apply(foo, __builtin_apply_args(), 64);
}
int main(void)
diff --git a/gcc/testsuite/gcc.dg/builtin-apply3.c b/gcc/testsuite/gcc.dg/builtin-apply3.c
new file mode 100644
index 0000000..1335d09
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-apply3.c
@@ -0,0 +1,31 @@
+/* PR middle-end/12210 */
+/* Origin: Ossadchy Yury A. <waspcoder@mail.ru> */
+
+/* This used to fail on i686 because the argument was not copied
+ to the right location by __builtin_apply after the direct call. */
+
+/* { dg-do run } */
+
+
+#define INTEGER_ARG 5
+
+extern void abort(void);
+
+void foo(int arg)
+{
+ if (arg != INTEGER_ARG)
+ abort();
+}
+
+void bar(int arg)
+{
+ foo(arg);
+ __builtin_apply(foo, __builtin_apply_args(), 16);
+}
+
+int main(void)
+{
+ bar(INTEGER_ARG);
+
+ return 0;
+}