From patchwork Sun Apr 13 07:08:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Blaikie X-Patchwork-Id: 524 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 4740836007E for ; Sun, 13 Apr 2014 00:08:22 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14314964) id E93274956387; Sun, 13 Apr 2014 00:08:21 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx22.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx22.g.dreamhost.com (Postfix) with ESMTPS id C5BCB4956330 for ; Sun, 13 Apr 2014 00:08:21 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; q=dns; s=default; b= cGiaIyYRx0ahU9Nv5RXp9ezdY1J6U2Q3nNzzE5noURNcok2vcyEaeKrK4ERIkZV9 hCp/87WS+KDwRiLh76nWb/30GbxLoyOnA3eMmYTLS9B0qJz3FtPN3QlCKPTQjyJR kuKcEivhTSOPZWOvnuToDGAbScVo+NbqocovdQMg4cw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; s=default; bh=zgMHK k98kxWWMwKnywNCB0kP+ng=; b=C6WnOP1nxBTYpQr+NXYxmClKTrEFKDQ2At/KW TF0ed0VVlHs+P9ax0Wxt2sRzB5rc/3uIPiipQfSmVmMaDj7KmhMfNdcuLpZlPou5 DmP/pPMSFu1GjZ+OJVo32ptVOB/h0EXkFB24VjObzIxhHHLKgx2fQjniQDGcuGIB h7fHD0= Received: (qmail 10937 invoked by alias); 13 Apr 2014 07:08:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 10916 invoked by uid 89); 13 Apr 2014 07:08:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qa0-f41.google.com Received: from mail-qa0-f41.google.com (HELO mail-qa0-f41.google.com) (209.85.216.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 13 Apr 2014 07:08:12 +0000 Received: by mail-qa0-f41.google.com with SMTP id j5so6956208qaq.0 for ; Sun, 13 Apr 2014 00:08:10 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.224.50.211 with SMTP id a19mr11046775qag.49.1397372890622; Sun, 13 Apr 2014 00:08:10 -0700 (PDT) Received: by 10.140.30.74 with HTTP; Sun, 13 Apr 2014 00:08:10 -0700 (PDT) In-Reply-To: References: Date: Sun, 13 Apr 2014 00:08:10 -0700 Message-ID: Subject: Re: [patch] explicitly specify -std=gnu89 for gdb.cp/inline-break.exp From: David Blaikie To: Andrew Pinski Cc: gdb-patches , Eric Christopher , Doug Evans X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in On Fri, Apr 11, 2014 at 7:59 PM, Andrew Pinski wrote: > On Fri, Apr 11, 2014 at 4:58 PM, David Blaikie wrote: >> This test is intending to use gnu style inline rather than the >> standard c99 inline semantics. Clang defaults to c99 and the test >> breaks for this (and other - there's an inlining debug info quality >> bug here too - I'll file a bug and kfail the remaining failures in a >> separate patch) reason. > > Or better yet, use the gnu_inline attribute on those functions. Ah, good plan - patch attached for that fix instead. Though at this point, I'd consider removing the GNUC conditional - for this test to be meaningful the compiler must support gnu inlining semantics. Are there compilers that support those semantics but don't support GCC attribute syntax and the gnu_inline attribute in particular? Removing the conditional would cause any compiler that doesn't support the attributes to just fail to compile, marking the test as untested rather than producing failures. commit a0f7d916bf274325b1535d7f4eade43953cb2bf2 Author: David Blaikie Date: Sun Apr 13 00:01:21 2014 -0700 Use attribute to specify the required inlining semantics As suggested by Andrew Pinski. gdb/testsuite/ * gdb.opt/inline-break.c: Fix clang compatibility by specifying gnu_inline semantics via attribute. * gdb.opt/inline-break.exp: Remove -std=c89 now that the test source explicitly specifies the required semantics. diff --git gdb/testsuite/ChangeLog gdb/testsuite/ChangeLog index 730c116..44b2eeb 100644 --- gdb/testsuite/ChangeLog +++ gdb/testsuite/ChangeLog @@ -6,6 +6,13 @@ 2014-04-11 David Blaikie + * gdb.opt/inline-break.c: Fix clang compatibility by specifying + gnu_inline semantics via attribute. + * gdb.opt/inline-break.exp: Remove -std=c89 now that the test source + explicitly specifies the required semantics. + +2014-04-11 David Blaikie + * gdb.opt/inline-break.exp: Explicitly specify -std=gnu89 to override Clang's default. diff --git gdb/testsuite/gdb.opt/inline-break.c gdb/testsuite/gdb.opt/inline-break.c index 9513eec..f8a9ec9 100644 --- gdb/testsuite/gdb.opt/inline-break.c +++ gdb/testsuite/gdb.opt/inline-break.c @@ -19,7 +19,7 @@ this file, and should be regenerated if this file is modified. */ #ifdef __GNUC__ -# define ATTR __attribute__((always_inline)) +# define ATTR __attribute__((gnu_inline)) __attribute__((always_inline)) #else # define ATTR #endif diff --git gdb/testsuite/gdb.opt/inline-break.exp gdb/testsuite/gdb.opt/inline-break.exp index 4ff379a..21c958a 100644 --- gdb/testsuite/gdb.opt/inline-break.exp +++ gdb/testsuite/gdb.opt/inline-break.exp @@ -19,10 +19,8 @@ standard_testfile -# Explicitly specify gnu89 for gnu inline semantics to override Clang's default -# of c99. if { [prepare_for_testing $testfile.exp $testfile $srcfile \ - {debug optimize=-O2 additional_flags=-Winline additional_flags=-std=gnu89}] } { + {debug optimize=-O2 additional_flags=-Winline}] } { return -1 }