OSDN Git Service

Add a testcase for PR middle-end/44372.
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Jun 2010 17:04:13 +0000 (17:04 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Jun 2010 17:04:13 +0000 (17:04 +0000)
2010-06-02  H.J. Lu  <hongjiu.lu@intel.com>

PR middle-end/44372
* g++.dg/ipa/pr44372.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160169 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ipa/pr44372.C [new file with mode: 0644]

index 158b066..470d919 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR middle-end/44372
+       * g++.dg/ipa/pr44372.C: New.
+
 2010-06-02  Jan Hubicka  <jh@suse.cz>
 
        PR middle-end/44295
diff --git a/gcc/testsuite/g++.dg/ipa/pr44372.C b/gcc/testsuite/g++.dg/ipa/pr44372.C
new file mode 100644 (file)
index 0000000..22aa747
--- /dev/null
@@ -0,0 +1,48 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fipa-cp -fipa-cp-clone" } */
+
+template < typename > class S3;
+
+struct S1
+{
+  struct
+  {
+    int i[10];
+  } s0;
+  S1 () : s0 ()
+  { }
+  template < typename T > S1 (S3 < T > s3, int)
+  {
+    f (s3);
+  }
+};
+
+struct S2
+{
+  template < typename T > S2 s (S3 < T > s3)
+  {
+    S1 (s3, 0);
+  }
+  S2 (int i) : j (i)
+  { }
+  int j;
+  S1 s1[10];
+};
+
+template < typename > struct S3
+{
+  S3 ()
+  {
+    S2 (0).s (*this);
+  }
+};
+
+static inline void
+f (S3 < int > s3)
+{
+  extern bool m;
+  if (m)
+    S2 (0).s (s3);
+}
+
+S3 < int >s3;