From 1c3f3851dd0fb0d145fd3982a13a5cac0672ed27 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 24 Apr 2015 14:18:57 +0000 Subject: [PATCH] Replace g++.dg/pr65802.C with gcc.dg/pr65802.c 2015-04-24 Tom de Vries PR tree-optimization/65802 * g++.dg/pr65802.C: Move to ... * gcc.dg/pr65802.c: ... here. Add -fexceptions to dg-options. Include stdarg.h. Rewrite for C. (fn1): Use va_list and va_arg. Make variable args function. Add use of va_start and va_end. Remove unnecessary inline asm. From-SVN: r222413 --- gcc/testsuite/ChangeLog | 9 +++++++++ gcc/testsuite/g++.dg/pr65802.C | 29 ----------------------------- gcc/testsuite/gcc.dg/pr65802.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 29 deletions(-) delete mode 100644 gcc/testsuite/g++.dg/pr65802.C create mode 100644 gcc/testsuite/gcc.dg/pr65802.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4b2f62bc32d..3e2b154236b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2015-04-24 Tom de Vries + + PR tree-optimization/65802 + * g++.dg/pr65802.C: Move to ... + * gcc.dg/pr65802.c: ... here. Add -fexceptions to dg-options. Include + stdarg.h. Rewrite for C. + (fn1): Use va_list and va_arg. Make variable args function. Add use of + va_start and va_end. Remove unnecessary inline asm. + 2015-04-24 Uros Bizjak Wei Mi diff --git a/gcc/testsuite/g++.dg/pr65802.C b/gcc/testsuite/g++.dg/pr65802.C deleted file mode 100644 index 26e5317aeb1..00000000000 --- a/gcc/testsuite/g++.dg/pr65802.C +++ /dev/null @@ -1,29 +0,0 @@ -// { dg-do compile } -// { dg-options "-O0" } - -typedef int tf (); - -struct S -{ - tf m_fn1; -} a; - -void -fn1 () -{ - try - { - __builtin_va_list c; - { - int *d = __builtin_va_arg (c, int *); - int **e = &d; - __asm__("" : "=d"(e)); - a.m_fn1 (); - } - a.m_fn1 (); - } - catch (...) - { - - } -} diff --git a/gcc/testsuite/gcc.dg/pr65802.c b/gcc/testsuite/gcc.dg/pr65802.c new file mode 100644 index 00000000000..fcec234dc0b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr65802.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O0 -fexceptions" } */ + +#include + +struct S +{ + int (*m_fn1) (void); +} a; + +void +fn1 (int d, ...) +{ + va_list c; + va_start (c, d); + + { + int *d = va_arg (c, int *); + + int **e = &d; + + a.m_fn1 (); + } + + a.m_fn1 (); + + va_end (c); +} -- 2.30.2