From patchwork Sun Apr 30 10:16:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 88907 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2064053vqo; Sun, 30 Apr 2023 03:16:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4SnjTzeB7eOA6zJa9S6rKhxI1Wjts66W30i0xyLQNuAAAepx5V9zxradFrUCp4GxWQ46Hw X-Received: by 2002:a17:907:97c9:b0:94f:2bd0:4780 with SMTP id js9-20020a17090797c900b0094f2bd04780mr9198985ejc.58.1682849797647; Sun, 30 Apr 2023 03:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682849797; cv=none; d=google.com; s=arc-20160816; b=nRHyc/jJUBHR2qiYBQTfpqnzPyZBRaEXASRucxo7+6PAUmuVdwjQsEy79qJU3YGrYw ngTqHlrotm1nE92DocDeSgLmeppD99bNuT1tQPJz6ptqjJNT5qYXp/1qLGr3BhJmauFA TBk7K7BbO0IJmmz/rRQfAqX02yPM6Kd70Tu5AawrMaIL4o7W78SLYiE3T03sk8g0cuIi 5xk69elSdMcLJwVNOgOKFzPakJfeQnz7AlvMLrWEXLZyG0Ddm5esjjW/YrRph1xjj1xv g5kzEJy6TQREiglrWuYgz9tgfTLDA7OomZY3PySgx9tKRWD309ndrhDPMUeJEebZjSvb sYZg== 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:subject:to :content-language:user-agent:mime-version:date:message-id :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=jOLDK/kn9kJtXSkuWJBvcr011F/TWPEuvoGDqUgO/f8=; b=UySZkHzN+mJvCEJRneuRqVQ5ZkA+g2ZmnkynGH5N/yokhkv+E4YAAVDDUFJ8Fk+vg+ NRl9SYg1eg59D4q6dNnKMbMMxhTiGE77C2BTsZnOdbqdln2eSwa5xrl5bPIwyyNoCCFE iaV851uzEfF63KKi685Dy5CsgX4keS7FUqvDBr6lL1EYNQos+XTvPuhdxxdn6p0zKHEK zdralnGpf5POM+WxxjJdfsFfOXibjsyYvT0lG6wSEeBVMI7BjwMJrWUZj4mtjNlL57JQ yLohy+CT8UIIzBLbZr2/2c0cPds5mOtGn7Fr1spm1BQQyp7ToXfnrqQHi4fGQi5npVm4 gaCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=lX8zJVqY; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id a3-20020a170906274300b0094fbd6d6c7csi17527417ejd.263.2023.04.30.03.16.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Apr 2023 03:16:37 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=lX8zJVqY; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4DCF53858438 for ; Sun, 30 Apr 2023 10:16:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DCF53858438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682849796; bh=jOLDK/kn9kJtXSkuWJBvcr011F/TWPEuvoGDqUgO/f8=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=lX8zJVqYpFlICgt6R5UXa2NGVUpvDYJS5A9gNWMkO2HvouKTRu2bLFoG5YekW6zmL BL5D1kZPJTHFUNW9VhFeZHETmuVptVZ93UQoM6fAz1kRo4MNpWQ9OGTjoazM8Ota0P ks1Wxer7V3z2Lxz8igaygaIUgjW/VMojngi/S1U4= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from cc-smtpout3.netcologne.de (cc-smtpout3.netcologne.de [89.1.8.213]) by sourceware.org (Postfix) with ESMTPS id 60E0B3858D28 for ; Sun, 30 Apr 2023 10:16:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 60E0B3858D28 Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout3.netcologne.de (Postfix) with ESMTP id 55A3E122E9 for ; Sun, 30 Apr 2023 12:16:24 +0200 (CEST) Received: from [IPV6:2a0a:a540:d3e:0:7285:c2ff:fe6c:992d] (2a0a-a540-d3e-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de [IPv6:2a0a:a540:d3e:0:7285:c2ff:fe6c:992d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by cc-smtpin1.netcologne.de (Postfix) with ESMTPSA id 0E64911DEF for ; Sun, 30 Apr 2023 12:16:23 +0200 (CEST) Message-ID: <541a3fba-3b07-d4e3-f913-f10d7163a59e@netcologne.de> Date: Sun, 30 Apr 2023 12:16:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Content-Language: en-US To: binutils@sourceware.org Subject: [patch, gas, documentation] Some additional testsuite info X-NetCologne-Spam: L X-Spamd-Bar: --- X-Rspamd-Action: no action X-Rspamd-Queue-Id: 0E64911DEF X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Thomas Koenig via Binutils From: Thomas Koenig Reply-To: Thomas Koenig Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764595909787862374?= X-GMAIL-MSGID: =?utf-8?q?1764595909787862374?= Hi, here's some additional info on the gas testsuite. I also took the liberty to delete the "kind of lame" comment, which is not really appropriate any more, at least not for the architectures which were added in the last few decades. It was actually quite amusing to run the testsuite on an architecture which did not (yet) have a NOP :-) Best regards Thomas diff --git a/gas/doc/internals.texi b/gas/doc/internals.texi index 56f10fd16fa..b2d2e0f39b8 100644 --- a/gas/doc/internals.texi +++ b/gas/doc/internals.texi @@ -1154,7 +1154,7 @@ types not mentioned here. The second parameter is @var{litP} which is a pointer to a byte array where the converted value should be stored. The value is converted into LITTLENUMs and is stored in the target's endian-ness order. (@var{LITTLENUM} is defined in -gas/bignum.h). Single precision values occupy 2 littlenums. Double precision +@file{gas/bignum.h}). Single precision values occupy 2 littlenums. Double precision values occupy 4 littlenums and extended precision values occupy either 5 or 6 littlenums, depending upon the target. @@ -1934,10 +1934,20 @@ original filename and line number that they are applicable to. @section Test suite @cindex test suite -The test suite is kind of lame for most processors. Often it only checks to -see if a couple of files can be assembled without the assembler reporting any -errors. For more complete testing, write a test which either examines the -assembler listing, or runs @code{objdump} and examines its output. For the +The test suite uses dejagnu. It is invoked by running @command{make check} from +the main gas directory or, recursively, from the main binutils direcctory. + +Some tests are run for all targets. These are situated in the +@file{gas/testsuite/gas/all} subdirectory. These tests require a @code{nop} +instruction, otherwise many of them will fail, including crashing the test +suite driver. + +If you create a subdirectory for architecture foo_arch, create a file +@file{foo_arch/foo_arch.exp} which contains the TCL commands run by +dejagnu. + +It is best to write tests which either examine the +assembler listing, or run @code{objdump} and examine its output. For the latter, the TCL procedure @code{run_dump_test} may come in handy. It takes the base name of a file, and looks for @file{@var{file}.d}. This file should contain as its initial lines a set of variable settings in @samp{#} comments, @@ -1959,10 +1969,17 @@ The non-commented parts of the file are interpreted as regular expressions, one per line. Blank lines in the @code{objdump} or @code{nm} output are skipped, as are blank lines in the @code{.d} file; the other lines are tested to see if the regular expression matches the program output. If it does not, the test -fails. +fails. Whitespace is significant. Note that this means the tests must be +modified if the @code{objdump} output style is changed. + +A simple example of this is contained in the @file{testsuite/gas/aarch64} +directory. -Note that this means the tests must be modified if the @code{objdump} output -style is changed. +If you want to run only the tests for foo_arch, use + +@example +$ make check RUNTESTFLAGS="foo_arch.exp" +@end example @bye @c Local Variables: