public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: dnovillo@google.com (Diego Novillo)
To: reply@codereview.appspotmail.com, crowl@google.com,
	gchare@google.com,        gcc-patches@gcc.gnu.org
Subject: [pph] New test (issue4629075)
Date: Mon, 27 Jun 2011 16:50:00 -0000	[thread overview]
Message-ID: <20110627163937.6C7221DA195@topo.tor.corp.google.com> (raw)

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

             reply	other threads:[~2011-06-27 16:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-27 16:50 Diego Novillo [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110627163937.6C7221DA195@topo.tor.corp.google.com \
    --to=dnovillo@google.com \
    --cc=crowl@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gchare@google.com \
    --cc=reply@codereview.appspotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).