Replace g++.dg/pr65802.C with gcc.dg/pr65802.c
2015-04-24 Tom de Vries <tom@codesourcery.com> 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
This commit is contained in:
parent
97afef00ba
commit
1c3f3851dd
@ -1,3 +1,12 @@
|
||||
2015-04-24 Tom de Vries <tom@codesourcery.com>
|
||||
|
||||
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 <ubizjak@gmail.com>
|
||||
Wei Mi <wmi@google.com>
|
||||
|
||||
|
@ -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 (...)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
28
gcc/testsuite/gcc.dg/pr65802.c
Normal file
28
gcc/testsuite/gcc.dg/pr65802.c
Normal file
@ -0,0 +1,28 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O0 -fexceptions" } */
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user