From 06e6dc291cfcb3941742b36fb870a1adafcb4412 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 17 Feb 2015 11:42:26 +0000 Subject: [PATCH] Add gcc.target/x86_64/abi/callabi/vaarg-6.c 2015-02-17 Tom de Vries * gcc.target/x86_64/abi/callabi/vaarg-6.c: New test. From-SVN: r220757 --- gcc/testsuite/ChangeLog | 4 +++ .../gcc.target/x86_64/abi/callabi/vaarg-6.c | 40 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-6.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ba21ab4..1864240 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-02-17 Tom de Vries + + * gcc.target/x86_64/abi/callabi/vaarg-6.c: New test. + 2015-02-17 Paolo Carlini Jakub Jelinek 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 + +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; +} -- 2.7.4