From patchwork Mon Feb 24 10:04:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenqiang Chen X-Patchwork-Id: 25183 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 45A632066C for ; Mon, 24 Feb 2014 10:04:59 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id hr13sf5596318lab.5 for ; Mon, 24 Feb 2014 02:04:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:mime-version:in-reply-to:references:date:message-id :subject:from:to:cc:x-original-sender :x-original-authentication-results:content-type; bh=tgVHU2ngXrWw+r0fGEIeI9DxmBp2ZnufZzfd3wLAQqc=; b=Hrv+d1PCkhrHaTzrtz7i2IPf+gNyN77fztzDGzEz3R/kwwY90aQtIUfekLKIElpJCY klX7j7Lgqbz7//GR1ekjWtsU+SmjoE7USn2u+3fiQ0NGArN9F3bRYgILIgEmGAk6n5I7 ecGQYDbaMX44XTAl/2C+0Jn/+BtFzR++EqboYVNFz/ei/hxwwexOuaO1ke0zWOPAt8QI 5xyA3OVQ54hTIB34ExR989gtqaQ5PtDlbdTJePcrx6evM4z+BaAU/8USH2uEAbjo7TS/ RlBQ8RL0R0yBlH5H8vt3WkQgUTfMZDZoq7N+HMJu0H8rJ4qzybVYnfnXLM4+8RYZLy3X EdLg== X-Gm-Message-State: ALoCoQlk1QUlugBH8wb0K70C/6OOO9pTYLAfQnMK49ukMz1jKP1Py1RAQtw3PyDTlVL4h3Ajjcrx X-Received: by 10.112.254.129 with SMTP id ai1mr12784052lbd.7.1393236297484; Mon, 24 Feb 2014 02:04:57 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.139 with SMTP id 11ls1793627qgn.84.gmail; Mon, 24 Feb 2014 02:04:56 -0800 (PST) X-Received: by 10.221.29.137 with SMTP id ry9mr11944103vcb.6.1393236296476; Mon, 24 Feb 2014 02:04:56 -0800 (PST) Received: from mail-vc0-x234.google.com (mail-vc0-x234.google.com [2607:f8b0:400c:c03::234]) by mx.google.com with ESMTPS id x7si5706568vel.38.2014.02.24.02.04.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Feb 2014 02:04:56 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:400c:c03::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c03::234; Received: by mail-vc0-f180.google.com with SMTP id ks9so5526345vcb.11 for ; Mon, 24 Feb 2014 02:04:56 -0800 (PST) X-Received: by 10.52.117.115 with SMTP id kd19mr9926135vdb.15.1393236296244; Mon, 24 Feb 2014 02:04:56 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp50114vcz; Mon, 24 Feb 2014 02:04:55 -0800 (PST) X-Received: by 10.66.142.107 with SMTP id rv11mr24442635pab.17.1393236294942; Mon, 24 Feb 2014 02:04:54 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id l1si13774481pbn.83.2014.02.24.02.04.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Feb 2014 02:04:54 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-362284-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 23965 invoked by alias); 24 Feb 2014 10:04:31 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 23945 invoked by uid 89); 24 Feb 2014 10:04:30 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-la0-f49.google.com Received: from mail-la0-f49.google.com (HELO mail-la0-f49.google.com) (209.85.215.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 24 Feb 2014 10:04:17 +0000 Received: by mail-la0-f49.google.com with SMTP id mc6so1843007lab.8 for ; Mon, 24 Feb 2014 02:04:13 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.152.164.199 with SMTP id ys7mr11679099lab.31.1393236253233; Mon, 24 Feb 2014 02:04:13 -0800 (PST) Received: by 10.112.173.137 with HTTP; Mon, 24 Feb 2014 02:04:12 -0800 (PST) In-Reply-To: References: Date: Mon, 24 Feb 2014 18:04:12 +0800 Message-ID: Subject: Re: [PATCH 4/n] Add conditional compare support - test cases From: Zhenqiang Chen To: Rainer Orth Cc: "gcc-patches@gcc.gnu.org" X-IsSubscribed: yes X-Original-Sender: zhenqiang.chen@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c03::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 On 24 February 2014 17:26, Rainer Orth wrote: > Hi Zhenqiang Chen, > >> Here is the patch to include testcases to cover most combinations of >> conditional compares (signed, unsigned, int, short, long, "||", "&&", >> etc). > [...] >> diff --git a/gcc/testsuite/gcc.dg/ccmn-w-eq-1.c b/gcc/testsuite/gcc.dg/ccmn-w-eq-1.c >> new file mode 100644 >> index 0000000..446f8d2 >> --- /dev/null >> +++ b/gcc/testsuite/gcc.dg/ccmn-w-eq-1.c >> @@ -0,0 +1,102 @@ >> +//* { dg-do run } */ > > all of your testcases have mixed C++/C comments for the dg-do line. > Please use pure C comments instead. Thanks for the comments! Updated. -Zhenqiang diff --git a/gcc/testsuite/gcc.dg/ccmn-w-eq-1.c b/gcc/testsuite/gcc.dg/ccmn-w-eq-1.c new file mode 100644 index 0000000..446f8d2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmn-w-eq-1.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (int a, int b) \ +{ \ + if (a OP1 10 || b OP2 -20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, ==, ==) +TEST_FUNC(2, ==, !=) +TEST_FUNC(3, ==, <=) +TEST_FUNC(4, ==, <) +TEST_FUNC(5, ==, >=) +TEST_FUNC(6, ==, >) + + +int main () +{ + /* TEST_FUNC(1, ==, ==) */ + if (test_1 (10, -20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, -20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, ==, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, -20) != T_VAL) + __builtin_abort (); + if (test_2 (20, -20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, ==, <=) */ + if (test_3 (10, -25) != T_VAL) + __builtin_abort (); + if (test_3 (10, -20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, -15) != F_VAL) + __builtin_abort (); + if (test_3 (20, -20) != T_VAL) + __builtin_abort (); + if (test_3 (20, -25) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, ==, <) */ + if (test_4 (10, -25) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, -20) != T_VAL) + __builtin_abort (); + if (test_4 (20, -20) != F_VAL) + __builtin_abort (); + if (test_4 (20, -15) != F_VAL) + __builtin_abort (); + if (test_4 (20, -25) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, ==, >=) */ + if (test_5 (10, -20) != T_VAL) + __builtin_abort (); + if (test_5 (10, -15) != T_VAL) + __builtin_abort (); + if (test_5 (10, -25) != T_VAL) + __builtin_abort (); + if (test_5 (20, -20) != T_VAL) + __builtin_abort (); + if (test_5 (20, -25) != F_VAL) + __builtin_abort (); + if (test_5 (20, -15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, ==, >) */ + if (test_6 (10, -15) != T_VAL) + __builtin_abort (); + if (test_6 (10, -20) != T_VAL) + __builtin_abort (); + if (test_6 (10, -25) != T_VAL) + __builtin_abort (); + if (test_6 (20, -15) != T_VAL) + __builtin_abort (); + if (test_6 (20, -20) != F_VAL) + __builtin_abort (); + if (test_6 (20, -25) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmn-w-eq.c b/gcc/testsuite/gcc.dg/ccmn-w-eq.c new file mode 100644 index 0000000..65c6a84 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmn-w-eq.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (int a, int b) \ +{ \ + if (a OP1 10 && b OP2 -20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, ==, ==) +TEST_FUNC(2, ==, !=) +TEST_FUNC(3, ==, <=) +TEST_FUNC(4, ==, <) +TEST_FUNC(5, ==, >=) +TEST_FUNC(6, ==, >) + + +int main () +{ + /* TEST_FUNC(1, ==, ==) */ + if (test_1 (10, -20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, -20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, ==, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, -20) != F_VAL) + __builtin_abort (); + if (test_2 (20, -20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, ==, <=) */ + if (test_3 (10, -25) != T_VAL) + __builtin_abort (); + if (test_3 (10, -20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, -15) != F_VAL) + __builtin_abort (); + if (test_3 (20, -20) != F_VAL) + __builtin_abort (); + if (test_3 (20, -25) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, ==, <) */ + if (test_4 (10, -25) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, -20) != F_VAL) + __builtin_abort (); + if (test_4 (20, -20) != F_VAL) + __builtin_abort (); + if (test_4 (20, -15) != F_VAL) + __builtin_abort (); + if (test_4 (20, -25) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, ==, >=) */ + if (test_5 (10, -20) != T_VAL) + __builtin_abort (); + if (test_5 (10, -15) != T_VAL) + __builtin_abort (); + if (test_5 (10, -25) != F_VAL) + __builtin_abort (); + if (test_5 (20, -20) != F_VAL) + __builtin_abort (); + if (test_5 (20, -25) != F_VAL) + __builtin_abort (); + if (test_5 (20, -15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, ==, >) */ + if (test_6 (10, -15) != T_VAL) + __builtin_abort (); + if (test_6 (10, -20) != F_VAL) + __builtin_abort (); + if (test_6 (10, -25) != F_VAL) + __builtin_abort (); + if (test_6 (20, -15) != F_VAL) + __builtin_abort (); + if (test_6 (20, -20) != F_VAL) + __builtin_abort (); + if (test_6 (20, -25) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-l-eq-1.c b/gcc/testsuite/gcc.dg/ccmp-l-eq-1.c new file mode 100644 index 0000000..a9af11c --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-l-eq-1.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (long a, long b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, ==, ==) +TEST_FUNC(2, ==, !=) +TEST_FUNC(3, ==, <=) +TEST_FUNC(4, ==, <) +TEST_FUNC(5, ==, >=) +TEST_FUNC(6, ==, >) + + +int main () +{ + /* TEST_FUNC(1, ==, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, ==, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, ==, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, ==, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, ==, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, ==, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-l-eq.c b/gcc/testsuite/gcc.dg/ccmp-l-eq.c new file mode 100644 index 0000000..21a5263 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-l-eq.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (long a, long b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, ==, ==) +TEST_FUNC(2, ==, !=) +TEST_FUNC(3, ==, <=) +TEST_FUNC(4, ==, <) +TEST_FUNC(5, ==, >=) +TEST_FUNC(6, ==, >) + + +int main () +{ + /* TEST_FUNC(1, ==, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, ==, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, ==, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, ==, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, ==, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, ==, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-l-ge-1.c b/gcc/testsuite/gcc.dg/ccmp-l-ge-1.c new file mode 100644 index 0000000..ade1efb --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-l-ge-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (long a, long b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >=, ==) +TEST_FUNC(2, >=, !=) +TEST_FUNC(3, >=, <=) +TEST_FUNC(4, >=, <) +TEST_FUNC(5, >=, >=) +TEST_FUNC(6, >=, >) + + +int main () +{ + /* TEST_FUNC(1, >=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-l-ge.c b/gcc/testsuite/gcc.dg/ccmp-l-ge.c new file mode 100644 index 0000000..a515868 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-l-ge.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (long a, long b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >=, ==) +TEST_FUNC(2, >=, !=) +TEST_FUNC(3, >=, <=) +TEST_FUNC(4, >=, <) +TEST_FUNC(5, >=, >=) +TEST_FUNC(6, >=, >) + + +int main () +{ + /* TEST_FUNC(1, >=, ==) */ + if (test_1 (5, 20) != F_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >=, !=) */ + if (test_2 (5, 30) != F_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >=, <=) */ + if (test_3 (5, 15) != F_VAL) + __builtin_abort (); + if (test_3 (5, 20) != F_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >=, <) */ + if (test_4 (5, 15) != F_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >=, >=) */ + if (test_5 (5, 20) != F_VAL) + __builtin_abort (); + if (test_5 (5, 25) != F_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >=, >) */ + if (test_6 (5, 25) != F_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-l-gt-1.c b/gcc/testsuite/gcc.dg/ccmp-l-gt-1.c new file mode 100644 index 0000000..3d8d633 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-l-gt-1.c @@ -0,0 +1,136 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (long a, long b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >, ==) +TEST_FUNC(2, >, !=) +TEST_FUNC(3, >, <=) +TEST_FUNC(4, >, <) +TEST_FUNC(5, >, >=) +TEST_FUNC(6, >, >) + + +int main () +{ + /* TEST_FUNC(1, >, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + +#if 0 + /* TEST_FUNC(5, >, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + +#endif + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-l-gt.c b/gcc/testsuite/gcc.dg/ccmp-l-gt.c new file mode 100644 index 0000000..103e8e0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-l-gt.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (long a, long b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >, ==) +TEST_FUNC(2, >, !=) +TEST_FUNC(3, >, <=) +TEST_FUNC(4, >, <) +TEST_FUNC(5, >, >=) +TEST_FUNC(6, >, >) + + +int main () +{ + /* TEST_FUNC(1, >, ==) */ + if (test_1 (5, 20) != F_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >, !=) */ + if (test_2 (5, 30) != F_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >, <=) */ + if (test_3 (5, 15) != F_VAL) + __builtin_abort (); + if (test_3 (5, 20) != F_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >, <) */ + if (test_4 (5, 15) != F_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >, >=) */ + if (test_5 (5, 20) != F_VAL) + __builtin_abort (); + if (test_5 (5, 25) != F_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >, >) */ + if (test_6 (5, 25) != F_VAL) + __builtin_abort (); + if (test_6 (5, 30) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-l-le-1.c b/gcc/testsuite/gcc.dg/ccmp-l-le-1.c new file mode 100644 index 0000000..738c424 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-l-le-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (long a, long b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <=, ==) +TEST_FUNC(2, <=, !=) +TEST_FUNC(3, <=, <=) +TEST_FUNC(4, <=, <) +TEST_FUNC(5, <=, >=) +TEST_FUNC(6, <=, >) + + +int main () +{ + /* TEST_FUNC(1, <=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != T_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != T_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != T_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != T_VAL) + __builtin_abort (); + if (test_4 (5, 20) != T_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != T_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != T_VAL) + __builtin_abort (); + if (test_6 (5, 15) != T_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-l-le.c b/gcc/testsuite/gcc.dg/ccmp-l-le.c new file mode 100644 index 0000000..3ef2e3f --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-l-le.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (long a, long b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <=, ==) +TEST_FUNC(2, <=, !=) +TEST_FUNC(3, <=, <=) +TEST_FUNC(4, <=, <) +TEST_FUNC(5, <=, >=) +TEST_FUNC(6, <=, >) + + +int main () +{ + /* TEST_FUNC(1, <=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-l-lt-1.c b/gcc/testsuite/gcc.dg/ccmp-l-lt-1.c new file mode 100644 index 0000000..918eaaf --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-l-lt-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (long a, long b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <, ==) +TEST_FUNC(2, <, !=) +TEST_FUNC(3, <, <=) +TEST_FUNC(4, <, <) +TEST_FUNC(5, <, >=) +TEST_FUNC(6, <, >) + + +int main () +{ + /* TEST_FUNC(1, <, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != T_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != T_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != T_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != T_VAL) + __builtin_abort (); + if (test_4 (5, 20) != T_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != T_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 30) != T_VAL) + __builtin_abort (); + if (test_6 (5, 15) != T_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-l-lt.c b/gcc/testsuite/gcc.dg/ccmp-l-lt.c new file mode 100644 index 0000000..de2560c --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-l-lt.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (long a, long b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <, ==) +TEST_FUNC(2, <, !=) +TEST_FUNC(3, <, <=) +TEST_FUNC(4, <, <) +TEST_FUNC(5, <, >=) +TEST_FUNC(6, <, >) + + +int main () +{ + /* TEST_FUNC(1, <, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-l-ne-1.c b/gcc/testsuite/gcc.dg/ccmp-l-ne-1.c new file mode 100644 index 0000000..6ec09ed --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-l-ne-1.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (long a, long b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, !=, ==) +TEST_FUNC(2, !=, !=) +TEST_FUNC(3, !=, <=) +TEST_FUNC(4, !=, <) +TEST_FUNC(5, !=, >=) +TEST_FUNC(6, !=, >) + + +int main () +{ + /* TEST_FUNC(1, !=, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, !=, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, !=, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, !=, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, !=, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, !=, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-l-ne.c b/gcc/testsuite/gcc.dg/ccmp-l-ne.c new file mode 100644 index 0000000..03d0cfe --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-l-ne.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (long a, long b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, !=, ==) +TEST_FUNC(2, !=, !=) +TEST_FUNC(3, !=, <=) +TEST_FUNC(4, !=, <) +TEST_FUNC(5, !=, >=) +TEST_FUNC(6, !=, >) + + +int main () +{ + /* TEST_FUNC(1, !=, ==) */ + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, !=, !=) */ + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, !=, <=) */ + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, !=, <) */ + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, !=, >=) */ + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, !=, >) */ + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-s-eq-1.c b/gcc/testsuite/gcc.dg/ccmp-s-eq-1.c new file mode 100644 index 0000000..d323d0e --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-s-eq-1.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (short a, short b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, ==, ==) +TEST_FUNC(2, ==, !=) +TEST_FUNC(3, ==, <=) +TEST_FUNC(4, ==, <) +TEST_FUNC(5, ==, >=) +TEST_FUNC(6, ==, >) + + +int main () +{ + /* TEST_FUNC(1, ==, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, ==, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, ==, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, ==, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, ==, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, ==, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-s-eq.c b/gcc/testsuite/gcc.dg/ccmp-s-eq.c new file mode 100644 index 0000000..0452823 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-s-eq.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (short a, short b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, ==, ==) +TEST_FUNC(2, ==, !=) +TEST_FUNC(3, ==, <=) +TEST_FUNC(4, ==, <) +TEST_FUNC(5, ==, >=) +TEST_FUNC(6, ==, >) + + +int main () +{ + /* TEST_FUNC(1, ==, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, ==, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, ==, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, ==, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, ==, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, ==, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-s-ge-1.c b/gcc/testsuite/gcc.dg/ccmp-s-ge-1.c new file mode 100644 index 0000000..93b1c90 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-s-ge-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (short a, short b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >=, ==) +TEST_FUNC(2, >=, !=) +TEST_FUNC(3, >=, <=) +TEST_FUNC(4, >=, <) +TEST_FUNC(5, >=, >=) +TEST_FUNC(6, >=, >) + + +int main () +{ + /* TEST_FUNC(1, >=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-s-ge.c b/gcc/testsuite/gcc.dg/ccmp-s-ge.c new file mode 100644 index 0000000..f8125f5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-s-ge.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (short a, short b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >=, ==) +TEST_FUNC(2, >=, !=) +TEST_FUNC(3, >=, <=) +TEST_FUNC(4, >=, <) +TEST_FUNC(5, >=, >=) +TEST_FUNC(6, >=, >) + + +int main () +{ + /* TEST_FUNC(1, >=, ==) */ + if (test_1 (5, 20) != F_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >=, !=) */ + if (test_2 (5, 30) != F_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >=, <=) */ + if (test_3 (5, 15) != F_VAL) + __builtin_abort (); + if (test_3 (5, 20) != F_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >=, <) */ + if (test_4 (5, 15) != F_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >=, >=) */ + if (test_5 (5, 20) != F_VAL) + __builtin_abort (); + if (test_5 (5, 25) != F_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >=, >) */ + if (test_6 (5, 25) != F_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-s-gt-1.c b/gcc/testsuite/gcc.dg/ccmp-s-gt-1.c new file mode 100644 index 0000000..c1c01c7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-s-gt-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (short a, short b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >, ==) +TEST_FUNC(2, >, !=) +TEST_FUNC(3, >, <=) +TEST_FUNC(4, >, <) +TEST_FUNC(5, >, >=) +TEST_FUNC(6, >, >) + + +int main () +{ + /* TEST_FUNC(1, >, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-s-gt.c b/gcc/testsuite/gcc.dg/ccmp-s-gt.c new file mode 100644 index 0000000..84276e7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-s-gt.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (short a, short b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >, ==) +TEST_FUNC(2, >, !=) +TEST_FUNC(3, >, <=) +TEST_FUNC(4, >, <) +TEST_FUNC(5, >, >=) +TEST_FUNC(6, >, >) + + +int main () +{ + /* TEST_FUNC(1, >, ==) */ + if (test_1 (5, 20) != F_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >, !=) */ + if (test_2 (5, 30) != F_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >, <=) */ + if (test_3 (5, 15) != F_VAL) + __builtin_abort (); + if (test_3 (5, 20) != F_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >, <) */ + if (test_4 (5, 15) != F_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >, >=) */ + if (test_5 (5, 20) != F_VAL) + __builtin_abort (); + if (test_5 (5, 25) != F_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >, >) */ + if (test_6 (5, 25) != F_VAL) + __builtin_abort (); + if (test_6 (5, 30) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-s-le-1.c b/gcc/testsuite/gcc.dg/ccmp-s-le-1.c new file mode 100644 index 0000000..202025f --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-s-le-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (short a, short b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <=, ==) +TEST_FUNC(2, <=, !=) +TEST_FUNC(3, <=, <=) +TEST_FUNC(4, <=, <) +TEST_FUNC(5, <=, >=) +TEST_FUNC(6, <=, >) + + +int main () +{ + /* TEST_FUNC(1, <=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != T_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != T_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != T_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != T_VAL) + __builtin_abort (); + if (test_4 (5, 20) != T_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != T_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != T_VAL) + __builtin_abort (); + if (test_6 (5, 15) != T_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-s-le.c b/gcc/testsuite/gcc.dg/ccmp-s-le.c new file mode 100644 index 0000000..0f4704b --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-s-le.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (short a, short b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <=, ==) +TEST_FUNC(2, <=, !=) +TEST_FUNC(3, <=, <=) +TEST_FUNC(4, <=, <) +TEST_FUNC(5, <=, >=) +TEST_FUNC(6, <=, >) + + +int main () +{ + /* TEST_FUNC(1, <=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-s-lt-1.c b/gcc/testsuite/gcc.dg/ccmp-s-lt-1.c new file mode 100644 index 0000000..daa2657 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-s-lt-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (short a, short b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <, ==) +TEST_FUNC(2, <, !=) +TEST_FUNC(3, <, <=) +TEST_FUNC(4, <, <) +TEST_FUNC(5, <, >=) +TEST_FUNC(6, <, >) + + +int main () +{ + /* TEST_FUNC(1, <, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != T_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != T_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != T_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != T_VAL) + __builtin_abort (); + if (test_4 (5, 20) != T_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != T_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 30) != T_VAL) + __builtin_abort (); + if (test_6 (5, 15) != T_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-s-lt.c b/gcc/testsuite/gcc.dg/ccmp-s-lt.c new file mode 100644 index 0000000..52ba455 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-s-lt.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (short a, short b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <, ==) +TEST_FUNC(2, <, !=) +TEST_FUNC(3, <, <=) +TEST_FUNC(4, <, <) +TEST_FUNC(5, <, >=) +TEST_FUNC(6, <, >) + + +int main () +{ + /* TEST_FUNC(1, <, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-s-ne-1.c b/gcc/testsuite/gcc.dg/ccmp-s-ne-1.c new file mode 100644 index 0000000..a14d641 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-s-ne-1.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (short a, short b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, !=, ==) +TEST_FUNC(2, !=, !=) +TEST_FUNC(3, !=, <=) +TEST_FUNC(4, !=, <) +TEST_FUNC(5, !=, >=) +TEST_FUNC(6, !=, >) + + +int main () +{ + /* TEST_FUNC(1, !=, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, !=, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, !=, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, !=, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, !=, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, !=, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-s-ne.c b/gcc/testsuite/gcc.dg/ccmp-s-ne.c new file mode 100644 index 0000000..271b26d --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-s-ne.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (short a, short b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, !=, ==) +TEST_FUNC(2, !=, !=) +TEST_FUNC(3, !=, <=) +TEST_FUNC(4, !=, <) +TEST_FUNC(5, !=, >=) +TEST_FUNC(6, !=, >) + + +int main () +{ + /* TEST_FUNC(1, !=, ==) */ + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, !=, !=) */ + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, !=, <=) */ + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, !=, <) */ + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, !=, >=) */ + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, !=, >) */ + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-us-eq-1.c b/gcc/testsuite/gcc.dg/ccmp-us-eq-1.c new file mode 100644 index 0000000..eeeff6b --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-us-eq-1.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned short a, unsigned short b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, ==, ==) +TEST_FUNC(2, ==, !=) +TEST_FUNC(3, ==, <=) +TEST_FUNC(4, ==, <) +TEST_FUNC(5, ==, >=) +TEST_FUNC(6, ==, >) + + +int main () +{ + /* TEST_FUNC(1, ==, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, ==, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, ==, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, ==, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, ==, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, ==, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-us-eq.c b/gcc/testsuite/gcc.dg/ccmp-us-eq.c new file mode 100644 index 0000000..92a59df --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-us-eq.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned short a, unsigned short b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, ==, ==) +TEST_FUNC(2, ==, !=) +TEST_FUNC(3, ==, <=) +TEST_FUNC(4, ==, <) +TEST_FUNC(5, ==, >=) +TEST_FUNC(6, ==, >) + + +int main () +{ + /* TEST_FUNC(1, ==, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, ==, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, ==, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, ==, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, ==, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, ==, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-us-ge-1.c b/gcc/testsuite/gcc.dg/ccmp-us-ge-1.c new file mode 100644 index 0000000..e258619 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-us-ge-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned short a, unsigned short b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >=, ==) +TEST_FUNC(2, >=, !=) +TEST_FUNC(3, >=, <=) +TEST_FUNC(4, >=, <) +TEST_FUNC(5, >=, >=) +TEST_FUNC(6, >=, >) + + +int main () +{ + /* TEST_FUNC(1, >=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-us-ge.c b/gcc/testsuite/gcc.dg/ccmp-us-ge.c new file mode 100644 index 0000000..dcdfe91 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-us-ge.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned short a, unsigned short b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >=, ==) +TEST_FUNC(2, >=, !=) +TEST_FUNC(3, >=, <=) +TEST_FUNC(4, >=, <) +TEST_FUNC(5, >=, >=) +TEST_FUNC(6, >=, >) + + +int main () +{ + /* TEST_FUNC(1, >=, ==) */ + if (test_1 (5, 20) != F_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >=, !=) */ + if (test_2 (5, 30) != F_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >=, <=) */ + if (test_3 (5, 15) != F_VAL) + __builtin_abort (); + if (test_3 (5, 20) != F_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >=, <) */ + if (test_4 (5, 15) != F_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >=, >=) */ + if (test_5 (5, 20) != F_VAL) + __builtin_abort (); + if (test_5 (5, 25) != F_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >=, >) */ + if (test_6 (5, 25) != F_VAL) + __builtin_abort (); + if (test_6 (5, 30) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-us-gt-1.c b/gcc/testsuite/gcc.dg/ccmp-us-gt-1.c new file mode 100644 index 0000000..b4f650b --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-us-gt-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned short a, unsigned short b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >, ==) +TEST_FUNC(2, >, !=) +TEST_FUNC(3, >, <=) +TEST_FUNC(4, >, <) +TEST_FUNC(5, >, >=) +TEST_FUNC(6, >, >) + + +int main () +{ + /* TEST_FUNC(1, >, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-us-gt.c b/gcc/testsuite/gcc.dg/ccmp-us-gt.c new file mode 100644 index 0000000..18ba64a --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-us-gt.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned short a, unsigned short b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >, ==) +TEST_FUNC(2, >, !=) +TEST_FUNC(3, >, <=) +TEST_FUNC(4, >, <) +TEST_FUNC(5, >, >=) +TEST_FUNC(6, >, >) + + +int main () +{ + /* TEST_FUNC(1, >, ==) */ + if (test_1 (5, 20) != F_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >, !=) */ + if (test_2 (5, 30) != F_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >, <=) */ + if (test_3 (5, 15) != F_VAL) + __builtin_abort (); + if (test_3 (5, 20) != F_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >, <) */ + if (test_4 (5, 15) != F_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >, >=) */ + if (test_5 (5, 20) != F_VAL) + __builtin_abort (); + if (test_5 (5, 25) != F_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >, >) */ + if (test_6 (5, 25) != F_VAL) + __builtin_abort (); + if (test_6 (5, 30) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-us-le-1.c b/gcc/testsuite/gcc.dg/ccmp-us-le-1.c new file mode 100644 index 0000000..fa8b773 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-us-le-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned short a, unsigned short b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <=, ==) +TEST_FUNC(2, <=, !=) +TEST_FUNC(3, <=, <=) +TEST_FUNC(4, <=, <) +TEST_FUNC(5, <=, >=) +TEST_FUNC(6, <=, >) + + +int main () +{ + /* TEST_FUNC(1, <=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != T_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != T_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != T_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != T_VAL) + __builtin_abort (); + if (test_4 (5, 20) != T_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != T_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != T_VAL) + __builtin_abort (); + if (test_6 (5, 15) != T_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-us-le.c b/gcc/testsuite/gcc.dg/ccmp-us-le.c new file mode 100644 index 0000000..0c03f39 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-us-le.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned short a, unsigned short b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <=, ==) +TEST_FUNC(2, <=, !=) +TEST_FUNC(3, <=, <=) +TEST_FUNC(4, <=, <) +TEST_FUNC(5, <=, >=) +TEST_FUNC(6, <=, >) + + +int main () +{ + /* TEST_FUNC(1, <=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-us-lt-1.c b/gcc/testsuite/gcc.dg/ccmp-us-lt-1.c new file mode 100644 index 0000000..10ddb5e --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-us-lt-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned short a, unsigned short b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <, ==) +TEST_FUNC(2, <, !=) +TEST_FUNC(3, <, <=) +TEST_FUNC(4, <, <) +TEST_FUNC(5, <, >=) +TEST_FUNC(6, <, >) + + +int main () +{ + /* TEST_FUNC(1, <, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != T_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != T_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != T_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != T_VAL) + __builtin_abort (); + if (test_4 (5, 20) != T_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != T_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 30) != T_VAL) + __builtin_abort (); + if (test_6 (5, 15) != T_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-us-lt.c b/gcc/testsuite/gcc.dg/ccmp-us-lt.c new file mode 100644 index 0000000..4ef6b27 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-us-lt.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned short a, unsigned short b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <, ==) +TEST_FUNC(2, <, !=) +TEST_FUNC(3, <, <=) +TEST_FUNC(4, <, <) +TEST_FUNC(5, <, >=) +TEST_FUNC(6, <, >) + + +int main () +{ + /* TEST_FUNC(1, <, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-us-ne-1.c b/gcc/testsuite/gcc.dg/ccmp-us-ne-1.c new file mode 100644 index 0000000..ff0c795 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-us-ne-1.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned short a, unsigned short b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, !=, ==) +TEST_FUNC(2, !=, !=) +TEST_FUNC(3, !=, <=) +TEST_FUNC(4, !=, <) +TEST_FUNC(5, !=, >=) +TEST_FUNC(6, !=, >) + + +int main () +{ + /* TEST_FUNC(1, !=, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, !=, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, !=, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, !=, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, !=, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, !=, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-us-ne.c b/gcc/testsuite/gcc.dg/ccmp-us-ne.c new file mode 100644 index 0000000..72c6429 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-us-ne.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned short a, unsigned short b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, !=, ==) +TEST_FUNC(2, !=, !=) +TEST_FUNC(3, !=, <=) +TEST_FUNC(4, !=, <) +TEST_FUNC(5, !=, >=) +TEST_FUNC(6, !=, >) + + +int main () +{ + /* TEST_FUNC(1, !=, ==) */ + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, !=, !=) */ + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, !=, <=) */ + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, !=, <) */ + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, !=, >=) */ + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, !=, >) */ + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-uw-eq-1.c b/gcc/testsuite/gcc.dg/ccmp-uw-eq-1.c new file mode 100644 index 0000000..dd7aaa3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-uw-eq-1.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned a, unsigned b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, ==, ==) +TEST_FUNC(2, ==, !=) +TEST_FUNC(3, ==, <=) +TEST_FUNC(4, ==, <) +TEST_FUNC(5, ==, >=) +TEST_FUNC(6, ==, >) + + +int main () +{ + /* TEST_FUNC(1, ==, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, ==, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, ==, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, ==, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, ==, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, ==, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-uw-eq.c b/gcc/testsuite/gcc.dg/ccmp-uw-eq.c new file mode 100644 index 0000000..649aafc --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-uw-eq.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned a, unsigned b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, ==, ==) +TEST_FUNC(2, ==, !=) +TEST_FUNC(3, ==, <=) +TEST_FUNC(4, ==, <) +TEST_FUNC(5, ==, >=) +TEST_FUNC(6, ==, >) + + +int main () +{ + /* TEST_FUNC(1, ==, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, ==, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, ==, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, ==, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, ==, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, ==, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-uw-ge-1.c b/gcc/testsuite/gcc.dg/ccmp-uw-ge-1.c new file mode 100644 index 0000000..fb1da5b --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-uw-ge-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned a, unsigned b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >=, ==) +TEST_FUNC(2, >=, !=) +TEST_FUNC(3, >=, <=) +TEST_FUNC(4, >=, <) +TEST_FUNC(5, >=, >=) +TEST_FUNC(6, >=, >) + + +int main () +{ + /* TEST_FUNC(1, >=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-uw-ge.c b/gcc/testsuite/gcc.dg/ccmp-uw-ge.c new file mode 100644 index 0000000..f68fe66 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-uw-ge.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned a, unsigned b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >=, ==) +TEST_FUNC(2, >=, !=) +TEST_FUNC(3, >=, <=) +TEST_FUNC(4, >=, <) +TEST_FUNC(5, >=, >=) +TEST_FUNC(6, >=, >) + + +int main () +{ + /* TEST_FUNC(1, >=, ==) */ + if (test_1 (5, 20) != F_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >=, !=) */ + if (test_2 (5, 30) != F_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >=, <=) */ + if (test_3 (5, 15) != F_VAL) + __builtin_abort (); + if (test_3 (5, 20) != F_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >=, <) */ + if (test_4 (5, 15) != F_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >=, >=) */ + if (test_5 (5, 20) != F_VAL) + __builtin_abort (); + if (test_5 (5, 25) != F_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >=, >) */ + if (test_6 (5, 25) != F_VAL) + __builtin_abort (); + if (test_6 (5, 30) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-uw-gt-1.c b/gcc/testsuite/gcc.dg/ccmp-uw-gt-1.c new file mode 100644 index 0000000..ea66e69 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-uw-gt-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned a, unsigned b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >, ==) +TEST_FUNC(2, >, !=) +TEST_FUNC(3, >, <=) +TEST_FUNC(4, >, <) +TEST_FUNC(5, >, >=) +TEST_FUNC(6, >, >) + + +int main () +{ + /* TEST_FUNC(1, >, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-uw-gt.c b/gcc/testsuite/gcc.dg/ccmp-uw-gt.c new file mode 100644 index 0000000..c205219 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-uw-gt.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned a, unsigned b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >, ==) +TEST_FUNC(2, >, !=) +TEST_FUNC(3, >, <=) +TEST_FUNC(4, >, <) +TEST_FUNC(5, >, >=) +TEST_FUNC(6, >, >) + + +int main () +{ + /* TEST_FUNC(1, >, ==) */ + if (test_1 (5, 20) != F_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >, !=) */ + if (test_2 (5, 30) != F_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >, <=) */ + if (test_3 (5, 15) != F_VAL) + __builtin_abort (); + if (test_3 (5, 20) != F_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >, <) */ + if (test_4 (5, 15) != F_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >, >=) */ + if (test_5 (5, 20) != F_VAL) + __builtin_abort (); + if (test_5 (5, 25) != F_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >, >) */ + if (test_6 (5, 25) != F_VAL) + __builtin_abort (); + if (test_6 (5, 30) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-uw-le-1.c b/gcc/testsuite/gcc.dg/ccmp-uw-le-1.c new file mode 100644 index 0000000..6a64881 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-uw-le-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned a, unsigned b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <=, ==) +TEST_FUNC(2, <=, !=) +TEST_FUNC(3, <=, <=) +TEST_FUNC(4, <=, <) +TEST_FUNC(5, <=, >=) +TEST_FUNC(6, <=, >) + + +int main () +{ + /* TEST_FUNC(1, <=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != T_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != T_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != T_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != T_VAL) + __builtin_abort (); + if (test_4 (5, 20) != T_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != T_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != T_VAL) + __builtin_abort (); + if (test_6 (5, 15) != T_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-uw-le.c b/gcc/testsuite/gcc.dg/ccmp-uw-le.c new file mode 100644 index 0000000..244b604 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-uw-le.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned a, unsigned b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <=, ==) +TEST_FUNC(2, <=, !=) +TEST_FUNC(3, <=, <=) +TEST_FUNC(4, <=, <) +TEST_FUNC(5, <=, >=) +TEST_FUNC(6, <=, >) + + +int main () +{ + /* TEST_FUNC(1, <=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-uw-lt-1.c b/gcc/testsuite/gcc.dg/ccmp-uw-lt-1.c new file mode 100644 index 0000000..dcaa633 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-uw-lt-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned a, unsigned b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <, ==) +TEST_FUNC(2, <, !=) +TEST_FUNC(3, <, <=) +TEST_FUNC(4, <, <) +TEST_FUNC(5, <, >=) +TEST_FUNC(6, <, >) + + +int main () +{ + /* TEST_FUNC(1, <, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != T_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != T_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != T_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != T_VAL) + __builtin_abort (); + if (test_4 (5, 20) != T_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != T_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 30) != T_VAL) + __builtin_abort (); + if (test_6 (5, 15) != T_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-uw-lt.c b/gcc/testsuite/gcc.dg/ccmp-uw-lt.c new file mode 100644 index 0000000..4daf4d2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-uw-lt.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned a, unsigned b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <, ==) +TEST_FUNC(2, <, !=) +TEST_FUNC(3, <, <=) +TEST_FUNC(4, <, <) +TEST_FUNC(5, <, >=) +TEST_FUNC(6, <, >) + + +int main () +{ + /* TEST_FUNC(1, <, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-uw-ne-1.c b/gcc/testsuite/gcc.dg/ccmp-uw-ne-1.c new file mode 100644 index 0000000..9d9bf55 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-uw-ne-1.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned a, unsigned b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, !=, ==) +TEST_FUNC(2, !=, !=) +TEST_FUNC(3, !=, <=) +TEST_FUNC(4, !=, <) +TEST_FUNC(5, !=, >=) +TEST_FUNC(6, !=, >) + + +int main () +{ + /* TEST_FUNC(1, !=, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, !=, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, !=, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, !=, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, !=, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, !=, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-uw-ne.c b/gcc/testsuite/gcc.dg/ccmp-uw-ne.c new file mode 100644 index 0000000..ca82292 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-uw-ne.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (unsigned a, unsigned b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, !=, ==) +TEST_FUNC(2, !=, !=) +TEST_FUNC(3, !=, <=) +TEST_FUNC(4, !=, <) +TEST_FUNC(5, !=, >=) +TEST_FUNC(6, !=, >) + + +int main () +{ + /* TEST_FUNC(1, !=, ==) */ + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, !=, !=) */ + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, !=, <=) */ + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, !=, <) */ + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, !=, >=) */ + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, !=, >) */ + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-w-eq-1.c b/gcc/testsuite/gcc.dg/ccmp-w-eq-1.c new file mode 100644 index 0000000..7463c3a --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-w-eq-1.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (int a, int b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, ==, ==) +TEST_FUNC(2, ==, !=) +TEST_FUNC(3, ==, <=) +TEST_FUNC(4, ==, <) +TEST_FUNC(5, ==, >=) +TEST_FUNC(6, ==, >) + + +int main () +{ + /* TEST_FUNC(1, ==, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, ==, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, ==, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, ==, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, ==, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, ==, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-w-eq.c b/gcc/testsuite/gcc.dg/ccmp-w-eq.c new file mode 100644 index 0000000..7bf39fc --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-w-eq.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (int a, int b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, ==, ==) +TEST_FUNC(2, ==, !=) +TEST_FUNC(3, ==, <=) +TEST_FUNC(4, ==, <) +TEST_FUNC(5, ==, >=) +TEST_FUNC(6, ==, >) + + +int main () +{ + /* TEST_FUNC(1, ==, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, ==, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, ==, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, ==, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, ==, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, ==, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-w-ge-1.c b/gcc/testsuite/gcc.dg/ccmp-w-ge-1.c new file mode 100644 index 0000000..e28b8bb --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-w-ge-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (int a, int b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >=, ==) +TEST_FUNC(2, >=, !=) +TEST_FUNC(3, >=, <=) +TEST_FUNC(4, >=, <) +TEST_FUNC(5, >=, >=) +TEST_FUNC(6, >=, >) + + +int main () +{ + /* TEST_FUNC(1, >=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-w-ge.c b/gcc/testsuite/gcc.dg/ccmp-w-ge.c new file mode 100644 index 0000000..a11b18b --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-w-ge.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (int a, int b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >=, ==) +TEST_FUNC(2, >=, !=) +TEST_FUNC(3, >=, <=) +TEST_FUNC(4, >=, <) +TEST_FUNC(5, >=, >=) +TEST_FUNC(6, >=, >) + + +int main () +{ + /* TEST_FUNC(1, >=, ==) */ + if (test_1 (5, 20) != F_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >=, !=) */ + if (test_2 (5, 30) != F_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >=, <=) */ + if (test_3 (5, 15) != F_VAL) + __builtin_abort (); + if (test_3 (5, 20) != F_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >=, <) */ + if (test_4 (5, 15) != F_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >=, >=) */ + if (test_5 (5, 20) != F_VAL) + __builtin_abort (); + if (test_5 (5, 25) != F_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >=, >) */ + if (test_6 (5, 25) != F_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-w-gt-1.c b/gcc/testsuite/gcc.dg/ccmp-w-gt-1.c new file mode 100644 index 0000000..ef88fcf --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-w-gt-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (int a, int b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >, ==) +TEST_FUNC(2, >, !=) +TEST_FUNC(3, >, <=) +TEST_FUNC(4, >, <) +TEST_FUNC(5, >, >=) +TEST_FUNC(6, >, >) + + +int main () +{ + /* TEST_FUNC(1, >, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-w-gt.c b/gcc/testsuite/gcc.dg/ccmp-w-gt.c new file mode 100644 index 0000000..56480d1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-w-gt.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (int a, int b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, >, ==) +TEST_FUNC(2, >, !=) +TEST_FUNC(3, >, <=) +TEST_FUNC(4, >, <) +TEST_FUNC(5, >, >=) +TEST_FUNC(6, >, >) + + +int main () +{ + /* TEST_FUNC(1, >, ==) */ + if (test_1 (5, 20) != F_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, >, !=) */ + if (test_2 (5, 30) != F_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, >, <=) */ + if (test_3 (5, 15) != F_VAL) + __builtin_abort (); + if (test_3 (5, 20) != F_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, >, <) */ + if (test_4 (5, 15) != F_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, >, >=) */ + if (test_5 (5, 20) != F_VAL) + __builtin_abort (); + if (test_5 (5, 25) != F_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, >, >) */ + if (test_6 (5, 25) != F_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-w-le-1.c b/gcc/testsuite/gcc.dg/ccmp-w-le-1.c new file mode 100644 index 0000000..415cc92 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-w-le-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (int a, int b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <=, ==) +TEST_FUNC(2, <=, !=) +TEST_FUNC(3, <=, <=) +TEST_FUNC(4, <=, <) +TEST_FUNC(5, <=, >=) +TEST_FUNC(6, <=, >) + + +int main () +{ + /* TEST_FUNC(1, <=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != T_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != T_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != T_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != T_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != T_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != T_VAL) + __builtin_abort (); + if (test_4 (5, 20) != T_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != T_VAL) + __builtin_abort (); + if (test_4 (10, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != T_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != T_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != T_VAL) + __builtin_abort (); + if (test_6 (5, 15) != T_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != T_VAL) + __builtin_abort (); + if (test_6 (10, 15) != T_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-w-le.c b/gcc/testsuite/gcc.dg/ccmp-w-le.c new file mode 100644 index 0000000..f8d60d2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-w-le.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (int a, int b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <=, ==) +TEST_FUNC(2, <=, !=) +TEST_FUNC(3, <=, <=) +TEST_FUNC(4, <=, <) +TEST_FUNC(5, <=, >=) +TEST_FUNC(6, <=, >) + + +int main () +{ + /* TEST_FUNC(1, <=, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <=, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <=, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <=, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <=, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <=, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-w-lt-1.c b/gcc/testsuite/gcc.dg/ccmp-w-lt-1.c new file mode 100644 index 0000000..843d8ca --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-w-lt-1.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (int a, int b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <, ==) +TEST_FUNC(2, <, !=) +TEST_FUNC(3, <, <=) +TEST_FUNC(4, <, <) +TEST_FUNC(5, <, >=) +TEST_FUNC(6, <, >) + + +int main () +{ + /* TEST_FUNC(1, <, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != T_VAL) + __builtin_abort (); + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != T_VAL) + __builtin_abort (); + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != T_VAL) + __builtin_abort (); + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != T_VAL) + __builtin_abort (); + if (test_4 (5, 20) != T_VAL) + __builtin_abort (); + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != T_VAL) + __builtin_abort (); + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 30) != T_VAL) + __builtin_abort (); + if (test_6 (5, 15) != T_VAL) + __builtin_abort (); + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-w-lt.c b/gcc/testsuite/gcc.dg/ccmp-w-lt.c new file mode 100644 index 0000000..2059001 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-w-lt.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (int a, int b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, <, ==) +TEST_FUNC(2, <, !=) +TEST_FUNC(3, <, <=) +TEST_FUNC(4, <, <) +TEST_FUNC(5, <, >=) +TEST_FUNC(6, <, >) + + +int main () +{ + /* TEST_FUNC(1, <, ==) */ + if (test_1 (5, 20) != T_VAL) + __builtin_abort (); + if (test_1 (5, 30) != F_VAL) + __builtin_abort (); + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != F_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, <, !=) */ + if (test_2 (5, 30) != T_VAL) + __builtin_abort (); + if (test_2 (5, 20) != F_VAL) + __builtin_abort (); + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, <, <=) */ + if (test_3 (5, 15) != T_VAL) + __builtin_abort (); + if (test_3 (5, 20) != T_VAL) + __builtin_abort (); + if (test_3 (5, 30) != F_VAL) + __builtin_abort (); + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != F_VAL) + __builtin_abort (); + if (test_3 (20, 20) != F_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, <, <) */ + if (test_4 (5, 15) != T_VAL) + __builtin_abort (); + if (test_4 (5, 30) != F_VAL) + __builtin_abort (); + if (test_4 (5, 20) != F_VAL) + __builtin_abort (); + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != F_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, <, >=) */ + if (test_5 (5, 20) != T_VAL) + __builtin_abort (); + if (test_5 (5, 25) != T_VAL) + __builtin_abort (); + if (test_5 (5, 15) != F_VAL) + __builtin_abort (); + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != F_VAL) + __builtin_abort (); + if (test_5 (20, 25) != F_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, <, >) */ + if (test_6 (5, 25) != T_VAL) + __builtin_abort (); + if (test_6 (5, 20) != F_VAL) + __builtin_abort (); + if (test_6 (5, 15) != F_VAL) + __builtin_abort (); + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != F_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-w-ne-1.c b/gcc/testsuite/gcc.dg/ccmp-w-ne-1.c new file mode 100644 index 0000000..9918946 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-w-ne-1.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (int a, int b) \ +{ \ + if (a OP1 10 || b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, !=, ==) +TEST_FUNC(2, !=, !=) +TEST_FUNC(3, !=, <=) +TEST_FUNC(4, !=, <) +TEST_FUNC(5, !=, >=) +TEST_FUNC(6, !=, >) + + +int main () +{ + /* TEST_FUNC(1, !=, ==) */ + if (test_1 (10, 20) != T_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, !=, !=) */ + if (test_2 (10, 30) != T_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != T_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, !=, <=) */ + if (test_3 (10, 15) != T_VAL) + __builtin_abort (); + if (test_3 (10, 20) != T_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, !=, <) */ + if (test_4 (10, 15) != T_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != T_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, !=, >=) */ + if (test_5 (10, 20) != T_VAL) + __builtin_abort (); + if (test_5 (10, 25) != T_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, !=, >) */ + if (test_6 (10, 25) != T_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != T_VAL) + __builtin_abort (); + if (test_6 (20, 15) != T_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ccmp-w-ne.c b/gcc/testsuite/gcc.dg/ccmp-w-ne.c new file mode 100644 index 0000000..7ab5dd1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ccmp-w-ne.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-inline" } */ +#define T_VAL 8 +#define F_VAL 16 + +#define TEST_FUNC(i, OP1, OP2) \ +int test_##i (int a, int b) \ +{ \ + if (a OP1 10 && b OP2 20) \ + return T_VAL; \ + else \ + return F_VAL; \ +} + +TEST_FUNC(1, !=, ==) +TEST_FUNC(2, !=, !=) +TEST_FUNC(3, !=, <=) +TEST_FUNC(4, !=, <) +TEST_FUNC(5, !=, >=) +TEST_FUNC(6, !=, >) + + +int main () +{ + /* TEST_FUNC(1, !=, ==) */ + if (test_1 (10, 20) != F_VAL) + __builtin_abort (); + if (test_1 (10, 30) != F_VAL) + __builtin_abort (); + if (test_1 (20, 20) != T_VAL) + __builtin_abort (); + if (test_1 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(2, !=, !=) */ + if (test_2 (10, 30) != F_VAL) + __builtin_abort (); + if (test_2 (10, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 20) != F_VAL) + __builtin_abort (); + if (test_2 (20, 30) != T_VAL) + __builtin_abort (); + + /* TEST_FUNC(3, !=, <=) */ + if (test_3 (10, 15) != F_VAL) + __builtin_abort (); + if (test_3 (10, 20) != F_VAL) + __builtin_abort (); + if (test_3 (10, 30) != F_VAL) + __builtin_abort (); + if (test_3 (20, 15) != T_VAL) + __builtin_abort (); + if (test_3 (20, 20) != T_VAL) + __builtin_abort (); + if (test_3 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(4, !=, <) */ + if (test_4 (10, 15) != F_VAL) + __builtin_abort (); + if (test_4 (10, 30) != F_VAL) + __builtin_abort (); + if (test_4 (10, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 20) != F_VAL) + __builtin_abort (); + if (test_4 (20, 15) != T_VAL) + __builtin_abort (); + if (test_4 (20, 30) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(5, !=, >=) */ + if (test_5 (10, 20) != F_VAL) + __builtin_abort (); + if (test_5 (10, 25) != F_VAL) + __builtin_abort (); + if (test_5 (10, 15) != F_VAL) + __builtin_abort (); + if (test_5 (20, 20) != T_VAL) + __builtin_abort (); + if (test_5 (20, 25) != T_VAL) + __builtin_abort (); + if (test_5 (20, 15) != F_VAL) + __builtin_abort (); + + /* TEST_FUNC(6, !=, >) */ + if (test_6 (10, 25) != F_VAL) + __builtin_abort (); + if (test_6 (10, 20) != F_VAL) + __builtin_abort (); + if (test_6 (10, 15) != F_VAL) + __builtin_abort (); + if (test_6 (20, 25) != T_VAL) + __builtin_abort (); + if (test_6 (20, 20) != F_VAL) + __builtin_abort (); + if (test_6 (20, 15) != F_VAL) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/ccmn-assember.c b/gcc/testsuite/gcc.target/aarch64/ccmn-assember.c new file mode 100644 index 0000000..304b1ce --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/ccmn-assember.c @@ -0,0 +1,84 @@ +/* { dg-do compile } */ +/* { dg-options " -O2 " } */ + +char foo_c (char a, signed char b) +{ + if (a > 9 && b > -20) + return 4; + else + return 26; +} + +char foo_c_1 (char a, signed char b, char c) +{ + if (a > c && b == -20) + return 4; + else + return 26; +} + +unsigned short foo_us (unsigned short a, short b) +{ + if (a > 9 && b < -20) + return 4; + else + return 26; +} + +unsigned short foo_us_1 (unsigned short a, short b, unsigned short c) +{ + if (a > c && b == -20) + return 4; + else + return 26; +} + +int foo_w (int a, int b) +{ + if (a > 9 && b < -20) + return 4; + else + return 26; +} + +int foo_w_1 (int a, int b, int c) +{ + if (a > c && b == -20) + return 4; + else + return 26; +} + +unsigned foo_uw (unsigned a, int b) +{ + if (a > 9 && b < -20) + return 4; + else + return 26; +} + +unsigned foo_uw_1 (unsigned a, int b, unsigned c) +{ + if (a > c && b == -20) + return 4; + else + return 26; +} + +long foo_l (long a, long b) +{ + if (a > 9 && b < -20) + return 4; + else + return 26; +} + +long foo_l_1 (long a, long b, long c) +{ + if (a > c && b == -20) + return 4; + else + return 26; +} + +/* { dg-final { scan-assembler-times "ccmn" 11 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/ccmp-assember.c b/gcc/testsuite/gcc.target/aarch64/ccmp-assember.c new file mode 100644 index 0000000..98dd281 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/ccmp-assember.c @@ -0,0 +1,124 @@ +/* { dg-do compile } */ +/* { dg-options " -O2 " } */ + +char foo_c (char a, char b) +{ + if (a > 9 && b < 20) + return 4; + else + return 26; +} + +char foo_c_1 (char a, char b, char c) +{ + if (a > c && b == 20) + return 4; + else + return 26; +} + +char foo_c_2 (char a, char b, char c) +{ + if (a < 9 && b > c) + return 4; + else + return 26; +} + +unsigned short foo_us (unsigned short a, unsigned short b) +{ + if (a > 9 && b < 20) + return 4; + else + return 26; +} + +unsigned short foo_us_1 (unsigned short a, unsigned short b, unsigned short c) +{ + if (a > c && b == 20) + return 4; + else + return 26; +} + +unsigned short foo_us_2 (unsigned short a, unsigned short b, unsigned short c) +{ + if (a < 9 && b > c) + return 4; + else + return 26; +} + +int foo_w (int a, int b) +{ + if (a > 9 && b < 20) + return 4; + else + return 26; +} + +int foo_w_1 (int a, int b, int c) +{ + if (a > c && b == 20) + return 4; + else + return 26; +} + +int foo_w_2 (int a, int b, int c) +{ + if (a < 9 && b > c) + return 4; + else + return 26; +} + +unsigned foo_uw (unsigned a, unsigned b) +{ + if (a > 9 && b < 20) + return 4; + else + return 26; +} + +unsigned foo_uw_1 (unsigned a, unsigned b, unsigned c) +{ + if (a > c && b == 20) + return 4; + else + return 26; +} + +unsigned foo_uw_2 (unsigned a, unsigned b, unsigned c) +{ + if (a < 9 && b > c) + return 4; + else + return 26; +} + +long foo_l (long a, long b) +{ + if (a > 9 && b < 20) + return 4; + else + return 26; +} + +long foo_l_1 (long a, long b, long c) +{ + if (a > c && b == 20) + return 4; + else + return 26; +} + +long foo_l_2 (long a, long b, long c) +{ + if (a < 9 && b > c) + return 4; + else + return 26; +} + +/* { dg-final { scan-assembler-times "ccmp" 16 } } */