public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pph] New test (issue4629075)
@ 2011-06-27 16:50 Diego Novillo
  2011-06-27 17:13 ` Gabriel Charette
  0 siblings, 1 reply; 5+ messages in thread
From: Diego Novillo @ 2011-06-27 16:50 UTC (permalink / raw)
  To: reply, crowl, gchare, gcc-patches

We are very close to having the first simple C++ program working from
a PPH image.  Adding a runnable test case.

This produces assembly miscomparisons and does not link.  I'll be
working on it this week.


Diego.

	* g++.dg/pph/x1ten-hellos.cc: New.
	* g++.dg/pph/x1ten-hellos.h: New.
	* g++.dg/pph/pph.map: Add x1ten-hellos.h

diff --git a/gcc/testsuite/g++.dg/pph/x1ten-hellos.cc b/gcc/testsuite/g++.dg/pph/x1ten-hellos.cc
new file mode 100644
index 0000000..b99d08a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pph/x1ten-hellos.cc
@@ -0,0 +1,12 @@
+// { dg-do run }
+// { dg-xfail-if "LINK ERROR" { "*-*-*" } { "-fpph-map=pph.map" } }
+// pph asm xdiff
+#include "x1ten-hellos.h"
+
+int main(void)
+{
+  A a;
+  for (int i = 0; i < 10; i++)
+    a.hello();
+  return 0;
+}
diff --git a/gcc/testsuite/g++.dg/pph/x1ten-hellos.h b/gcc/testsuite/g++.dg/pph/x1ten-hellos.h
new file mode 100644
index 0000000..2a53b66
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pph/x1ten-hellos.h
@@ -0,0 +1,21 @@
+#ifndef A_H_
+#define A_H_
+#include <stdio.h>
+
+class A
+{
+public:
+  A() {
+    x_ = 0;
+    printf ("constructing\n");
+  }
+
+  void hello(void) {
+    x_++;
+    printf ("Hello World (%d)\n", x_);
+  }
+
+private:
+  int x_;
+};
+#endif
diff --git a/gcc/testsuite/g++.dg/pph/pph.map b/gcc/testsuite/g++.dg/pph/pph.map
index f0c7abd..2735af8 100644
--- a/gcc/testsuite/g++.dg/pph/pph.map
+++ b/gcc/testsuite/g++.dg/pph/pph.map
@@ -38,6 +47,7 @@ x1struct0.h	x1struct0.pph
 x1struct1.h	x1struct1.pph
 x1struct2.h	x1struct2.pph
 x1template.h	x1template.pph
+x1ten-hellos.h	x1ten-hellos.pph
 x1tmplclass.h	x1tmplclass.pph
 x1tmplfunc.h	x1tmplfunc.pph
 x1typerefs.h	x1typerefs.pph

--
This patch is available for review at http://codereview.appspot.com/4629075

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-27 18:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-27 16:50 [pph] New test (issue4629075) Diego Novillo
2011-06-27 17:13 ` Gabriel Charette
2011-06-27 17:17   ` Diego Novillo
2011-06-27 19:03     ` Lawrence Crowl
2011-06-27 19:12       ` Diego Novillo

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