From patchwork Mon Jun 27 16:39:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 102219 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 99550B6F68 for ; Tue, 28 Jun 2011 02:40:04 +1000 (EST) Received: (qmail 26534 invoked by alias); 27 Jun 2011 16:40:00 -0000 Received: (qmail 26522 invoked by uid 22791); 27 Jun 2011 16:39:59 -0000 X-SWARE-Spam-Status: No, hits=-0.8 required=5.0 tests=AWL, BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Jun 2011 16:39:42 +0000 Received: from kpbe12.cbf.corp.google.com (kpbe12.cbf.corp.google.com [172.25.105.76]) by smtp-out.google.com with ESMTP id p5RGddY7000870; Mon, 27 Jun 2011 09:39:40 -0700 Received: from topo.tor.corp.google.com (topo.tor.corp.google.com [172.29.41.2]) by kpbe12.cbf.corp.google.com with ESMTP id p5RGdbmP024393; Mon, 27 Jun 2011 09:39:38 -0700 Received: by topo.tor.corp.google.com (Postfix, from userid 54752) id 6C7221DA195; Mon, 27 Jun 2011 12:39:37 -0400 (EDT) To: reply@codereview.appspotmail.com, crowl@google.com, gchare@google.com, gcc-patches@gcc.gnu.org Subject: [pph] New test (issue4629075) Message-Id: <20110627163937.6C7221DA195@topo.tor.corp.google.com> Date: Mon, 27 Jun 2011 12:39:37 -0400 (EDT) From: dnovillo@google.com (Diego Novillo) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 --- This patch is available for review at http://codereview.appspot.com/4629075 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 + +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