From patchwork Fri Aug 15 13:49:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Ivchenko X-Patchwork-Id: 380243 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 1434514008C for ; Fri, 15 Aug 2014 23:49:32 +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 :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=iu8rJ9gHPskh2Y147U +pDRGtf3azfx+uZpwAGsT7GAC0JcT+7UTzSlIDBefmhkv53R28j3puOqraXFF5zP 0IffHZKbgxbvgmLn1wsoL9s8f9YAXlYhJfe7gWaUFbbCTRiw83SXxBCseB3J9jTZ kkG/0PWHgfUgrQYmvAD21oJvY= 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 :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=O3pflgvcX4iAsMy6VJ2+z/oL 3pQ=; b=qqwxDPsLKi2KODtaBi+i+IcKA8EnOLkJnLiiGqWdcIPfh80feN1IQYFF yxxpzrS6m1A2vaXKPy1pjbf8cJMqYdrFEfyu3sSS36DtseX77GdbtSy8sH+s9vji odyyHDe/qHrftOnZX06ckt2fGYFLc2+6N4AWctKdiYZXAAe0HT8= Received: (qmail 2129 invoked by alias); 15 Aug 2014 13:49:23 -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 2112 invoked by uid 89); 15 Aug 2014 13:49:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 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-f52.google.com Received: from mail-qa0-f52.google.com (HELO mail-qa0-f52.google.com) (209.85.216.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 15 Aug 2014 13:49:20 +0000 Received: by mail-qa0-f52.google.com with SMTP id j15so2042865qaq.25 for ; Fri, 15 Aug 2014 06:49:18 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.229.38.3 with SMTP id z3mr27905702qcd.17.1408110558836; Fri, 15 Aug 2014 06:49:18 -0700 (PDT) Received: by 10.96.90.101 with HTTP; Fri, 15 Aug 2014 06:49:18 -0700 (PDT) In-Reply-To: References: Date: Fri, 15 Aug 2014 17:49:18 +0400 Message-ID: Subject: Re: [patch, testsuite] Applying non_bionic effective target to particular tests From: Alexander Ivchenko To: "Joseph S. Myers" Cc: GCC Patches , enh X-IsSubscribed: yes Hi Joseph, I seem to address what you've said. Except for I still left non_bionic check for three tests (Namely: builtins-67.c, strlenopt-14g.c, strlenopt-14gf.c) because checks for the presence of mempcpy, stpcpy and rintl (sorry, I didn't mention it last time) seem to be very narrow, I don't think they would bring any value. I tested 'make check' on x86_64-unknown-linux-gnu and i686-pc-linux-android. 2014-08-15 Alexander Ivchenko * lib/target-supports.exp (error_h): New check. (libc_has_complex_functions): Ditto. (tgmath_h): Ditto. * gcc.dg/builtins-59.c: Add libc_has_complex_functions check. * gcc.dg/builtins-61.c: Likewise. * gcc.dg/builtins-67.c: Disable test for Bionic. * gcc.dg/strlenopt-14g.c: Likewise. * gcc.dg/strlenopt-14gf.c: Likewise. * gcc.dg/c99-tgmath-1.c: Add tgmath_h check. * gcc.dg/c99-tgmath-2.c: Likewise. * gcc.dg/c99-tgmath-3.c: Likewise. * gcc.dg/c99-tgmath-4.c: Likewise. * gcc.dg/dfp/convert-dfp-round-thread.c: Add error_h check. Here is the updated patch: thanks, Alexander 2014-08-14 0:46 GMT+04:00 Joseph S. Myers : > On Thu, 14 Aug 2014, Alexander Ivchenko wrote: > >> Hi, >> >> This patch disables a bunch of tests that fail when using Bionic libc. >> But this is expected; three reasons: >> - Bionic does not support complex functions. >> - Bionic does not have tgmath.h and error.h headers. >> - Bionic does not have mempcpy and stpcpy. > > Testing logical features for each of these would seem better than testing > for Bionic. > > -- > Joseph S. Myers > joseph@codesourcery.com diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 505df55..02268e6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,19 @@ +2014-08-15 Alexander Ivchenko + + * lib/target-supports.exp (error_h): New check. + (libc_has_complex_functions): Ditto. + (tgmath_h): Ditto. + * gcc.dg/builtins-59.c: Add libc_has_complex_functions check. + * gcc.dg/builtins-61.c: Likewise. + * gcc.dg/builtins-67.c: Disable test for Bionic. + * gcc.dg/strlenopt-14g.c: Likewise. + * gcc.dg/strlenopt-14gf.c: Likewise. + * gcc.dg/c99-tgmath-1.c: Add tgmath_h check. + * gcc.dg/c99-tgmath-2.c: Likewise. + * gcc.dg/c99-tgmath-3.c: Likewise. + * gcc.dg/c99-tgmath-4.c: Likewise. + * gcc.dg/dfp/convert-dfp-round-thread.c: Add error_h check. + 2014-08-15 Jakub Jelinek Tobias Burnus diff --git a/gcc/testsuite/gcc.dg/builtins-59.c b/gcc/testsuite/gcc.dg/builtins-59.c index b940d39..f5c1803 100644 --- a/gcc/testsuite/gcc.dg/builtins-59.c +++ b/gcc/testsuite/gcc.dg/builtins-59.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-fdump-tree-gimple" } */ /* { dg-require-effective-target c99_runtime } */ +/* { dg-require-effective-target libc_has_complex_functions } */ double test (double x) { diff --git a/gcc/testsuite/gcc.dg/builtins-61.c b/gcc/testsuite/gcc.dg/builtins-61.c index dff163f..a3310af 100644 --- a/gcc/testsuite/gcc.dg/builtins-61.c +++ b/gcc/testsuite/gcc.dg/builtins-61.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O -ffast-math -fdump-tree-optimized" } */ /* { dg-require-effective-target c99_runtime } */ +/* { dg-require-effective-target libc_has_complex_functions } */ double test1 (double x) { diff --git a/gcc/testsuite/gcc.dg/builtins-67.c b/gcc/testsuite/gcc.dg/builtins-67.c index 22267bd..0992fe1 100644 --- a/gcc/testsuite/gcc.dg/builtins-67.c +++ b/gcc/testsuite/gcc.dg/builtins-67.c @@ -3,6 +3,8 @@ /* { dg-do link } */ /* { dg-options "-ffast-math -lm" } */ /* { dg-add-options c99_runtime } */ +/* Bionic doesn't have rintl */ +/* { dg-require-effective-target non_bionic } */ #include "builtins-config.h" diff --git a/gcc/testsuite/gcc.dg/c99-tgmath-1.c b/gcc/testsuite/gcc.dg/c99-tgmath-1.c index c7d848c..cfa02a9 100644 --- a/gcc/testsuite/gcc.dg/c99-tgmath-1.c +++ b/gcc/testsuite/gcc.dg/c99-tgmath-1.c @@ -3,6 +3,7 @@ /* { dg-do preprocess { target c99_runtime } } */ /* { dg-options "-std=iso9899:1999" } */ /* { dg-add-options c99_runtime } */ +/* { dg-require-effective-target tgmath_h } */ /* Test that tgmath defines the macros it's supposed to. */ #include diff --git a/gcc/testsuite/gcc.dg/c99-tgmath-2.c b/gcc/testsuite/gcc.dg/c99-tgmath-2.c index d4f1f87..1a1153c 100644 --- a/gcc/testsuite/gcc.dg/c99-tgmath-2.c +++ b/gcc/testsuite/gcc.dg/c99-tgmath-2.c @@ -3,6 +3,7 @@ /* { dg-do compile { target c99_runtime } } */ /* { dg-options "-std=iso9899:1999" } */ /* { dg-add-options c99_runtime } */ +/* { dg-require-effective-target tgmath_h } */ /* Test that invoking type-generic sin on a float invokes sinf. */ #include diff --git a/gcc/testsuite/gcc.dg/c99-tgmath-3.c b/gcc/testsuite/gcc.dg/c99-tgmath-3.c index 3e98304..a595cf6 100644 --- a/gcc/testsuite/gcc.dg/c99-tgmath-3.c +++ b/gcc/testsuite/gcc.dg/c99-tgmath-3.c @@ -3,6 +3,7 @@ /* { dg-do compile { target c99_runtime } } */ /* { dg-options "-std=iso9899:1999" } */ /* { dg-add-options c99_runtime } */ +/* { dg-require-effective-target tgmath_h } */ /* Test that invoking type-generic exp on a complex invokes cexp. */ #include diff --git a/gcc/testsuite/gcc.dg/c99-tgmath-4.c b/gcc/testsuite/gcc.dg/c99-tgmath-4.c index d8dc043..c05a1c5 100644 --- a/gcc/testsuite/gcc.dg/c99-tgmath-4.c +++ b/gcc/testsuite/gcc.dg/c99-tgmath-4.c @@ -3,6 +3,7 @@ /* { dg-do compile { target c99_runtime } } */ /* { dg-options "-std=iso9899:1999" } */ /* { dg-add-options c99_runtime } */ +/* { dg-require-effective-target tgmath_h } */ /* Test that invoking type-generic pow on complex float invokes cpowf. */ #include diff --git a/gcc/testsuite/gcc.dg/dfp/convert-dfp-round-thread.c b/gcc/testsuite/gcc.dg/dfp/convert-dfp-round-thread.c index 6727e80..59d9569 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-dfp-round-thread.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-dfp-round-thread.c @@ -1,5 +1,7 @@ /* { dg-options "-std=gnu99 -D_GNU_SOURCE -pthread" } */ /* { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } */ +/* { dg-require-effective-target error_h } */ + /* N1150 5.2: Conversions among decimal floating types and between decimal floating types and generic floating types. diff --git a/gcc/testsuite/gcc.dg/strlenopt-14g.c b/gcc/testsuite/gcc.dg/strlenopt-14g.c index 86c57f1..809205b 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-14g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-14g.c @@ -1,6 +1,8 @@ /* This test needs runtime that provides stpcpy and mempcpy functions. */ /* { dg-do run { target *-*-linux* *-*-gnu* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ +/* Bionic targets don't have mempcpy and stpcpy */ +/* { dg-require-effective-target non_bionic } */ #define USE_GNU #include "strlenopt.h" diff --git a/gcc/testsuite/gcc.dg/strlenopt-14gf.c b/gcc/testsuite/gcc.dg/strlenopt-14gf.c index 8b78538..e09a3fc 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-14gf.c +++ b/gcc/testsuite/gcc.dg/strlenopt-14gf.c @@ -2,6 +2,8 @@ functions. */ /* { dg-do run { target *-*-linux* *-*-gnu* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ +/* Bionic targets don't have mempcpy and stpcpy */ +/* { dg-require-effective-target non_bionic } */ #define FORTIFY_SOURCE 2 #include "strlenopt-14g.c" diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index c03370d..4ed4439 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5054,6 +5054,30 @@ proc check_effective_target_non_bionic {} { }] } +# Return true if this target has error.h header. + +proc check_effective_target_error_h {} { + return [check_no_compiler_messages error_h object { + #include + }] +} + +# Return true if this target has tgmath.h header. + +proc check_effective_target_tgmath_h {} { + return [check_no_compiler_messages tgmath_h object { + #include + }] +} + +# Return true if target's libc supports complex functions. + +proc check_effective_target_libc_has_complex_functions {} { + return [check_no_compiler_messages libc_has_complex_functions object { + #include + }] +} + # Return 1 if # (a) an error of a few ULP is expected in string to floating-point # conversion functions; and