From patchwork Fri Aug 5 22:49:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gab Charette X-Patchwork-Id: 108747 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 98509B72DD for ; Sat, 6 Aug 2011 08:49:51 +1000 (EST) Received: (qmail 10880 invoked by alias); 5 Aug 2011 22:49:49 -0000 Received: (qmail 10872 invoked by uid 22791); 5 Aug 2011 22:49:48 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RP_MATCHES_RCVD, SPF_HELO_PASS 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; Fri, 05 Aug 2011 22:49:34 +0000 Received: from wpaz17.hot.corp.google.com (wpaz17.hot.corp.google.com [172.24.198.81]) by smtp-out.google.com with ESMTP id p75MnWpZ026662; Fri, 5 Aug 2011 15:49:32 -0700 Received: from gchare.mtv.corp.google.com (gchare.mtv.corp.google.com [172.18.111.122]) by wpaz17.hot.corp.google.com with ESMTP id p75MnUjV024646; Fri, 5 Aug 2011 15:49:30 -0700 Received: by gchare.mtv.corp.google.com (Postfix, from userid 138564) id 0B5161C1EDE; Fri, 5 Aug 2011 15:49:29 -0700 (PDT) To: reply@codereview.appspotmail.com, crowl@google.com, dnovillo@google.com, gcc-patches@gcc.gnu.org Subject: [pph] Adding one hard and failing ordering test (issue4854042) Message-Id: <20110805224930.0B5161C1EDE@gchare.mtv.corp.google.com> Date: Fri, 5 Aug 2011 15:49:29 -0700 (PDT) From: gchare@google.com (Gabriel Charette) 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 This is the test I was talking would potentially fail with our current implementation. And it does. It has an assembly difference in the order of the global variables, like we used to have in simpler tests. Gab 2011-08-05 Gabriel Charette * (x0hardorder1.h): New. * (x3hardorder2.h): New. * (x3hardorder.cc): New. --- This patch is available for review at http://codereview.appspot.com/4854042 diff --git a/gcc/testsuite/g++.dg/pph/x0hardorder1.h b/gcc/testsuite/g++.dg/pph/x0hardorder1.h new file mode 100644 index 0000000..bfb547e --- /dev/null +++ b/gcc/testsuite/g++.dg/pph/x0hardorder1.h @@ -0,0 +1,13 @@ +#ifndef HARD_ORDER_1_H +#define HARD_ORDER_1_H + +int a1 = 1; + +namespace N { + int n1 = 1; + int m1 = 2; +} + +float b1 = 1.1; + +#endif diff --git a/gcc/testsuite/g++.dg/pph/x3hardorder.cc b/gcc/testsuite/g++.dg/pph/x3hardorder.cc new file mode 100644 index 0000000..8f62539 --- /dev/null +++ b/gcc/testsuite/g++.dg/pph/x3hardorder.cc @@ -0,0 +1,8 @@ +//pph asm xdiff 28345 +//Ordering of globals is different + +#include "x3hardorder2.h" + +int test () { + return a1 + a2 - b1 + b2 * N::n1 + N::n2 - N::m1 + N::m2; +} diff --git a/gcc/testsuite/g++.dg/pph/x3hardorder2.h b/gcc/testsuite/g++.dg/pph/x3hardorder2.h new file mode 100644 index 0000000..d534ae4 --- /dev/null +++ b/gcc/testsuite/g++.dg/pph/x3hardorder2.h @@ -0,0 +1,18 @@ +#ifndef HARD_ORDER_2_H +#define HARD_ORDER_2_H + +int a2 = 2; + +namespace N { + int n2 = 3; +} + +#include "x0hardorder1.h" + +float b2 = 2.2; + +namespace N { + int m2 = 3; +} + +#endif