From patchwork Fri Nov 16 07:53:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 199507 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 0491C2C0091 for ; Fri, 16 Nov 2012 18:54:08 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1353657249; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=tly+YvSoLsOIluQyofVjzW9vbiw=; b=tAHEQwfcOpCeDGUcQr6cGqZxbkcNVJ05ijRHBcZmelVSzghkA3SeEo6ZWHxH8Y sfY5ijaRjuI+P55+ixIng0CXk+PzsYYAsgeb/g6qr9jX3uH6frGZTw0uPyZIzYe9 S3jt1PSf5yPbFWpiaaLKlsi34xN07FZG2wr2UkXzDJU5g= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ibtbzflCJsi091mKRW3LSF1UdpdbqyUwHR4Xi5ClEqxNP0hYg+rLJUAdtUM9xd 90sMmpSEeEtTakLwQ4t+vELTYCpilbjROdB7ktuhhO7OF85LI5LuUYpzrdQmXuuC G3D9s7l3mLQ7ZQyo+e0jQQ1gxhiF2K863hZu0stXEmZls=; Received: (qmail 20089 invoked by alias); 16 Nov 2012 07:54:04 -0000 Received: (qmail 20081 invoked by uid 22791); 16 Nov 2012 07:54:03 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_QF, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Nov 2012 07:53:55 +0000 Received: by mail-pa0-f47.google.com with SMTP id fa11so1615422pad.20 for ; Thu, 15 Nov 2012 23:53:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.241.73 with SMTP id wg9mr6647972pbc.3.1353052435006; Thu, 15 Nov 2012 23:53:55 -0800 (PST) Received: by 10.66.246.232 with HTTP; Thu, 15 Nov 2012 23:53:54 -0800 (PST) In-Reply-To: References: <20121115162519.GX1886@tucnak.redhat.com> <20121115163458.GY1886@tucnak.redhat.com> <20121115164457.GZ1886@tucnak.redhat.com> Date: Fri, 16 Nov 2012 08:53:54 +0100 Message-ID: Subject: Re: [PATCH v2, testsuite]: Add dg-error for unsupported floating suffix From: Uros Bizjak To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org 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 On Thu, Nov 15, 2012 at 7:44 PM, Uros Bizjak wrote: >>> >> No, the intention of this test is to check if target can handle these >>> >> suffixes through TARGET_C_MODE_FOR_SUFFIX. Please note that in >>> >> particular tests, -std=x compile switches are added to compile flags. >>> > >>> > But -std=c++11 (well, perhaps -std=gnu++11) could be eventually the default. >>> > As Q/W suffixes are only supported in certain modes through >>> > TARGET_C_MODE_FOR_SUFFIX, it is better to put the explicit option that >>> > allows it on the command line of the check_effective_target* test. >>> >>> Do you have option in mind that would be appropriate for the test? >> >> "-std=gnu++03" ? > > Adding "-w" to skip a warning that this option applies only to c++ did > the trick. 2012-11-16 Uros Bizjak * lib/target_suports.exp (check_effective_target_has_w_floating_suffix): New procedure. (check_effective_target_has_q_floating_suffix): Ditto. * g++.dg/cpp0x/gnu_fext-numeric-literals.C: Add dg-error directive for unsupported non-standard suffix on floating constant. * g++.dg/cpp0x/std_fext-numeric-literals.C: Ditto. Attached patch was re-tested on alphaev68-linux-gnu and x86_64-linux-gnu and committed to mainline SVN. Uros. Index: lib/target-supports.exp =================================================================== --- lib/target-supports.exp (revision 193533) +++ lib/target-supports.exp (working copy) @@ -1742,6 +1742,23 @@ }] } +# Return 1 if the target supports 'w' suffix on floating constant +# 0 otherwise. + +proc check_effective_target_has_w_floating_suffix { } { + return [check_no_compiler_messages w_fp_suffix object { + float dummy = 1.0w; + } "-std=gnu++03 -w"] +} + +# Return 1 if the target supports 'q' suffix on floating constant +# 0 otherwise. + +proc check_effective_target_has_q_floating_suffix { } { + return [check_no_compiler_messages q_fp_suffix object { + float dummy = 1.0q; + } "-std=gnu++03 -w"] +} # Return 1 if the target supports compiling fixed-point, # 0 otherwise. Index: g++.dg/cpp0x/gnu_fext-numeric-literals.C =================================================================== --- g++.dg/cpp0x/gnu_fext-numeric-literals.C (revision 193533) +++ g++.dg/cpp0x/gnu_fext-numeric-literals.C (working copy) @@ -91,10 +91,10 @@ auto rfp = 1.0r; // { dg-error "fixed-point types not supported" } auto Rfp = 1.0R; // { dg-error "fixed-point types not supported" } - auto wfp = 1.0w; - auto Wfp = 1.0W; - auto qfp = 1.0q; - auto Qfp = 1.0Q; + auto wfp = 1.0w; // { dg-error "unsupported" "" { target { ! has_w_floating_suffix } } } + auto Wfp = 1.0W; // { dg-error "unsupported" "" { target { ! has_w_floating_suffix } } } + auto qfp = 1.0q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } + auto Qfp = 1.0Q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } } // { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 7 } Index: g++.dg/cpp0x/std_fext-numeric-literals.C =================================================================== --- g++.dg/cpp0x/std_fext-numeric-literals.C (revision 193533) +++ g++.dg/cpp0x/std_fext-numeric-literals.C (working copy) @@ -91,10 +91,10 @@ auto rfp = 1.0r; // { dg-error "fixed-point types not supported" } auto Rfp = 1.0R; // { dg-error "fixed-point types not supported" } - auto wfp = 1.0w; - auto Wfp = 1.0W; - auto qfp = 1.0q; - auto Qfp = 1.0Q; + auto wfp = 1.0w; // { dg-error "unsupported" "" { target { ! has_w_floating_suffix } } } + auto Wfp = 1.0W; // { dg-error "unsupported" "" { target { ! has_w_floating_suffix } } } + auto qfp = 1.0q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } + auto Qfp = 1.0Q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } } // { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 7 }