From patchwork Mon Sep 20 22:13:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 65259 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id A26B4B70A6 for ; Tue, 21 Sep 2010 08:13:39 +1000 (EST) Received: (qmail 27829 invoked by alias); 20 Sep 2010 22:13:37 -0000 Received: (qmail 27820 invoked by uid 22791); 20 Sep 2010 22:13:36 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, TW_ZJ, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Sep 2010 22:13:31 +0000 Received: by qwb8 with SMTP id 8so890qwb.20 for ; Mon, 20 Sep 2010 15:13:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.182.84 with SMTP id cb20mr6621020qcb.126.1285020809935; Mon, 20 Sep 2010 15:13:29 -0700 (PDT) Received: by 10.229.182.15 with HTTP; Mon, 20 Sep 2010 15:13:29 -0700 (PDT) Date: Tue, 21 Sep 2010 00:13:29 +0200 Message-ID: Subject: [PATCH, testsuite]: Really remove stack dump files From: Uros Bizjak To: gcc-patches@gcc.gnu.org Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk 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 Hello! Attached patch really removes .su files from test directory. The problem with the call to cleanup-dump is, that it removes filenames that include source file extension (.c, .cpp, .f90 or whatever) before .su is appended. There is no appropriate function in the library, so we have to open-code the function. 2010-09-21 Uros Bizjak * lib/gcc-dg.exp (clanup-stack-usage): Really remove .su files. Patch was tested on x86_64-pc-linux-gnu, committed to mainline SVN. Uros. Index: lib/gcc-dg.exp =================================================================== --- lib/gcc-dg.exp (revision 164444) +++ lib/gcc-dg.exp (working copy) @@ -461,8 +461,21 @@ } # Remove a stack usage file for the current test. -proc cleanup-stack-usage { args } { - cleanup-dump "su" +proc cleanup-stack-usage { } { + # This assumes that we are two frames down from dg-test or some other proc + # that stores the filename of the testcase in a local variable "name". + # A cleaner solution would require a new DejaGnu release. + upvar 2 name testcase + # The name might include a list of options; extract the file name. + set testcase [lindex $testcase 0] + remove-build-file "[file rootname [file tail $testcase]].su" + + # Clean up files for additional source files. + if [info exists additional_sources] { + foreach srcfile $additional_sources { + remove-build-file "[file rootname [file tail $srcfile]].su" + } + } } # Remove all dump files with the provided suffix.