Add a test for PR66655

PR target/66655
	* g++.dg/pr66655.C: New test.
	* g++.dg/pr66655_1.cc: Test support file.
	* g++.dg/pr66655.h: Test header file.

From-SVN: r232133
This commit is contained in:
Nick Clifton 2016-01-07 17:13:50 +00:00 committed by Nick Clifton
parent f885fa898f
commit c8e62a9df1
4 changed files with 51 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2016-01-07 Nick Clifton <nickc@redhat.com>
PR target/66655
* g++.dg/pr66655.C: New test.
* g++.dg/pr66655_1.cc: Test support file.
* g++.dg/pr66655.h: Test header file.
2016-01-07 Dominique d'Humieres <dominiq@lps.ens.fr>
PR fortran/66680

View File

@ -0,0 +1,25 @@
/* { dg-do run } */
/* { dg-additional-sources "pr66655_1.cc" } */
#include "pr66655.h"
extern "C" void abort (void);
#define COOKIE 0xabcd0123
int
g (void)
{
return COOKIE;
}
extern int f (void);
int
main (void)
{
S::set(0);
if (f () != COOKIE)
abort ();
return 0;
}

View File

@ -0,0 +1,5 @@
struct S
{
static int i;
static void set (int ii) { i = -ii; }
};

View File

@ -0,0 +1,14 @@
#include "pr66655.h"
extern int g (void);
int S::i;
int
f (void)
{
int ret = g ();
S::set (ret);
return ret;
}