From patchwork Thu Nov 15 16:20:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 199340 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 6B5AE2C032F for ; Fri, 16 Nov 2012 03:21:12 +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=1353601273; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=mJyZpS57+7OXiJhvLN/pMYNrDa0=; b=wbwRNuEP7L/wUKX SoyPksYFkAkSR40TYDDUOcHz8xLpoo1wktazBOn3OZg8zMYHI4mwSwGfj7SE55dg Wg4kdJj8sQXvP9rUbyJMPiTG52yJ8jzLI7ozbTXYixD3arD/9GkujbZWNmBMd4a7 zIU/Z/1HT1L0HqLNXOVwZT8T3db8= 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:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=NvjlFKApUvTHRWkUhDQzAX0m10mDs9+9slaiYtcanQd9WCbbZNdfzSZ6Bb/d9A EI5jalpzNN0dUDu+Q3HlE1oP3QHfZYl1NcuF1pbpRjW8nXGGx2erabxSwrnZG2N7 qFJR1DekVvhN/cPVWUt8WfTwzxNDbQdOOSOV67xlYVYf8=; Received: (qmail 7478 invoked by alias); 15 Nov 2012 16:20:57 -0000 Received: (qmail 7466 invoked by uid 22791); 15 Nov 2012 16:20:55 -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; Thu, 15 Nov 2012 16:20:48 +0000 Received: by mail-pa0-f47.google.com with SMTP id fa11so1122644pad.20 for ; Thu, 15 Nov 2012 08:20:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.66.79.72 with SMTP id h8mr4525656pax.49.1352996448159; Thu, 15 Nov 2012 08:20:48 -0800 (PST) Received: by 10.66.246.232 with HTTP; Thu, 15 Nov 2012 08:20:48 -0800 (PST) In-Reply-To: References: Date: Thu, 15 Nov 2012 17:20:48 +0100 Message-ID: Subject: [PATCH v2, testsuite]: Add dg-error for unsupported floating suffix From: Uros Bizjak To: 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 1:35 AM, Uros Bizjak wrote: > Attached patch fixes following testsuite failure > > FAIL: g++.dg/cpp0x/gnu_fext-numeric-literals.C (test for excess errors) > FAIL: g++.dg/cpp0x/std_fext-numeric-literals.C (test for excess errors) > > on targets that don't support Q and W floating suffixes. This revision auto-detect support for Q and W suffixes. 2012-11-15 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. Tested on alphaev68-pc-linux-gnu and x86_64-pc-linux-gnu. OK for mainline? 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; + }] +} + +# 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; + }] +} # 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 }