diff options
author | Nick Clifton <nickc@redhat.com> | 2016-01-07 17:13:50 +0000 |
---|---|---|
committer | Nick Clifton <nickc@gcc.gnu.org> | 2016-01-07 17:13:50 +0000 |
commit | c8e62a9df15d4e16cca367057530a7847eeb943c (patch) | |
tree | fabe33678da37e319e7174dd805115c0095da38d | |
parent | f885fa898fdf8dc53081d584e322f5d9af3491a3 (diff) | |
download | gcc-c8e62a9df15d4e16cca367057530a7847eeb943c.zip gcc-c8e62a9df15d4e16cca367057530a7847eeb943c.tar.gz gcc-c8e62a9df15d4e16cca367057530a7847eeb943c.tar.bz2 |
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
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/pr66655.C | 25 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/pr66655.h | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/pr66655_1.cc | 14 |
4 files changed, 51 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 869d0fb..c65c7cb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/g++.dg/pr66655.C b/gcc/testsuite/g++.dg/pr66655.C new file mode 100644 index 0000000..218a2c6 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr66655.C @@ -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; +} diff --git a/gcc/testsuite/g++.dg/pr66655.h b/gcc/testsuite/g++.dg/pr66655.h new file mode 100644 index 0000000..ff638f4 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr66655.h @@ -0,0 +1,5 @@ +struct S +{ + static int i; + static void set (int ii) { i = -ii; } +}; diff --git a/gcc/testsuite/g++.dg/pr66655_1.cc b/gcc/testsuite/g++.dg/pr66655_1.cc new file mode 100644 index 0000000..d42344c --- /dev/null +++ b/gcc/testsuite/g++.dg/pr66655_1.cc @@ -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; +} |