From patchwork Fri Sep 30 20:44:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriraman Tallam X-Patchwork-Id: 117206 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 5F3DAB6F6F for ; Sat, 1 Oct 2011 06:44:48 +1000 (EST) Received: (qmail 6764 invoked by alias); 30 Sep 2011 20:44:46 -0000 Received: (qmail 6755 invoked by uid 22791); 30 Sep 2011 20:44:46 -0000 X-SWARE-Spam-Status: No, hits=-1.6 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) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Sep 2011 20:44:32 +0000 Received: from hpaq14.eem.corp.google.com (hpaq14.eem.corp.google.com [172.25.149.14]) by smtp-out.google.com with ESMTP id p8UKiUHI015771; Fri, 30 Sep 2011 13:44:31 -0700 Received: from azwildcat.mtv.corp.google.com (azwildcat.mtv.corp.google.com [172.18.110.231]) by hpaq14.eem.corp.google.com with ESMTP id p8UKiSI2022687; Fri, 30 Sep 2011 13:44:29 -0700 Received: by azwildcat.mtv.corp.google.com (Postfix, from userid 69128) id 4C308B2190; Fri, 30 Sep 2011 13:44:28 -0700 (PDT) To: reply@codereview.appspotmail.com, dnovillo@google.com, gcc-patches@gcc.gnu.org Subject: [google]Make test callgraph-profiles.C run only when section attribute e is supported (issue5167045) Message-Id: <20110930204428.4C308B2190@azwildcat.mtv.corp.google.com> Date: Fri, 30 Sep 2011 13:44:28 -0700 (PDT) From: tmsriram@google.com (Sriraman Tallam) 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 Disable running of callgraph-profiles.C is section attribute "e" is not supported. --- This patch is available for review at http://codereview.appspot.com/5167045 Index: lib/target-supports-dg.exp =================================================================== --- lib/target-supports-dg.exp (revision 179400) +++ lib/target-supports-dg.exp (working copy) @@ -100,6 +100,16 @@ } } +# If this target does not support the section exclude "e" attribute, +# skip this test. + +proc dg-require-section-exclude { args } { + if { ![ check_section_exclude_available ] } { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + } +} + # If this target's linker does not support the --gc-sections flag, # skip this test. Index: lib/target-supports.exp =================================================================== --- lib/target-supports.exp (revision 179400) +++ lib/target-supports.exp (working copy) @@ -382,6 +382,18 @@ }] } +# Returns true if tool chain supports "e" section attribute. + +proc check_section_exclude_available { } { + return [check_runtime_nocache section_exclude_available { + asm(".section \".gnu.callgraph.text.main\", \"e\""); + int main() + { + return 0; + } + }] +} + # Returns true if --gc-sections is supported on the target. proc check_gc_sections_available { } { Index: g++.dg/tree-prof/callgraph-profiles.C =================================================================== --- g++.dg/tree-prof/callgraph-profiles.C (revision 179400) +++ g++.dg/tree-prof/callgraph-profiles.C (working copy) @@ -1,6 +1,7 @@ /* Verify if call-graph profile sections are created with -fcallgraph-profiles-sections. */ /* { dg-options "-O2 -fcallgraph-profiles-sections -ffunction-sections --save-temps" } */ +/* { dg-require-section-exclude "" } */ int __attribute__ ((noinline)) foo ()