public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add testcase for PR tree-optimization/63551 to 4.9/5/trunk
@ 2015-04-30 18:19 Marek Polacek
  0 siblings, 0 replies; only message in thread
From: Marek Polacek @ 2015-04-30 18:19 UTC (permalink / raw)
  To: GCC Patches

This patch adds a C++ testcase for the PR Martin J. fixed some time ago.

Tested on x86_64-linux, applying to 4.9/5/trunk.

2015-04-30  Marek Polacek  <polacek@redhat.com>

	PR tree-optimization/63551
    	* g++.dg/ipa/pr63551.C: New test.

diff --git gcc/testsuite/g++.dg/ipa/pr63551.C gcc/testsuite/g++.dg/ipa/pr63551.C
index e69de29..03e0339 100644
--- gcc/testsuite/g++.dg/ipa/pr63551.C
+++ gcc/testsuite/g++.dg/ipa/pr63551.C
@@ -0,0 +1,23 @@
+// { dg-options "-O -Wno-psabi" }
+// { dg-do compile }
+
+struct A { int a; };
+template <typename T, typename V> struct B { V operator[] (T); };
+union U { long double ld; void *v; };
+A a;
+
+void
+bar (U &x)
+{
+  if (x.v) *reinterpret_cast <A *>(x.v) = a;
+}
+
+struct C { C (A) { c.ld = 0; bar (c); } U c; };
+struct D { A d, e; void foo () { f[0][d] = e; } B <int, B <A, C> > f; };
+
+void
+baz ()
+{
+  D d;
+  d.foo ();
+}

	Marek

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

only message in thread, other threads:[~2015-04-30 17:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-30 18:19 [PATCH] Add testcase for PR tree-optimization/63551 to 4.9/5/trunk Marek Polacek

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).