From patchwork Wed Apr 8 21:48:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Stefaniuc X-Patchwork-Id: 6182771 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BF9999F1C4 for ; Wed, 8 Apr 2015 21:48:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 07EC820390 for ; Wed, 8 Apr 2015 21:48:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1A6B220386 for ; Wed, 8 Apr 2015 21:48:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754038AbbDHVsl (ORCPT ); Wed, 8 Apr 2015 17:48:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41850 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753363AbbDHVsl (ORCPT ); Wed, 8 Apr 2015 17:48:41 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id EEDCD8E686 for ; Wed, 8 Apr 2015 21:48:40 +0000 (UTC) Received: from brasov.str.redhat.com (brasov.str.redhat.com [10.33.193.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t38Lmeds014245 for ; Wed, 8 Apr 2015 17:48:40 -0400 Received: by brasov.str.redhat.com (Postfix, from userid 2500) id D2371A0197; Wed, 8 Apr 2015 23:48:39 +0200 (CEST) Date: Wed, 8 Apr 2015 23:48:39 +0200 From: Michael Stefaniuc To: linux-sparse@vger.kernel.org Subject: [PATCH] Add tests for the builtin INF and nan() functions. Message-ID: <20150408214839.GA24502@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Test file cross checked with gcc -c -Wall -Werror -Wno-unused-variable validation/builtin_inf.c Signed-off-by: Michael Stefaniuc --- Sorry for the delay. validation/builtin_inf.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 validation/builtin_inf.c diff --git a/validation/builtin_inf.c b/validation/builtin_inf.c new file mode 100644 index 0000000..48546e4 --- /dev/null +++ b/validation/builtin_inf.c @@ -0,0 +1,13 @@ +static double d = __builtin_huge_val(); +static float f = __builtin_huge_valf(); +static long double l = __builtin_huge_vall(); +static double di = __builtin_inf(); +static float fi = __builtin_inff(); +static long double li = __builtin_infl(); +static double dn = __builtin_nan(""); +static float fn = __builtin_nanf(""); +static long double ln = __builtin_nanl(""); + +/* + * check-name: __builtin INFINITY / nan() + */