OSDN Git Service

* gcc.dg/builtin-apply2.c: Set size of stack argument data to 64.
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Nov 2003 16:35:52 +0000 (16:35 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Nov 2003 16:35:52 +0000 (16:35 +0000)
* gcc.dg/builtin-apply3.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74022 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/builtin-apply2.c
gcc/testsuite/gcc.dg/builtin-apply3.c [new file with mode: 0644]

index cd7670f..cbac848 100644 (file)
@@ -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.
index 56b27a1..a1ba20f 100644 (file)
@@ -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 (file)
index 0000000..1335d09
--- /dev/null
@@ -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;
+}