From nobody Thu Nov 28 02:55:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1726056982; cv=none; d=zohomail.com; s=zohoarc; b=lL0qwXTEvtHdcPjhYEuWFQRpqVU5iwaDvvt6fvSF3h5zvC9fHlV4wW8dLjpAMDXQb9qmQ172BDm1WxRQBpKs3DXgZ+JWgnpshFMvqPygH+xpeTIZZ4W8AoQcuCy3mg8/D35wWoNVMXiK/MCVXf7TGCfbCXbyZx7dFLZcbehtxfo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726056982; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eN7NySazNLSdpdsZ4Pza+unVS9nZj8RBDaL7uHZqkL8=; b=ATpAoG0q2w3l0RDK58VHINTiPnaAf/KpjbKJ9YzV+b8fV2FZiQj3wLITB125pyLGp+8spx64yKrpIlJ69QuPWbR/BTRqLmowxZ0YvHFl6q8z5n2dXY6HgoqZOPP4mz7jJEiBk4gIER7GZ+0eW7th85O5bF7nNA4xNVhf9ED/TP8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1726056982591612.416799604709; Wed, 11 Sep 2024 05:16:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soMGD-0007wb-3c; Wed, 11 Sep 2024 08:15:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1soMFl-0006QE-Gq for qemu-devel@nongnu.org; Wed, 11 Sep 2024 08:15:22 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1soMFf-0007Ng-RI for qemu-devel@nongnu.org; Wed, 11 Sep 2024 08:15:20 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a8d13b83511so573518566b.2 for ; Wed, 11 Sep 2024 05:15:15 -0700 (PDT) Received: from m1x-phil.lan ([176.187.196.107]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d258339a2sm615760566b.19.2024.09.11.05.15.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 05:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726056914; x=1726661714; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eN7NySazNLSdpdsZ4Pza+unVS9nZj8RBDaL7uHZqkL8=; b=opI/xnGhKf/lHLjeWZa6OmfdHwldw3GG9pdnw6E+FsU4BdcrqZdVdXjf0xpGrAMkLk OILNy+t31uV7JF0wjsVTdj6aBd08rEntyz//biVbDHqmOi0IINyweVtQE7D0iXzgUb5o 6zwom/Vg26aC/yqWdCI3hR5vRn5NwkovtOeqcHySXfYGJXps6UzRGuMlxyivpU5F+qPL S/vu2pQtHFyo/HTIqoXLbUYACrSR8SVUnE9i8GCYfnfxYwbLaO6FjGgt1urZcOkNs4ow WdJilLGnOI+dpGc9Yik/yicvnQ7cjTwGEoH5ZbJzO+zkKBLD4AhffgW348gScvEB6k5D amDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726056914; x=1726661714; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eN7NySazNLSdpdsZ4Pza+unVS9nZj8RBDaL7uHZqkL8=; b=I3R5fwoC0IzpX4BSAxBHF7FApidcVKhmOXjG6YjJ7+b50BCHOvrXU8D9GLpG+JDigP /OleeegkQ7yuRTZcEUQLXzuEsubdliUbeDXl4plxncOSeM2RPGF6p89DaLEYuHJ8h3GV S00p1+ke9ejOjZZ+PAne5JY5e56wVL4qWktC+CNnlpIWPKBcNJtYpWnOFXAucZAYyJ8m sC0awYa/sr8KeNLo0K7m8QdvysFX/di6ASiUudQnIOKDrwTjlwvft2sWlY7/SKF0f++l dd+h25J0EonAsfrdKRqkMe4nnPc2VgSpZh4car1X1vxhL2tI8nGIOWhn2lxMNyxt+Z/6 C5pQ== X-Gm-Message-State: AOJu0YxsqRcK1GpF07wdc78gqKMocRIoHrtuGxI8w0770GDA4bwIysGX azRrFiBuub7Qjt9rIzKDzG3o77z5NIE7Ua2ZIQZIIfegzQxk11pNR58k2WQzjFro+7K3l2ucJDF L X-Google-Smtp-Source: AGHT+IFMjgJ6wRh+19m++A6U0U81D8ae7s48/+AZAjJOdDEL6F/hnofIIOJJ+/Od1UbfA37XJO+pjQ== X-Received: by 2002:a17:907:9483:b0:a8d:4db5:529 with SMTP id a640c23a62f3a-a8ffadc8cacmr408266866b.48.1726056912980; Wed, 11 Sep 2024 05:15:12 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Richard Henderson , "Edgar E . Iglesias" Subject: [PULL 07/56] tests/tcg: Remove CRIS libc test files Date: Wed, 11 Sep 2024 14:13:32 +0200 Message-ID: <20240911121422.52585-8-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240911121422.52585-1-philmd@linaro.org> References: <20240911121422.52585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=philmd@linaro.org; helo=mail-ej1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1726056983680116600 We never compiled / ran these tests. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Acked-by: Edgar E. Iglesias Message-ID: <20240904143603.52934-2-philmd@linaro.org> --- tests/tcg/cris/libc/crisutils.h | 76 ---------- tests/tcg/cris/libc/sys.h | 18 --- tests/tcg/cris/libc/check_abs.c | 40 ----- tests/tcg/cris/libc/check_addc.c | 58 ------- tests/tcg/cris/libc/check_addcm.c | 85 ----------- tests/tcg/cris/libc/check_addo.c | 125 --------------- tests/tcg/cris/libc/check_addoq.c | 44 ------ tests/tcg/cris/libc/check_bound.c | 142 ------------------ tests/tcg/cris/libc/check_ftag.c | 37 ----- .../cris/libc/check_gcctorture_pr28634-1.c | 15 -- .../tcg/cris/libc/check_gcctorture_pr28634.c | 15 -- .../tcg/cris/libc/check_glibc_kernelversion.c | 116 -------------- tests/tcg/cris/libc/check_hello.c | 7 - tests/tcg/cris/libc/check_int64.c | 47 ------ tests/tcg/cris/libc/check_lz.c | 49 ------ tests/tcg/cris/libc/check_mapbrk.c | 39 ----- tests/tcg/cris/libc/check_mmap1.c | 48 ------ tests/tcg/cris/libc/check_mmap2.c | 48 ------ tests/tcg/cris/libc/check_mmap3.c | 33 ---- tests/tcg/cris/libc/check_moveq.c | 51 ------- tests/tcg/cris/libc/check_openpf1.c | 38 ----- tests/tcg/cris/libc/check_openpf2.c | 16 -- tests/tcg/cris/libc/check_openpf3.c | 49 ------ tests/tcg/cris/libc/check_openpf5.c | 56 ------- tests/tcg/cris/libc/check_settls1.c | 45 ------ tests/tcg/cris/libc/check_sigalrm.c | 26 ---- tests/tcg/cris/libc/check_stat1.c | 16 -- tests/tcg/cris/libc/check_stat2.c | 20 --- tests/tcg/cris/libc/check_stat3.c | 25 --- tests/tcg/cris/libc/check_stat4.c | 27 ---- tests/tcg/cris/libc/check_swap.c | 76 ---------- tests/tcg/cris/libc/check_time2.c | 18 --- 32 files changed, 1505 deletions(-) delete mode 100644 tests/tcg/cris/libc/crisutils.h delete mode 100644 tests/tcg/cris/libc/sys.h delete mode 100644 tests/tcg/cris/libc/check_abs.c delete mode 100644 tests/tcg/cris/libc/check_addc.c delete mode 100644 tests/tcg/cris/libc/check_addcm.c delete mode 100644 tests/tcg/cris/libc/check_addo.c delete mode 100644 tests/tcg/cris/libc/check_addoq.c delete mode 100644 tests/tcg/cris/libc/check_bound.c delete mode 100644 tests/tcg/cris/libc/check_ftag.c delete mode 100644 tests/tcg/cris/libc/check_gcctorture_pr28634-1.c delete mode 100644 tests/tcg/cris/libc/check_gcctorture_pr28634.c delete mode 100644 tests/tcg/cris/libc/check_glibc_kernelversion.c delete mode 100644 tests/tcg/cris/libc/check_hello.c delete mode 100644 tests/tcg/cris/libc/check_int64.c delete mode 100644 tests/tcg/cris/libc/check_lz.c delete mode 100644 tests/tcg/cris/libc/check_mapbrk.c delete mode 100644 tests/tcg/cris/libc/check_mmap1.c delete mode 100644 tests/tcg/cris/libc/check_mmap2.c delete mode 100644 tests/tcg/cris/libc/check_mmap3.c delete mode 100644 tests/tcg/cris/libc/check_moveq.c delete mode 100644 tests/tcg/cris/libc/check_openpf1.c delete mode 100644 tests/tcg/cris/libc/check_openpf2.c delete mode 100644 tests/tcg/cris/libc/check_openpf3.c delete mode 100644 tests/tcg/cris/libc/check_openpf5.c delete mode 100644 tests/tcg/cris/libc/check_settls1.c delete mode 100644 tests/tcg/cris/libc/check_sigalrm.c delete mode 100644 tests/tcg/cris/libc/check_stat1.c delete mode 100644 tests/tcg/cris/libc/check_stat2.c delete mode 100644 tests/tcg/cris/libc/check_stat3.c delete mode 100644 tests/tcg/cris/libc/check_stat4.c delete mode 100644 tests/tcg/cris/libc/check_swap.c delete mode 100644 tests/tcg/cris/libc/check_time2.c diff --git a/tests/tcg/cris/libc/crisutils.h b/tests/tcg/cris/libc/crisutil= s.h deleted file mode 100644 index bbbe6c5540..0000000000 --- a/tests/tcg/cris/libc/crisutils.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef CRISUTILS_H -#define CRISUTILS_H 1 - -static char *tst_cc_loc =3D NULL; - -#define cris_tst_cc_init() \ -do { tst_cc_loc =3D "test_cc failed at " CURRENT_LOCATION; } while(0) - -/* We need a real symbol to signal error. */ -void _err(void) { - if (!tst_cc_loc) - tst_cc_loc =3D "tst_cc_failed\n"; - _fail(tst_cc_loc); -} - -static always_inline void cris_tst_cc_n1(void) -{ - asm volatile ("bpl _err\n" - "nop\n"); -} -static always_inline void cris_tst_cc_n0(void) -{ - asm volatile ("bmi _err\n" - "nop\n"); -} - -static always_inline void cris_tst_cc_z1(void) -{ - asm volatile ("bne _err\n" - "nop\n"); -} -static always_inline void cris_tst_cc_z0(void) -{ - asm volatile ("beq _err\n" - "nop\n"); -} -static always_inline void cris_tst_cc_v1(void) -{ - asm volatile ("bvc _err\n" - "nop\n"); -} -static always_inline void cris_tst_cc_v0(void) -{ - asm volatile ("bvs _err\n" - "nop\n"); -} - -static always_inline void cris_tst_cc_c1(void) -{ - asm volatile ("bcc _err\n" - "nop\n"); -} -static always_inline void cris_tst_cc_c0(void) -{ - asm volatile ("bcs _err\n" - "nop\n"); -} - -static always_inline void cris_tst_mov_cc(int n, int z) -{ - if (n) cris_tst_cc_n1(); else cris_tst_cc_n0(); - if (z) cris_tst_cc_z1(); else cris_tst_cc_z0(); - asm volatile ("" : : "g" (_err)); -} - -static always_inline void cris_tst_cc(const int n, const int z, - const int v, const int c) -{ - if (n) cris_tst_cc_n1(); else cris_tst_cc_n0(); - if (z) cris_tst_cc_z1(); else cris_tst_cc_z0(); - if (v) cris_tst_cc_v1(); else cris_tst_cc_v0(); - if (c) cris_tst_cc_c1(); else cris_tst_cc_c0(); - asm volatile ("" : : "g" (_err)); -} - -#endif diff --git a/tests/tcg/cris/libc/sys.h b/tests/tcg/cris/libc/sys.h deleted file mode 100644 index 3dd47bb673..0000000000 --- a/tests/tcg/cris/libc/sys.h +++ /dev/null @@ -1,18 +0,0 @@ -#include - -#define STRINGIFY(x) #x -#define TOSTRING(x) STRINGIFY(x) - -#define always_inline inline __attribute__((always_inline)) - -#define CURRENT_LOCATION __FILE__ ":" TOSTRING(__LINE__) - -#define err() \ -{ \ - _fail("at " CURRENT_LOCATION " "); \ -} - -#define mb() asm volatile ("" : : : "memory") - -void pass(void); -void _fail(char *reason); diff --git a/tests/tcg/cris/libc/check_abs.c b/tests/tcg/cris/libc/check_ab= s.c deleted file mode 100644 index 08b67b6ef0..0000000000 --- a/tests/tcg/cris/libc/check_abs.c +++ /dev/null @@ -1,40 +0,0 @@ -#include -#include -#include -#include "sys.h" -#include "crisutils.h" - -static always_inline int cris_abs(int n) -{ - int r; - asm ("abs\t%1, %0\n" : "=3Dr" (r) : "r" (n)); - return r; -} - -static always_inline void -verify_abs(int val, int res, - const int n, const int z, const int v, const int c) -{ - int r; - - cris_tst_cc_init(); - r =3D cris_abs(val); - cris_tst_cc(n, z, v, c); - if (r !=3D res) - err(); -} - -int main(void) -{ - verify_abs(-1, 1, 0, 0, 0, 0); - verify_abs(0x80000000, 0x80000000, 1, 0, 0, 0); - verify_abs(0x7fffffff, 0x7fffffff, 0, 0, 0, 0); - verify_abs(42, 42, 0, 0, 0, 0); - verify_abs(1, 1, 0, 0, 0, 0); - verify_abs(0xffff, 0xffff, 0, 0, 0, 0); - verify_abs(0xffff, 0xffff, 0, 0, 0, 0); - verify_abs(-31, 0x1f, 0, 0, 0, 0); - verify_abs(0, 0, 0, 1, 0, 0); - pass(); - return 0; -} diff --git a/tests/tcg/cris/libc/check_addc.c b/tests/tcg/cris/libc/check_a= ddc.c deleted file mode 100644 index fc3fb1faa8..0000000000 --- a/tests/tcg/cris/libc/check_addc.c +++ /dev/null @@ -1,58 +0,0 @@ -#include -#include -#include -#include "sys.h" -#include "crisutils.h" - -static always_inline int cris_addc(int a, const int b) -{ - asm ("addc\t%1, %0\n" : "+r" (a) : "r" (b)); - return a; -} - -#define verify_addc(a, b, res, n, z, v, c) \ -{ \ - int r; \ - r =3D cris_addc((a), (b)); \ - cris_tst_cc((n), (z), (v), (c)); \ - if (r !=3D (res)) \ - err(); \ -} - -int main(void) -{ - cris_tst_cc_init(); - asm volatile ("clearf cz"); - verify_addc(0, 0, 0, 0, 0, 0, 0); - - cris_tst_cc_init(); - asm volatile ("setf z"); - verify_addc(0, 0, 0, 0, 1, 0, 0); - - cris_tst_cc_init(); - asm volatile ("setf cz"); - verify_addc(0, 0, 1, 0, 0, 0, 0); - cris_tst_cc_init(); - asm volatile ("clearf c"); - verify_addc(-1, 2, 1, 0, 0, 0, 1); - - cris_tst_cc_init(); - asm volatile ("clearf nzv"); - asm volatile ("setf c"); - verify_addc(-1, 2, 2, 0, 0, 0, 1); - - cris_tst_cc_init(); - asm volatile ("setf c"); - verify_addc(0xffff, 0xffff, 0x1ffff, 0, 0, 0, 0); - - cris_tst_cc_init(); - asm volatile ("clearf nzvc"); - verify_addc(-1, -1, 0xfffffffe, 1, 0, 0, 1); - - cris_tst_cc_init(); - asm volatile ("setf c"); - verify_addc(0x78134452, 0x5432f789, 0xcc463bdc, 1, 0, 1, 0); - - pass(); - return 0; -} diff --git a/tests/tcg/cris/libc/check_addcm.c b/tests/tcg/cris/libc/check_= addcm.c deleted file mode 100644 index b355ba164f..0000000000 --- a/tests/tcg/cris/libc/check_addcm.c +++ /dev/null @@ -1,85 +0,0 @@ -#include -#include -#include -#include "sys.h" -#include "crisutils.h" - -/* need to avoid acr as source here. */ -static always_inline int cris_addc_m(int a, const int *b) -{ - asm volatile ("addc [%1], %0\n" : "+r" (a) : "r" (b)); - return a; -} - -/* 'b' is a crisv32 constrain to avoid postinc with $acr. */ -static always_inline int cris_addc_pi_m(int a, int **b) -{ - asm volatile ("addc [%1+], %0\n" : "+r" (a), "+b" (*b)); - return a; -} - -#define verify_addc_m(a, b, res, n, z, v, c) \ -{ \ - int r; \ - r =3D cris_addc_m((a), (b)); \ - cris_tst_cc((n), (z), (v), (c)); \ - if (r !=3D (res)) \ - err(); \ -} - -#define verify_addc_pi_m(a, b, res, n, z, v, c) \ -{ \ - int r; \ - r =3D cris_addc_pi_m((a), (b)); \ - cris_tst_cc((n), (z), (v), (c)); \ - if (r !=3D (res)) \ - err(); \ -} - -int x[] =3D { 0, 0, 2, -1, 0xffff, -1, 0x5432f789}; - -int main(void) -{ - int *p =3D (void *)&x[0]; -#if 1 - cris_tst_cc_init(); - asm volatile ("clearf cz"); - verify_addc_m(0, p, 0, 0, 0, 0, 0); - - cris_tst_cc_init(); - asm volatile ("setf z"); - verify_addc_m(0, p, 0, 0, 1, 0, 0); - - cris_tst_cc_init(); - asm volatile ("setf c"); - verify_addc_m(0, p, 1, 0, 0, 0, 0); - - cris_tst_cc_init(); - asm volatile ("clearf c"); - verify_addc_pi_m(0, &p, 0, 0, 1, 0, 0); - - p =3D &x[1]; - cris_tst_cc_init(); - asm volatile ("setf c"); - verify_addc_pi_m(0, &p, 1, 0, 0, 0, 0); - - if (p !=3D &x[2]) - err(); - - cris_tst_cc_init(); - asm volatile ("clearf c"); - verify_addc_pi_m(-1, &p, 1, 0, 0, 0, 1); - - if (p !=3D &x[3]) - err(); -#endif - p =3D &x[3]; - /* TODO: investigate why this one fails. */ - cris_tst_cc_init(); - asm volatile ("setf c"); - verify_addc_m(2, p, 2, 0, 0, 0, 1); - p +=3D 4; - - pass(); - return 0; -} diff --git a/tests/tcg/cris/libc/check_addo.c b/tests/tcg/cris/libc/check_a= ddo.c deleted file mode 100644 index 4235e5fc65..0000000000 --- a/tests/tcg/cris/libc/check_addo.c +++ /dev/null @@ -1,125 +0,0 @@ -#include -#include -#include -#include "sys.h" -#include "crisutils.h" - -/* this would be better to do in asm, it's an orgy in GCC inline asm now. = */ - -#define cris_addo_b(o, v) \ - asm volatile ("addo.b\t[%0], %1, $acr\n" : : "r" (o), "r" (v) : "acr"); -#define cris_addo_w(o, v) \ - asm volatile ("addo.w\t[%0], %1, $acr\n" : : "r" (o), "r" (v) : "acr"); -#define cris_addo_d(o, v) \ - asm volatile ("addo.d\t[%0], %1, $acr\n" : : "r" (o), "r" (v) : "acr"); -#define cris_addo_pi_b(o, v) \ - asm volatile ("addo.b\t[%0+], %1, $acr\n" \ - : "+b" (o): "r" (v) : "acr"); -#define cris_addo_pi_w(o, v) \ - asm volatile ("addo.w\t[%0+], %1, $acr\n" \ - : "+b" (o): "r" (v) : "acr"); -#define cris_addo_pi_d(o, v) \ - asm volatile ("addo.d\t[%0+], %1, $acr\n" \ - : "+b" (o): "r" (v) : "acr"); - -struct { - uint32_t v1; - uint16_t v2; - uint32_t v3; - uint8_t v4; - uint8_t v5; - uint16_t v6; - uint32_t v7; -} y =3D { - 32769, - -1, - 5, - 3, -4, - 2, - -76789887 -}; - -static int x[3] =3D {0x55aa77ff, 0xccff2244, 0x88ccee19}; - -int main(void) -{ - int *r; - unsigned char *t, *p; - - /* Note, this test-case will trig an unaligned access, partly - to x[0] and to [x1]. */ - t =3D (unsigned char *)x; - t -=3D 32768; - p =3D (unsigned char *) &y.v1; - mb(); /* don't reorder anything beyond here. */ - cris_tst_cc_init(); - asm volatile ("setf\tzvnc\n"); - cris_addo_pi_d(p, t); - cris_tst_cc(1, 1, 1, 1); - asm volatile ("move.d\t$acr, %0\n" : "=3Dr" (r)); - if (*r !=3D 0x4455aa77) - err(); - - - t +=3D 32770; - mb(); /* don't reorder anything beyond here. */ - cris_tst_cc_init(); - asm volatile ("setf\tzvnc\n"); - cris_addo_pi_w(p, t); - cris_tst_cc(1, 1, 1, 1); - asm volatile ("move.d\t$acr, %0\n" : "=3Dr" (r)); - if (*r !=3D 0x4455aa77) - err(); - - mb(); /* don't reorder anything beyond here. */ - cris_tst_cc_init(); - asm volatile ("setf\tzvnc\n"); - cris_addo_d(p, r); - cris_tst_cc(1, 1, 1, 1); - p +=3D 4; - asm volatile ("move.d\t$acr, %0\n" : "=3Dr" (r)); - if (*r !=3D 0xee19ccff) - err(); - - mb(); /* don't reorder anything beyond here. */ - cris_tst_cc_init(); - asm volatile ("setf\tzvnc\n"); - cris_addo_pi_b(p, t); - cris_tst_cc(0, 0, 0, 0); - asm volatile ("move.d\t$acr, %0\n" : "=3Dr" (r)); - if (*(uint16_t*)r !=3D 0xff22) - err(); - - mb(); /* don't reorder anything beyond here. */ - cris_tst_cc_init(); - asm volatile ("setf\tzvnc\n"); - cris_addo_b(p, r); - cris_tst_cc(1, 1, 1, 1); - p +=3D 1; - asm volatile ("move.d\t$acr, %0\n" : "=3Dr" (r)); - if (*r !=3D 0x4455aa77) - err(); - - mb(); /* don't reorder anything beyond here. */ - cris_tst_cc_init(); - asm volatile ("setf\tzvnc\n"); - cris_addo_w(p, r); - cris_tst_cc(1, 1, 1, 1); - p +=3D 2; - asm volatile ("move.d\t$acr, %0\n" : "=3Dr" (r)); - if (*r !=3D 0xff224455) - err(); - - mb(); /* don't reorder anything beyond here. */ - cris_tst_cc_init(); - asm volatile ("setf\tzvnc\n"); - cris_addo_pi_d(p, t); - cris_tst_cc(0, 0, 0, 0); - asm volatile ("move.d\t$acr, %0\n" : "=3Dr" (r)); - r =3D (void*)(((char *)r) + 76789885); - if (*r !=3D 0x55aa77ff) - err(); - - pass(); - return 0; -} diff --git a/tests/tcg/cris/libc/check_addoq.c b/tests/tcg/cris/libc/check_= addoq.c deleted file mode 100644 index ed509e27e0..0000000000 --- a/tests/tcg/cris/libc/check_addoq.c +++ /dev/null @@ -1,44 +0,0 @@ -#include -#include -#include -#include "sys.h" -#include "crisutils.h" - -/* this would be better to do in asm, it's an orgy in GCC inline asm now. = */ - -/* ACR will be clobbered. */ -#define cris_addoq(o, v) \ - asm volatile ("addoq\t%1, %0, $acr\n" : : "r" (v), "i" (o) : "acr"); - - -int main(void) -{ - int x[3] =3D {0x55aa77ff, 0xccff2244, 0x88ccee19}; - int *p, *t =3D x + 1; - - cris_tst_cc_init(); - asm volatile ("setf\tzvnc\n"); - cris_addoq(0, t); - cris_tst_cc(1, 1, 1, 1); - asm volatile ("move.d\t$acr, %0\n" : "=3Dr" (p)); - if (*p !=3D 0xccff2244) - err(); - - cris_tst_cc_init(); - asm volatile ("setf\tzvnc\n"); - cris_addoq(4, t); - cris_tst_cc(0, 0, 0, 0); - asm volatile ("move.d\t$acr, %0\n" : "=3Dr" (p)); - if (*p !=3D 0x88ccee19) - err(); - - cris_tst_cc_init(); - asm volatile ("clearf\tzvnc\n"); - cris_addoq(-8, t + 1); - cris_tst_cc(0, 0, 0, 0); - asm volatile ("move.d\t$acr, %0\n" : "=3Dr" (p)); - if (*p !=3D 0x55aa77ff) - err(); - pass(); - return 0; -} diff --git a/tests/tcg/cris/libc/check_bound.c b/tests/tcg/cris/libc/check_= bound.c deleted file mode 100644 index d956ab9ade..0000000000 --- a/tests/tcg/cris/libc/check_bound.c +++ /dev/null @@ -1,142 +0,0 @@ -#include -#include -#include -#include "sys.h" -#include "crisutils.h" - -static always_inline int cris_bound_b(int v, int b) -{ - int r =3D v; - asm ("bound.b\t%1, %0\n" : "+r" (r) : "ri" (b)); - return r; -} - -static always_inline int cris_bound_w(int v, int b) -{ - int r =3D v; - asm ("bound.w\t%1, %0\n" : "+r" (r) : "ri" (b)); - return r; -} - -static always_inline int cris_bound_d(int v, int b) -{ - int r =3D v; - asm ("bound.d\t%1, %0\n" : "+r" (r) : "ri" (b)); - return r; -} - -int main(void) -{ - int r; - - cris_tst_cc_init(); - r =3D cris_bound_d(-1, 2); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 2) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_d(2, 0xffffffff); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 2) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_d(0xffff, 0xffff); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 0xffff) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_d(-1, 0xffffffff); - cris_tst_cc(1, 0, 0, 0); - if (r !=3D 0xffffffff) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_d(0x78134452, 0x5432f789); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 0x5432f789) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_w(-1, 2); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 2) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_w(-1, 0xffff); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 0xffff) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_w(2, 0xffff); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 2) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_w(0xfedaffff, 0xffff); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 0xffff) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_w(0x78134452, 0xf789); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 0xf789) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_b(-1, 2); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 2) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_b(2, 0xff); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 2) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_b(-1, 0xff); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 0xff) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_b(0xff, 0xff); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 0xff) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_b(0xfeda49ff, 0xff); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 0xff) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_b(0x78134452, 0x89); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 0x89) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_w(0x78134452, 0); - cris_tst_cc(0, 1, 0, 0); - if (r !=3D 0) - err(); - - cris_tst_cc_init(); - r =3D cris_bound_b(0xffff, -1); - cris_tst_cc(0, 0, 0, 0); - if (r !=3D 0xff) - err(); - - pass(); - return 0; -} diff --git a/tests/tcg/cris/libc/check_ftag.c b/tests/tcg/cris/libc/check_f= tag.c deleted file mode 100644 index aaa5c97115..0000000000 --- a/tests/tcg/cris/libc/check_ftag.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include "sys.h" -#include "crisutils.h" - -static always_inline void cris_ftag_i(unsigned int x) -{ - register unsigned int v asm("$r10") =3D x; - asm ("ftagi\t[%0]\n" : : "r" (v) ); -} -static always_inline void cris_ftag_d(unsigned int x) -{ - register unsigned int v asm("$r10") =3D x; - asm ("ftagd\t[%0]\n" : : "r" (v) ); -} -static always_inline void cris_fidx_i(unsigned int x) -{ - register unsigned int v asm("$r10") =3D x; - asm ("fidxi\t[%0]\n" : : "r" (v) ); -} -static always_inline void cris_fidx_d(unsigned int x) -{ - register unsigned int v asm("$r10") =3D x; - asm ("fidxd\t[%0]\n" : : "r" (v) ); -} - - -int main(void) -{ - cris_ftag_i(0); - cris_ftag_d(0); - cris_fidx_i(0); - cris_fidx_d(0); - pass(); - return 0; -} diff --git a/tests/tcg/cris/libc/check_gcctorture_pr28634-1.c b/tests/tcg/c= ris/libc/check_gcctorture_pr28634-1.c deleted file mode 100644 index 45ecd159b3..0000000000 --- a/tests/tcg/cris/libc/check_gcctorture_pr28634-1.c +++ /dev/null @@ -1,15 +0,0 @@ -/* PR rtl-optimization/28634. On targets with delayed branches, - dbr_schedule could do the next iteration's addition in the - branch delay slot, then subtract the value again if the branch - wasn't taken. This can lead to rounding errors. */ -int x =3D -1; -int y =3D 1; -int -main (void) -{ - while (y > 0) - y +=3D x; - if (y !=3D x + 1) - abort (); - exit (0); -} diff --git a/tests/tcg/cris/libc/check_gcctorture_pr28634.c b/tests/tcg/cri= s/libc/check_gcctorture_pr28634.c deleted file mode 100644 index a0c525497d..0000000000 --- a/tests/tcg/cris/libc/check_gcctorture_pr28634.c +++ /dev/null @@ -1,15 +0,0 @@ -/* PR rtl-optimization/28634. On targets with delayed branches, - dbr_schedule could do the next iteration's addition in the - branch delay slot, then subtract the value again if the branch - wasn't taken. This can lead to rounding errors. */ -double x =3D -0x1.0p53; -double y =3D 1; -int -main (void) -{ - while (y > 0) - y +=3D x; - if (y !=3D x + 1) - abort (); - exit (0); -} diff --git a/tests/tcg/cris/libc/check_glibc_kernelversion.c b/tests/tcg/cr= is/libc/check_glibc_kernelversion.c deleted file mode 100644 index 7aada89911..0000000000 --- a/tests/tcg/cris/libc/check_glibc_kernelversion.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Check the lz insn. - */ - -#include -#include -#include -#include "sys.h" - -#define __LINUX_KERNEL_VERSION 131584 - -#define DL_SYSDEP_OSCHECK(FATAL) \ - do { = \ - /* Test whether the kernel is new enough. This test is only = \ - performed if the library is not compiled to run on all = \ - kernels. */ = \ - if (__LINUX_KERNEL_VERSION > 0) = \ - { = \ - char bufmem[64]; = \ - char *buf =3D bufmem; = \ - unsigned int version; = \ - int parts; = \ - char *cp; = \ - struct utsname uts; = \ - = \ - /* Try the uname syscall */ = \ - if (__uname (&uts)) = \ - { = \ - /* This was not successful. Now try reading the /proc = \ - filesystem. */ = \ - ssize_t reslen; = \ - int fd =3D __open ("/proc/sys/kernel/osrelease", O_RDONLY); = \ - if (fd =3D=3D -1 = \ - || (reslen =3D __read (fd, bufmem, sizeof (bufmem))) <=3D = 0) \ - /* This also didn't work. We give up since we cannot = \ - make sure the library can actually work. */ = \ - FATAL ("FATAL: cannot determine library version\n"); = \ - __close (fd); = \ - buf[MIN (reslen, (ssize_t) sizeof (bufmem) - 1)] =3D '\0'; = \ - } = \ - else = \ - buf =3D uts.release; = \ - = \ - /* Now convert it into a number. The string consists of at most = \ - three parts. */ = \ - version =3D 0; = \ - parts =3D 0; = \ - cp =3D buf; = \ - while ((*cp >=3D '0') && (*cp <=3D '9')) = \ - { = \ - unsigned int here =3D *cp++ - '0'; = \ - = \ - while ((*cp >=3D '0') && (*cp <=3D '9')) = \ - { = \ - here *=3D 10; = \ - here +=3D *cp++ - '0'; = \ - } = \ - = \ - ++parts; = \ - version <<=3D 8; = \ - version |=3D here; = \ - = \ - if (*cp++ !=3D '.') = \ - /* Another part following? */ = \ - break; = \ - } = \ - = \ - if (parts < 3) = \ - version <<=3D 8 * (3 - parts); = \ - = \ - /* Now we can test with the required version. */ = \ - if (version < __LINUX_KERNEL_VERSION) = \ - /* Not sufficient. */ = \ - FATAL ("FATAL: kernel too old\n"); = \ - = \ - _dl_osversion =3D version; = \ - } = \ - } while (0) - -int main(void) -{ - char bufmem[64] =3D "2.6.22"; - char *buf =3D bufmem; - unsigned int version; - int parts; - char *cp; - - version =3D 0; - parts =3D 0; - cp =3D buf; - while ((*cp >=3D '0') && (*cp <=3D '9')) - { - unsigned int here =3D *cp++ - '0'; - - while ((*cp >=3D '0') && (*cp <=3D '9')) - { - here *=3D 10; - here +=3D *cp++ - '0'; - } - - ++parts; - version <<=3D 8; - version |=3D here; - - if (*cp++ !=3D '.') - /* Another part following? */ - break; - } - - if (parts < 3) - version <<=3D 8 * (3 - parts); - if (version < __LINUX_KERNEL_VERSION) - err(); - pass(); - exit(0); -} diff --git a/tests/tcg/cris/libc/check_hello.c b/tests/tcg/cris/libc/check_= hello.c deleted file mode 100644 index fb403ba996..0000000000 --- a/tests/tcg/cris/libc/check_hello.c +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include -int main () -{ - printf ("pass\n"); - exit (0); -} diff --git a/tests/tcg/cris/libc/check_int64.c b/tests/tcg/cris/libc/check_= int64.c deleted file mode 100644 index 69caec1bb2..0000000000 --- a/tests/tcg/cris/libc/check_int64.c +++ /dev/null @@ -1,47 +0,0 @@ -#include -#include -#include -#include "sys.h" -#include "crisutils.h" - - -static always_inline int64_t add64(const int64_t a, const int64_t b) -{ - return a + b; -} - -static always_inline int64_t sub64(const int64_t a, const int64_t b) -{ - return a - b; -} - -int main(void) -{ - int64_t a =3D 1; - int64_t b =3D 2; - - /* FIXME: add some tests. */ - a =3D add64(a, b); - if (a !=3D 3) - err(); - - a =3D sub64(a, b); - if (a !=3D 1) - err(); - - a =3D add64(a, -4); - if (a !=3D -3) - err(); - - a =3D add64(a, 3); - if (a !=3D 0) - err(); - - a =3D 0; - a =3D sub64(a, 1); - if (a !=3D -1) - err(); - - pass(); - return 0; -} diff --git a/tests/tcg/cris/libc/check_lz.c b/tests/tcg/cris/libc/check_lz.c deleted file mode 100644 index bf051a6b55..0000000000 --- a/tests/tcg/cris/libc/check_lz.c +++ /dev/null @@ -1,49 +0,0 @@ -#include -#include -#include -#include "sys.h" - -static always_inline int cris_lz(int x) -{ - int r; - asm ("lz\t%1, %0\n" : "=3Dr" (r) : "r" (x)); - return r; -} - -void check_lz(void) -{ - int i; - - if (cris_lz(0) !=3D 32) - err(); - if (cris_lz(1) !=3D 31) - err(); - if (cris_lz(2) !=3D 30) - err(); - if (cris_lz(4) !=3D 29) - err(); - if (cris_lz(8) !=3D 28) - err(); - - /* try all positions with a single bit. */ - for (i =3D 1; i < 32; i++) { - if (cris_lz(1 << (i-1)) !=3D (32 - i)) - err(); - } - - /* try all positions with all bits. */ - for (i =3D 1; i < 32; i++) { - /* split up this computation to clarify it. */ - uint32_t val; - val =3D (unsigned int)-1 >> (32 - i); - if (cris_lz(val) !=3D (32 - i)) - err(); - } -} - -int main(void) -{ - check_lz(); - pass(); - exit(0); -} diff --git a/tests/tcg/cris/libc/check_mapbrk.c b/tests/tcg/cris/libc/check= _mapbrk.c deleted file mode 100644 index 1aff7622bc..0000000000 --- a/tests/tcg/cris/libc/check_mapbrk.c +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include - -/* Basic sanity check that syscalls to implement malloc (brk, mmap2, - munmap) are trivially functional. */ - -int main () -{ - void *p1, *p2, *p3, *p4, *p5, *p6; - - if ((p1 =3D malloc (8100)) =3D=3D NULL - || (p2 =3D malloc (16300)) =3D=3D NULL - || (p3 =3D malloc (4000)) =3D=3D NULL - || (p4 =3D malloc (500)) =3D=3D NULL - || (p5 =3D malloc (1023*1024)) =3D=3D NULL - || (p6 =3D malloc (8191*1024)) =3D=3D NULL) - { - printf ("fail\n"); - exit (1); - } - - free (p1); - free (p2); - free (p3); - free (p4); - free (p5); - free (p6); - - p1 =3D malloc (64000); - if (p1 =3D=3D NULL) - { - printf ("fail\n"); - exit (1); - } - free (p1); - - printf ("pass\n"); - exit (0); -} diff --git a/tests/tcg/cris/libc/check_mmap1.c b/tests/tcg/cris/libc/check_= mmap1.c deleted file mode 100644 index b803f0c431..0000000000 --- a/tests/tcg/cris/libc/check_mmap1.c +++ /dev/null @@ -1,48 +0,0 @@ -/* -#notarget: cris*-*-elf -*/ - -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include - -int main (int argc, char *argv[]) -{ - int fd =3D open (argv[0], O_RDONLY); - struct stat sb; - int size; - void *a; - const char *str =3D "a string you'll only find in the program"; - - if (fd =3D=3D -1) - { - perror ("open"); - abort (); - } - - if (fstat (fd, &sb) < 0) - { - perror ("fstat"); - abort (); - } - - size =3D sb.st_size; - - /* We want to test mmapping a size that isn't exactly a page. */ - if ((size & 8191) =3D=3D 0) - size--; - - a =3D mmap (NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); - - if (memmem (a, size, str, strlen (str) + 1) =3D=3D NULL) - abort (); - - printf ("pass\n"); - exit (0); -} diff --git a/tests/tcg/cris/libc/check_mmap2.c b/tests/tcg/cris/libc/check_= mmap2.c deleted file mode 100644 index 35139a0ed9..0000000000 --- a/tests/tcg/cris/libc/check_mmap2.c +++ /dev/null @@ -1,48 +0,0 @@ -/* -#notarget: cris*-*-elf -*/ - -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include - -int main (int argc, char *argv[]) -{ - int fd =3D open (argv[0], O_RDONLY); - struct stat sb; - int size; - void *a; - const char *str =3D "a string you'll only find in the program"; - - if (fd =3D=3D -1) - { - perror ("open"); - abort (); - } - - if (fstat (fd, &sb) < 0) - { - perror ("fstat"); - abort (); - } - - size =3D sb.st_size; - - /* We want to test mmapping a size that isn't exactly a page. */ - if ((size & 8191) =3D=3D 0) - size--; - - a =3D mmap (NULL, size, PROT_READ, MAP_SHARED, fd, 0); - - if (memmem (a, size, str, strlen (str) + 1) =3D=3D NULL) - abort (); - - printf ("pass\n"); - exit (0); -} diff --git a/tests/tcg/cris/libc/check_mmap3.c b/tests/tcg/cris/libc/check_= mmap3.c deleted file mode 100644 index cb890ef120..0000000000 --- a/tests/tcg/cris/libc/check_mmap3.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -#notarget: cris*-*-elf -*/ - -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include - -int main (int argc, char *argv[]) -{ - volatile unsigned char *a; - - /* Check that we can map a non-multiple of a page and still get a full p= age. */ - a =3D mmap (NULL, 0x4c, PROT_READ | PROT_WRITE | PROT_EXEC, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - if (a =3D=3D NULL || a =3D=3D (unsigned char *) -1) - abort (); - - a[0] =3D 0xbe; - a[8191] =3D 0xef; - memset ((char *) a + 1, 0, 8190); - - if (a[0] !=3D 0xbe || a[8191] !=3D 0xef) - abort (); - - printf ("pass\n"); - exit (0); -} diff --git a/tests/tcg/cris/libc/check_moveq.c b/tests/tcg/cris/libc/check_= moveq.c deleted file mode 100644 index 80f2dff6ab..0000000000 --- a/tests/tcg/cris/libc/check_moveq.c +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include -#include -#include "sys.h" -#include "crisutils.h" - -#define cris_moveq(dst, src) \ - asm volatile ("moveq %1, %0\n" : "=3Dr" (dst) : "i" (src)); - - - -int main(void) -{ - int t; - - cris_tst_cc_init(); - asm volatile ("setf\tzvnc\n"); - cris_moveq(t, 10); - cris_tst_cc(1, 1, 1, 1); - if (t !=3D 10) - err(); - - /* make sure moveq doesn't clobber the zflag. */ - cris_tst_cc_init(); - asm volatile ("setf vnc\n"); - asm volatile ("clearf z\n"); - cris_moveq(t, 0); - cris_tst_cc(1, 0, 1, 1); - if (t !=3D 0) - err(); - - /* make sure moveq doesn't clobber the nflag. - Also check large immediates */ - cris_tst_cc_init(); - asm volatile ("setf zvc\n"); - asm volatile ("clearf n\n"); - cris_moveq(t, -31); - cris_tst_cc(0, 1, 1, 1); - if (t !=3D -31) - err(); - - cris_tst_cc_init(); - asm volatile ("setf nzvc\n"); - cris_moveq(t, 31); - cris_tst_cc(1, 1, 1, 1); - if (t !=3D 31) - err(); - - pass(); - return 0; -} diff --git a/tests/tcg/cris/libc/check_openpf1.c b/tests/tcg/cris/libc/chec= k_openpf1.c deleted file mode 100644 index 251d26eec2..0000000000 --- a/tests/tcg/cris/libc/check_openpf1.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Check that --sysroot is applied to open(2). -#sim: --sysroot=3D@exedir@ - - We assume, with EXE being the name of the executable: - - The simulator executes with cwd the same directory where the executab= le - is located (so argv[0] contains a plain filename without directory - components). - - There's no /EXE on the host file system. */ - -#include -#include -#include -#include -int main (int argc, char *argv[]) -{ - char *fnam =3D argv[0]; - FILE *f; - if (argv[0][0] !=3D '/') - { - fnam =3D malloc (strlen (argv[0]) + 2); - if (fnam =3D=3D NULL) - abort (); - strcpy (fnam, "/"); - strcat (fnam, argv[0]); - } - - f =3D fopen (fnam, "rb"); - if (f =3D=3D NULL) - abort (); - fclose(f); - - /* Cover another execution path. */ - if (fopen ("/nonexistent", "rb") !=3D NULL - || errno !=3D ENOENT) - abort (); - printf ("pass\n"); - return 0; -} diff --git a/tests/tcg/cris/libc/check_openpf2.c b/tests/tcg/cris/libc/chec= k_openpf2.c deleted file mode 100644 index 5d56189f8e..0000000000 --- a/tests/tcg/cris/libc/check_openpf2.c +++ /dev/null @@ -1,16 +0,0 @@ -/* Check that the simulator has chdir:ed to the --sysroot argument -#sim: --sysroot=3D@srcdir@ - (or that --sysroot is applied to relative file paths). */ - -#include -#include -#include -int main (int argc, char *argv[]) -{ - FILE *f =3D fopen ("check_openpf2.c", "rb"); - if (f =3D=3D NULL) - abort (); - fclose(f); - printf ("pass\n"); - return 0; -} diff --git a/tests/tcg/cris/libc/check_openpf3.c b/tests/tcg/cris/libc/chec= k_openpf3.c deleted file mode 100644 index 557adee92d..0000000000 --- a/tests/tcg/cris/libc/check_openpf3.c +++ /dev/null @@ -1,49 +0,0 @@ -/* Basic file operations (rename, unlink); once without sysroot. We - also test that the simulator has chdir:ed to PREFIX, when defined. */ - -#include -#include -#include -#include -#include -#include - -#ifndef PREFIX -#define PREFIX -#endif - -void err (const char *s) -{ - perror (s); - abort (); -} - -int main (int argc, char *argv[]) -{ - FILE *f; - struct stat buf; - - unlink (PREFIX "testfoo2.tmp"); - - f =3D fopen ("testfoo1.tmp", "w"); - if (f =3D=3D NULL) - err ("open"); - fclose (f); - - if (rename (PREFIX "testfoo1.tmp", PREFIX "testfoo2.tmp") !=3D 0) - err ("rename"); - - if (stat (PREFIX "testfoo2.tmp", &buf) !=3D 0 - || !S_ISREG (buf.st_mode)) - err ("stat 1"); - - if (stat ("testfoo2.tmp", &buf) !=3D 0 - || !S_ISREG (buf.st_mode)) - err ("stat 2"); - - if (unlink (PREFIX "testfoo2.tmp") !=3D 0) - err ("unlink"); - - printf ("pass\n"); - return 0; -} diff --git a/tests/tcg/cris/libc/check_openpf5.c b/tests/tcg/cris/libc/chec= k_openpf5.c deleted file mode 100644 index 1f86ea283d..0000000000 --- a/tests/tcg/cris/libc/check_openpf5.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Check that TRT happens when error on too many opened files. -#notarget: cris*-*-elf -#sim: --sysroot=3D@exedir@ -*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int main (int argc, char *argv[]) -{ - int i; - int filemax; - -#ifdef OPEN_MAX - filemax =3D OPEN_MAX; -#else - filemax =3D sysconf (_SC_OPEN_MAX); -#endif - - char *fn =3D malloc (strlen (argv[0]) + 2); - if (fn =3D=3D NULL) - abort (); - strcpy (fn, "/"); - strcat (fn, argv[0]); - - for (i =3D 0; i < filemax + 1; i++) - { - if (open (fn, O_RDONLY) < 0) - { - /* Shouldn't happen too early. */ - if (i < filemax - 3 - 1) - { - fprintf (stderr, "i: %d\n", i); - abort (); - } - if (errno !=3D EMFILE) - { - perror ("open"); - abort (); - } - goto ok; - } - } - abort (); - -ok: - printf ("pass\n"); - exit (0); -} diff --git a/tests/tcg/cris/libc/check_settls1.c b/tests/tcg/cris/libc/chec= k_settls1.c deleted file mode 100644 index 3abc3a9ea8..0000000000 --- a/tests/tcg/cris/libc/check_settls1.c +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include -#include -#include - -#include - -#ifndef SYS_set_thread_area -#define SYS_set_thread_area 243 -#endif - -int main (void) -{ - unsigned long tp, old_tp; - int ret; - - asm volatile ("move $pid,%0" : "=3Dr" (old_tp)); - old_tp &=3D ~0xff; - - ret =3D syscall (SYS_set_thread_area, 0xf0); - if (ret !=3D -1 || errno !=3D EINVAL) { - syscall (SYS_set_thread_area, old_tp); - perror ("Invalid thread area accepted:"); - abort(); - } - - ret =3D syscall (SYS_set_thread_area, 0xeddeed00); - if (ret !=3D 0) { - perror ("Valid thread area not accepted: "); - abort (); - } - - asm volatile ("move $pid,%0" : "=3Dr" (tp)); - tp &=3D ~0xff; - syscall (SYS_set_thread_area, old_tp); - - if (tp !=3D 0xeddeed00) { - * (volatile int *) 0 =3D 0; - perror ("tls2"); - abort (); - } - - printf ("pass\n"); - return EXIT_SUCCESS; -} diff --git a/tests/tcg/cris/libc/check_sigalrm.c b/tests/tcg/cris/libc/chec= k_sigalrm.c deleted file mode 100644 index 39fa8d9bac..0000000000 --- a/tests/tcg/cris/libc/check_sigalrm.c +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include -#include -#include - -#define MAGIC (0xdeadbeef) - -int s =3D 0; -void sighandler(int sig) -{ - s =3D MAGIC; -} - -int main(int argc, char **argv) -{ - int p; - - p =3D getpid(); - signal(SIGALRM, sighandler); - kill(p, SIGALRM); - if (s !=3D MAGIC) - return EXIT_FAILURE; - - printf ("passed\n"); - return EXIT_SUCCESS; -} diff --git a/tests/tcg/cris/libc/check_stat1.c b/tests/tcg/cris/libc/check_= stat1.c deleted file mode 100644 index 2e2cae51df..0000000000 --- a/tests/tcg/cris/libc/check_stat1.c +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include -#include -#include -#include - -int main (void) -{ - struct stat buf; - - if (stat (".", &buf) !=3D 0 - || !S_ISDIR (buf.st_mode)) - abort (); - printf ("pass\n"); - exit (0); -} diff --git a/tests/tcg/cris/libc/check_stat2.c b/tests/tcg/cris/libc/check_= stat2.c deleted file mode 100644 index e36172ed25..0000000000 --- a/tests/tcg/cris/libc/check_stat2.c +++ /dev/null @@ -1,20 +0,0 @@ -/* -#notarget: cris*-*-elf -*/ - -#include -#include -#include -#include -#include - -int main (void) -{ - struct stat buf; - - if (lstat (".", &buf) !=3D 0 - || !S_ISDIR (buf.st_mode)) - abort (); - printf ("pass\n"); - exit (0); -} diff --git a/tests/tcg/cris/libc/check_stat3.c b/tests/tcg/cris/libc/check_= stat3.c deleted file mode 100644 index 36a9d5d274..0000000000 --- a/tests/tcg/cris/libc/check_stat3.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Simulator options: -#sim: --sysroot=3D@exedir@ -*/ -#include -#include -#include -#include -#include -#include - -int main (int argc, char *argv[]) -{ - char path[1024] =3D "/"; - struct stat buf; - - strncat(path, argv[0], sizeof(path) - 2); - if (stat (".", &buf) !=3D 0 - || !S_ISDIR (buf.st_mode)) - abort (); - if (stat (path, &buf) !=3D 0 - || !S_ISREG (buf.st_mode)) - abort (); - printf ("pass\n"); - exit (0); -} diff --git a/tests/tcg/cris/libc/check_stat4.c b/tests/tcg/cris/libc/check_= stat4.c deleted file mode 100644 index 04f21fe7c4..0000000000 --- a/tests/tcg/cris/libc/check_stat4.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Simulator options: -#notarget: cris*-*-elf -#sim: --sysroot=3D@exedir@ -*/ - -#include -#include -#include -#include -#include -#include - -int main (int argc, char *argv[]) -{ - char path[1024] =3D "/"; - struct stat buf; - - strncat(path, argv[0], sizeof(path) - 2); - if (lstat (".", &buf) !=3D 0 - || !S_ISDIR (buf.st_mode)) - abort (); - if (lstat (path, &buf) !=3D 0 - || !S_ISREG (buf.st_mode)) - abort (); - printf ("pass\n"); - exit (0); -} diff --git a/tests/tcg/cris/libc/check_swap.c b/tests/tcg/cris/libc/check_s= wap.c deleted file mode 100644 index 9a68c1e5d7..0000000000 --- a/tests/tcg/cris/libc/check_swap.c +++ /dev/null @@ -1,76 +0,0 @@ -#include -#include -#include -#include "sys.h" -#include "crisutils.h" - -#define N 8 -#define W 4 -#define B 2 -#define R 1 - -static always_inline int cris_swap(const int mode, int x) -{ - switch (mode) - { - case N: asm ("swapn\t%0\n" : "+r" (x) : "0" (x)); break; - case W: asm ("swapw\t%0\n" : "+r" (x) : "0" (x)); break; - case B: asm ("swapb\t%0\n" : "+r" (x) : "0" (x)); break; - case R: asm ("swapr\t%0\n" : "+r" (x) : "0" (x)); break; - case B|R: asm ("swapbr\t%0\n" : "+r" (x) : "0" (x)); break; - case W|R: asm ("swapwr\t%0\n" : "+r" (x) : "0" (x)); break; - case W|B: asm ("swapwb\t%0\n" : "+r" (x) : "0" (x)); break; - case W|B|R: asm ("swapwbr\t%0\n" : "+r" (x) : "0" (x)); break; - case N|R: asm ("swapnr\t%0\n" : "+r" (x) : "0" (x)); break; - case N|B: asm ("swapnb\t%0\n" : "+r" (x) : "0" (x)); break; - case N|B|R: asm ("swapnbr\t%0\n" : "+r" (x) : "0" (x)); break; - case N|W: asm ("swapnw\t%0\n" : "+r" (x) : "0" (x)); break; - default: - err(); - break; - } - return x; -} - -/* Made this a macro to be able to pick up the location of the errors. */ -#define verify_swap(mode, val, expected, n, z) \ -do { \ - int r; \ - cris_tst_cc_init(); \ - r =3D cris_swap(mode, val); \ - cris_tst_mov_cc(n, z); \ - if (r !=3D expected) \ - err(); \ -} while(0) - -void check_swap(void) -{ - /* Some of these numbers are borrowed from GDB's cris sim - testsuite. */ - if (cris_swap(N, 0) !=3D 0xffffffff) - err(); - if (cris_swap(W, 0x12345678) !=3D 0x56781234) - err(); - if (cris_swap(B, 0x12345678) !=3D 0x34127856) - err(); - - verify_swap(R, 0x78134452, 0x1ec8224a, 0, 0); - verify_swap(B, 0x78134452, 0x13785244, 0, 0); - verify_swap(B|R, 0x78134452, 0xc81e4a22, 1, 0); - verify_swap(W, 0x78134452, 0x44527813, 0, 0); - verify_swap(W|R, 0x78134452, 0x224a1ec8, 0, 0); - verify_swap(W|B|R, 0x78134452, 0x4a22c81e, 0, 0); - verify_swap(N, 0x78134452, 0x87ecbbad, 1, 0); - verify_swap(N|R, 0x78134452, 0xe137ddb5, 1, 0); - verify_swap(N|B, 0x78134452, 0xec87adbb, 1, 0); - verify_swap(N|B|R, 0x78134452, 0x37e1b5dd, 0, 0); - verify_swap(N|W, 0x78134452, 0xbbad87ec, 1, 0); - verify_swap(N|B|R, 0xffffffff, 0, 0, 1); -} - -int main(void) -{ - check_swap(); - pass(); - return 0; -} diff --git a/tests/tcg/cris/libc/check_time2.c b/tests/tcg/cris/libc/check_= time2.c deleted file mode 100644 index 20b69b4f60..0000000000 --- a/tests/tcg/cris/libc/check_time2.c +++ /dev/null @@ -1,18 +0,0 @@ -/* CB_SYS_time doesn't implement the Linux time syscall; the return - value isn't written to the argument. */ - -#include -#include -#include - -int -main (void) -{ - time_t x =3D (time_t) -1; - time_t t =3D time (&x); - - if (t =3D=3D (time_t) -1 || t !=3D x) - abort (); - printf ("pass\n"); - exit (0); -} --=20 2.45.2