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]

[committed] Add gcc.target/x86_64/abi/callabi/vaarg-6.c


Committed new test-case.

Thanks,
- Tom
2015-02-17  Tom de Vries  <tom@codesourcery.com>

	* gcc.target/x86_64/abi/callabi/vaarg-6.c: New test.
---
 .../gcc.target/x86_64/abi/callabi/vaarg-6.c        | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-6.c

diff --git a/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-6.c b/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-6.c
new file mode 100644
index 0000000..57ee23a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-6.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -mabi=ms -std=gnu99 -fno-builtin" } */
+
+#include <stdarg.h>
+
+extern void __attribute__ ((sysv_abi)) abort (void);
+
+char *a = "1";
+char *b = "2";
+
+static void __attribute__((noinline,noclone))
+do_cpy2 (va_list argp)
+{
+  char *e;
+
+  e = va_arg (argp, char *);
+  e = va_arg (argp, char *);
+  if (e != b)
+    abort ();
+}
+
+void __attribute__((noinline,noclone))
+do_cpy (int dummy, ...)
+{
+  va_list argp;
+
+  va_start (argp, dummy);
+
+  do_cpy2 (argp);
+
+  va_end (argp);
+}
+
+int __attribute__ ((sysv_abi))
+main ()
+{
+  do_cpy (0, a, b);
+
+  return 0;
+}
-- 
1.9.1


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