public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [SH][committed] Add test case for PR 65249
@ 2015-03-07 16:15 Oleg Endo
  0 siblings, 0 replies; only message in thread
From: Oleg Endo @ 2015-03-07 16:15 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

Hi,

This adds a test case for PR 65249.
Tested with
make -k check-c++ RUNTESTFLAGS="dg-torture.exp=pr65249.C
--target_board=sh-sim
\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"

Commited as r221256.

Cheers,
Oleg

gcc/testsuite/ChangeLog:
	PR target/65249
	* g++.dg/torture/pr65249.C: New.

[-- Attachment #2: sh_pr65249_test.patch --]
[-- Type: text/x-patch, Size: 1031 bytes --]

Index: gcc/testsuite/g++.dg/torture/pr65249.C
===================================================================
--- gcc/testsuite/g++.dg/torture/pr65249.C	(revision 0)
+++ gcc/testsuite/g++.dg/torture/pr65249.C	(revision 0)
@@ -0,0 +1,54 @@
+// { dg-do compile }
+// { dg-additional-options "-fPIC -fstack-protector-strong" { target fpic } }
+// { dg-require-effective-target fstack_protector }
+
+struct struct0
+{
+  struct0 (void(*)());
+};
+
+int func5 (int* ptr);
+void func3 (int*, struct0*);
+
+inline void
+func4 (int* a, void (*b)())
+{
+  if (func5 (a) != 2)
+  {
+    struct0 f (b);
+    func3(a, &f);
+  }
+}
+
+struct struct1
+{
+  const void* val0;
+  const void* val1;
+};
+
+void* func3 (const void*);
+
+static const void* gvar1 = 0;
+static const void* gvar2 = 0;
+static int gvar0 = 0;
+
+void
+func0 (void)
+{
+  gvar2 = func3 (gvar1);
+}
+
+inline void
+func1 (void)
+{
+  func4 (&gvar0, &func0);
+}
+
+struct1 func2 (void)
+{
+  func1 ();
+  struct1 s;
+  s.val0 = gvar1;
+  s.val1 = gvar2;
+  return s;
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-07 16:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-07 16:15 [SH][committed] Add test case for PR 65249 Oleg Endo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).