From patchwork Sat Dec 17 16:41:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaius Mulley X-Patchwork-Id: 34214 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1591027wrn; Sat, 17 Dec 2022 08:42:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf5fSZ7qhAeldvgMtOREFqDltXxRckvU/EYqY+bk7LHiCX5G8IJQgSPEjYxSPIgmxzQD2nRb X-Received: by 2002:aa7:d5ce:0:b0:46b:aedf:f32b with SMTP id d14-20020aa7d5ce000000b0046baedff32bmr48130413eds.4.1671295330671; Sat, 17 Dec 2022 08:42:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671295330; cv=none; d=google.com; s=arc-20160816; b=dEwlphUGtnpILoIJi/FofhRYTmugx1pLZ/XbsiUFuhS2KNW/0wjvrH5Bo+HlTPxku+ T5jZ302E13BKjIyzXxUJocZPKaLPxg35svufDZs5JA81tfMwKxtfn2MaoUsNsQ4TOi1E m3EdLt2v6xe025uCCGhKFH5f32n0I+MtCy4AwiFYYhOGtm/aeJpLU2X76zwafmuh8blb ts6ebQ34AjOEC/UPQp4W0hBZw6s3PGOB76auAj3e/uMjmyJqxVSoIC6B2iNlV3PHzp4Z zcYtCvwffOk+aWK7gdnpCpNVKCMJ4Q1H+eDfRwV4zkGOpMus+Ezodq8BoQ3hHEJkxt6W GfzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:message-id:date:subject:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=E9g6DcAOcBWy/fSefOEwNZBHsV9BPGThbW8foN1p8pE=; b=tJcMMLwiODgIKq5WfXH/Ipq/Mzctq+M2xzaibbuRTQ4a2EjXI0HGeQRjzEgz35wiy2 GEtX5bkVrHKHqu4UzITuMkf58m3mV/zDw/4h6TWEmSxYlxNHJuekPJ//7XSMFM0oiApj sBk5LSdWxyFOL4csIn7YBbTw/Rmo/4W35LdLnnboH9FSxwALJTJeRJbcj1UHfcIBVTEi xfs+safdfws0kNtTC19UsiwRFnR2RxkiCwUj9pFsxkdLKyA0SsxBA5GMe/TXiAlVhnMG SAd5KozoEsVr3oLbKWasJVeDMnKAIIs1rSBL33+9DiuELWS4AR6nJgP2n7XmA+6AOZuE u9Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uzWaRGqF; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id o17-20020aa7d3d1000000b004616acd9cbcsi4513542edr.360.2022.12.17.08.42.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Dec 2022 08:42:10 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uzWaRGqF; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9095D3AA9010 for ; Sat, 17 Dec 2022 16:42:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9095D3AA9010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671295329; bh=E9g6DcAOcBWy/fSefOEwNZBHsV9BPGThbW8foN1p8pE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=uzWaRGqFvOIBvgZQXygbwXlwaWNH+4VmF0v+Ivzl/aWsbmpD1JCHQxd8+6z6ZnuG4 WqrDaWF4g7/oiNufFuyOXFw4Q5r6oD7rIzZToV5l3yIYdVWEHz9VaXhrdNaAGwrXrM 4vFZTNF5YnkAzU6quIWHAxw+8xDrBFmIPDxIlSM0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 24D3C3AA9008 for ; Sat, 17 Dec 2022 16:41:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 24D3C3AA9008 Received: by mail-wr1-x42e.google.com with SMTP id h10so5177505wrx.3 for ; Sat, 17 Dec 2022 08:41:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=E9g6DcAOcBWy/fSefOEwNZBHsV9BPGThbW8foN1p8pE=; b=xzUCqlSjFgbpzMJ2G2g/7ILzNpOmEA8rFcZiGkQfT43/JvaFbL53zeXw7utdkTlxCb kHBWHIk1lDXEVQK6WXSCaSiLEiNJ0ZpYuyFXFxAgvAsE15RUzZHlg7vpfLTNVpt98Tzg w+T/xxGdsCseAEfkYGZ9PAEE9Gu03/UenNlqDWHqjrOs7JePE7iMwF4YIYhMYZLt5YdS hQmBwTnIs7g36HjeE/Fgubqx58QsG62ZFqakKnn5vLTBnAIKzwh1jIvjiXStlVSPOyib i3hMjp8gciMwwWrjaHjJePuOoj3ZAqPRCAMYGuVaAEgCHwUGT4AVnz7xbgMor6iRr9kK AAVQ== X-Gm-Message-State: ANoB5pm2UQ0UQD6fq2w9QoFqUS/VVj+rp/pK8FVKYLoTQCkM96zRf1A0 tg4HSdVbD6QpeRxYVfyDqNlKymsMy10= X-Received: by 2002:a5d:6daf:0:b0:242:7491:3be0 with SMTP id u15-20020a5d6daf000000b0024274913be0mr52726268wrs.67.1671295281702; Sat, 17 Dec 2022 08:41:21 -0800 (PST) Received: from lancelot ([195.147.220.46]) by smtp.gmail.com with ESMTPSA id p11-20020a5d68cb000000b002427bfd17b6sm6174405wrw.63.2022.12.17.08.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Dec 2022 08:41:21 -0800 (PST) Received: from gaius by lancelot with local (Exim 4.94.2) (envelope-from ) id 1p6aFU-00GksV-Ec; Sat, 17 Dec 2022 16:41:20 +0000 To: gcc-patches@gcc.gnu.org Subject: [PATCH, m2]: PR-108122 Reduce sleep times in gm2/pimcoroutines/run/pass/testtime.mod Date: Sat, 17 Dec 2022 16:41:20 +0000 Message-ID: <87y1r6aspb.fsf@debian> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Gaius Mulley via Gcc-patches From: Gaius Mulley Reply-To: Gaius Mulley Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752480172742579751?= X-GMAIL-MSGID: =?utf-8?q?1752480172742579751?= PR-108122 Reduce sleep times in gm2/pimcoroutines/run/pass/testtime.mod Change time unit to 1 jiffy (with respect to TimerHandler.def) rather than a second. gcc/testsuite/ChangeLog: * gm2/pimcoroutines/run/pass/testtime.mod: Reduce sleep times in the test by a factor of 25. Tested on amd64, ok for Trunk? diff --git a/gcc/testsuite/gm2/pimcoroutines/run/pass/testtime.mod b/gcc/testsuite/gm2/pimcoroutines/run/pass/testtime.mod index fa43163b107..f457716c89e 100644 --- a/gcc/testsuite/gm2/pimcoroutines/run/pass/testtime.mod +++ b/gcc/testsuite/gm2/pimcoroutines/run/pass/testtime.mod @@ -1,4 +1,4 @@ -(* Copyright (C) 2005-2020 +(* Copyright (C) 2005-2022 Free Software Foundation, Inc. *) (* This file is part of GNU Modula-2. @@ -31,30 +31,34 @@ FROM SYSTEM IMPORT ADR ; FROM libc IMPORT write, printf ; +CONST + TicksPerTimeUnit = 1 ; + + (* - OneSecond - + OneUnit - *) -PROCEDURE OneSecond ; +PROCEDURE OneUnit ; VAR n: CARDINAL ; BEGIN OldInts := TurnInterrupts (MIN (PROTECTION)) ; - printf ("1 second process has come to life\n"); + printf ("1 unit second process has come to life\n"); n := 0 ; LOOP - Sleep (1*TicksPerSecond) ; + Sleep (1*TicksPerTimeUnit) ; INC (n) ; - printf ("%d seconds\n", n); + printf ("%d units\n", n); END -END OneSecond ; +END OneUnit ; (* - FourSeconds - + FourUnits - *) -PROCEDURE FourSeconds ; +PROCEDURE FourUnits ; VAR n: CARDINAL ; BEGIN @@ -62,23 +66,23 @@ BEGIN printf ("4 seconds process has come to life\n"); n := 0 ; LOOP - Sleep (4*TicksPerSecond) ; + Sleep (4*TicksPerTimeUnit) ; INC (n) ; - printf ("4 second alarm (%d occurance)\n", n); + printf ("4 units alarm (%d occurance)\n", n); END -END FourSeconds ; +END FourUnits ; (* - SixSeconds - + SixUnits - *) -PROCEDURE SixSeconds ; +PROCEDURE SixUnits ; VAR n: CARDINAL ; BEGIN OldInts := TurnInterrupts (MAX (PROTECTION)) ; - printf ("6 seconds process has come to life\n"); + printf ("6 units process has come to life\n"); n := 0 ; LOOP Timeout := ArmEvent (6*TicksPerSecond) ; @@ -87,10 +91,10 @@ BEGIN WriteString ('...someone cancelled it...') ELSE INC (n) ; - printf ("6 second alarm (%d occurance)\n", n) + printf ("6 unit alarm (%d occurance)\n", n) END END -END SixSeconds ; +END SixUnits ; CONST @@ -107,10 +111,10 @@ BEGIN printf ("now to create three processes...\n") ; - p1 := Resume (InitProcess (OneSecond , StackSize, '1')) ; - p4 := Resume (InitProcess (FourSeconds, StackSize, '4')) ; - p6 := Resume (InitProcess (SixSeconds , StackSize, '6')) ; + p1 := Resume (InitProcess (OneUnit , StackSize, '1')) ; + p4 := Resume (InitProcess (FourUnits, StackSize, '4')) ; + p6 := Resume (InitProcess (SixUnits , StackSize, '6')) ; - Sleep (20*TicksPerSecond) ; + Sleep (20*TicksPerTimeUnit) ; printf ("successfully completed, finishing now.\n") END testtime.