From patchwork Thu Jul 31 19:20:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 375386 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B129C1400D5 for ; Fri, 1 Aug 2014 05:21:12 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=YbUKuJIa6d779r/zjK/cnuV0U6cxf/0ChSL5GHs7Mo8 duyo/CJXHviPN9AHQkDw4JyL0IbasD49PxmG+bUg7uaPP3pGVte/PPLTT3l0AgHQ qrsqiqxddYvidjfD6HLdbJsu0vKcSSJZGsU2R2iWi4DVGlZFN+nomsuS33fuD8Ak = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=VDPvpuSJ/yqGMy217nX8Klpd4dg=; b=d2FRBCxuvzsXQOBE1 voR7WCOvzoweugcvlboQNG/U13NNG4SOBf7p6LGCdtMOTEyN6hGfoKMyTcymumTe 5oBQPtRQOkc65BAGQ+14HgwHMzXVHbVrGrMkPzgplxvANfvjzrPqDqVy9nE7RhD3 YT2cth2RXCuAKKUNyY8HgPqZBc= Received: (qmail 31615 invoked by alias); 31 Jul 2014 19:21:06 -0000 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 Received: (qmail 31596 invoked by uid 89); 31 Jul 2014 19:21:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 Jul 2014 19:21:04 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1XCvuO-0006Pm-4e from Tom_deVries@mentor.com ; Thu, 31 Jul 2014 12:21:00 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 31 Jul 2014 12:20:59 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Thu, 31 Jul 2014 20:20:57 +0100 Message-ID: <53DA9714.5070707@mentor.com> Date: Thu, 31 Jul 2014 21:20:52 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Rainer Orth CC: GCC Patches Subject: [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc Rainer, The test-case cproj-fails-with-broken-glibc.c does not work with broken glibcs, as the header comment mentions: ... Check the runtime behavior of the C library's cproj() function and whether it follows the standard. Versions of GLIBC through 2.11.1 had an incorrect implementation which will conflict with GCC's builtin cproj(). GLIBC 2.12+ should be okay. ... This patch skips the test for known broken glibcs. OK for trunk? Thanks, - Tom 2014-07-31 Tom de Vries * lib/target-supports.exp (check_effective_target_glibc) (check_effective_target_glibc_2_12_or_later) (check_effective_target_not_glibc_2_11_or_earlier): New proc. * gcc.dg/cproj-fails-with-broken-glibc.c: Require effective target not_glibc_2_11_or_earlier. diff --git a/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c b/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c index fe143b9..1df29f9 100644 --- a/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c +++ b/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c @@ -11,6 +11,7 @@ /* { dg-options "-fno-builtin-cproj" } */ /* { dg-add-options c99_runtime } */ /* { dg-require-effective-target c99_runtime } */ +/* { dg-require-effective-target not_glibc_2_11_or_earlier } */ extern void abort(void); extern void exit(int); diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index fa5137e..cbe2930 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5038,6 +5038,44 @@ proc check_effective_target_newlib {} { }] } +# Return true if this is a glibc target. + +proc check_effective_target_glibc {} { + return [check_no_compiler_messages glibc object { + #include + #if !(defined (__GLIBC__) && defined (__GLIBC_MINOR__)) + #error FOO + #endif + }] +} + +# Return true if this is a glibc 2.12 or later target. + +proc check_effective_target_glibc_2_12_or_later {} { + return [check_no_compiler_messages glibc_2_12_or_later object { + #include + #if !(defined (__GLIBC__) && defined (__GLIBC_MINOR__) \ + && __GLIBC_PREREQ(2,12)) + #error FOO + #endif + }] +} + +# Return true if this is a not a glibc 2.11 or earlier target. + +proc check_effective_target_not_glibc_2_11_or_earlier {} { + + if { ![check_effective_target_glibc] } { + return 1 + } + + if { [check_effective_target_glibc_2_12_or_later] } { + return 1 + } + + return 0 +} + # Return true if this is NOT a Bionic target. proc check_effective_target_non_bionic {} { -- 1.9.1