From patchwork Wed Mar 19 15:55:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 331775 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 D630D2C00AD for ; Thu, 20 Mar 2014 02:56:10 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=ojWBYb/zgxYVCwo5/++FoL3YqiwXV wltC8rvCf2B6vH0qM9tk7Z2cu9xOFMVg4Vqxbx91bdss0qnAOLXRiCGZnba0CvRI PRA54tGd3bkbASH7abYgyam43hVl2Y8sV2HtgQMBx7WESwsXI7/1+8bSLZTrUZY8 HPDte4OGa4jnyM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=/iWM1Ba/2ljlt16o+ORPCCakSvo=; b=aHa dtlDV605Ssqoofb6lHKvEcs6NqwXAf8Ar9TdYXAGJJUC3LnmwqXADnkxCEb7JSmN OyCPpBYiHQ+qJ7Q+MnIY6uEkom/jPNaIdmJ71/5msk3lsaLBSZ9DJBoOAR1WufHh uEhc8Y791TxUBZdb7WY9aF6qEgrXmt4RzIr5lLms= Received: (qmail 16182 invoked by alias); 19 Mar 2014 15:56:05 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 16173 invoked by uid 89); 19 Mar 2014 15:56:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Wed, 19 Mar 2014 15:55:42 +0000 From: "Joseph S. Myers" To: Subject: Use ALL_RM_TEST for more libm tests Message-ID: MIME-Version: 1.0 Continuing the move to using ALL_RM_TEST for tests in libm-test.inc, this patch converts the tests of fdim, ldexp and scalb. fdim and scalb are cases where tests could depend on the rounding mode though none of the present test inputs do; ldexp is such a case where the function is equivalent to scalbn (for binary floating point) and the tests used were a subset of those for scalbn, so this patch makes ldexp testing use the scalbn tests, as done for other cases of libm function aliases. Tested x86_64 and x86. 2014-03-19 Joseph Myers * math/libm-test.inc (fdim_test): Use ALL_RM_TEST. (ldexp_test_data): Remove. (ldexp_test): Move to after scalbn_test. Use ALL_RM_TEST with scalbn_test_data. (scalb_test): Use ALL_RM_TEST. diff --git a/math/libm-test.inc b/math/libm-test.inc index 5ad0255..47c162f 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -7445,9 +7445,7 @@ static const struct test_ff_f_data fdim_test_data[] = static void fdim_test (void) { - START (fdim, 1); - RUN_TEST_LOOP_ff_f (fdim, fdim_test_data, ); - END; + ALL_RM_TEST (fdim, 1, fdim_test_data, RUN_TEST_LOOP_ff_f, END); } @@ -8169,31 +8167,6 @@ jn_test (void) } -static const struct test_fi_f_data ldexp_test_data[] = - { - TEST_fi_f (ldexp, 0, 0, 0, NO_INEXACT_EXCEPTION), - TEST_fi_f (ldexp, minus_zero, 0, minus_zero, NO_INEXACT_EXCEPTION), - - TEST_fi_f (ldexp, plus_infty, 1, plus_infty, NO_INEXACT_EXCEPTION), - TEST_fi_f (ldexp, minus_infty, 1, minus_infty, NO_INEXACT_EXCEPTION), - TEST_fi_f (ldexp, qnan_value, 1, qnan_value, NO_INEXACT_EXCEPTION), - - TEST_fi_f (ldexp, 0.8L, 4, 12.8L, NO_INEXACT_EXCEPTION), - TEST_fi_f (ldexp, -0.854375L, 5, -27.34L, NO_INEXACT_EXCEPTION), - - /* ldexp (x, 0) == x. */ - TEST_fi_f (ldexp, 1.0L, 0L, 1.0L, NO_INEXACT_EXCEPTION), - }; - -static void -ldexp_test (void) -{ - START (ldexp, 1); - RUN_TEST_LOOP_fi_f (ldexp, ldexp_test_data, ); - END; -} - - static const struct test_f_f1_data lgamma_test_data[] = { TEST_f_f1 (lgamma, plus_infty, plus_infty, 1), @@ -9784,10 +9757,7 @@ static const struct test_ff_f_data scalb_test_data[] = static void scalb_test (void) { - - START (scalb, 1); - RUN_TEST_LOOP_ff_f (scalb, scalb_test_data, ); - END; + ALL_RM_TEST (scalb, 1, scalb_test_data, RUN_TEST_LOOP_ff_f, END); } @@ -9830,6 +9800,13 @@ scalbn_test (void) ALL_RM_TEST (scalbn, 1, scalbn_test_data, RUN_TEST_LOOP_fi_f, END); } +static void +ldexp_test (void) +{ + /* ldexp uses the same test data as scalbn. */ + ALL_RM_TEST (ldexp, 1, scalbn_test_data, RUN_TEST_LOOP_fi_f, END); +} + static const struct test_fl_f_data scalbln_test_data[] = {