This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix va-arg-24.c


Richard Earnshaw pointed out that va-arg-24 wasn't quite testing what
I wanted it to test.  Here's a corrected version of the testcase under
a new name.

I've checked that the new testcase still passes under powerpc-darwin.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-fixvaarg24.c==========================
2003-10-10  Geoffrey Keating  <geoffk@apple.com>

	* gcc.c-torture/execute/va-arg-24.c: Correct, and rename to...
	* gcc.c-torture/execute/va-arg-25.c: ... here.

Index: gcc.c-torture/execute/va-arg-24.c
===================================================================
RCS file: gcc.c-torture/execute/va-arg-24.c
diff -N gcc.c-torture/execute/va-arg-24.c
--- gcc.c-torture/execute/va-arg-24.c	7 Oct 2003 19:48:23 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-/* Varargs and vectors!  */
-
-#include <stdarg.h>
-
-#define vector __attribute__((vector_size(16)))
-
-const vector unsigned int v1 = {10,11,12,13};
-const vector unsigned int v2 = {20,21,22,23};
-
-void foo(int a, ...)
-{
-  va_list args;
-  vector unsigned int v;
-
-  va_start (args, a);
-  v = va_arg (args, vector unsigned int);
-  if (a != 1 || memcmp (&v, &v1, sizeof (v)) != 0)
-    abort ();
-  a = va_arg (args, int);
-  if (a != 2)
-    abort ();
-  v = va_arg (args, vector unsigned int);
-  if (memcmp (&v, &v2, sizeof (v) != 0))
-    abort ();
-  va_end (args);
-}
-
-int main(void)
-{
-  foo (1, (vector unsigned int){10,11,12,13}, 2,
-       (vector unsigned int){14,15,16,17});
-  return 0;
-}
-
Index: gcc.c-torture/execute/va-arg-25.c
===================================================================
RCS file: gcc.c-torture/execute/va-arg-25.c
diff -N gcc.c-torture/execute/va-arg-25.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gcc.c-torture/execute/va-arg-25.c	10 Oct 2003 18:05:30 -0000
@@ -0,0 +1,34 @@
+/* Varargs and vectors!  */
+
+#include <stdarg.h>
+
+#define vector __attribute__((vector_size(16)))
+
+const vector unsigned int v1 = {10,11,12,13};
+const vector unsigned int v2 = {20,21,22,23};
+
+void foo(int a, ...)
+{
+  va_list args;
+  vector unsigned int v;
+
+  va_start (args, a);
+  v = va_arg (args, vector unsigned int);
+  if (a != 1 || memcmp (&v, &v1, sizeof (v)) != 0)
+    abort ();
+  a = va_arg (args, int);
+  if (a != 2)
+    abort ();
+  v = va_arg (args, vector unsigned int);
+  if (memcmp (&v, &v2, sizeof (v)) != 0)
+    abort ();
+  va_end (args);
+}
+
+int main(void)
+{
+  foo (1, (vector unsigned int){10,11,12,13}, 2,
+       (vector unsigned int){20,21,22,23});
+  return 0;
+}
+
============================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]