public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jiong Wang <jiong.wang@arm.com>
To: Marek Polacek <polacek@redhat.com>,  Mike Stump <mikestump@comcast.net>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][dejagnu] truncate absolute file path into relative for dg-output
Date: Wed, 12 Nov 2014 14:38:00 -0000	[thread overview]
Message-ID: <546370C7.9050606@arm.com> (raw)
In-Reply-To: <20141112140903.GI29791@redhat.com>

On 12/11/14 14:09, Marek Polacek wrote:

>
> ... prune_gcc_output prunes more than just absolute file paths, it
> prunes even the "note: " messages.  And several ubsan tests have
> /* { dg-output "\[^\n\r]*note: pointer points here\[^\n\r]*(\n|\r\n|\r)" } */
> but since the note's are already gone, the test fails.
>
> The following patch moves the path prunning code into a separate
> procedure and fixes the failures.

thanks, this make sense, and LGTM.

(my fault, my test diff base must be wrong...)

>
> Ok for trunk?
>
> 2014-11-12  Marek Polacek  <polacek@redhat.com>
>
> 	* lib/gcc-dg.exp (${tool}_load): Call prune_file_path instead
> 	of prune_gcc_output.
> 	* lib/prune.exp (prune_file_path): New procedure.
>
> diff --git gcc/testsuite/lib/gcc-dg.exp gcc/testsuite/lib/gcc-dg.exp
> index 8168a77..6df8ae1 100644
> --- gcc/testsuite/lib/gcc-dg.exp
> +++ gcc/testsuite/lib/gcc-dg.exp
> @@ -282,7 +282,7 @@ if { [info procs ${tool}_load] != [list] \
>   	    set result [list $status [lindex $result 1]]
>   	}
>   
> -	set result [list [lindex $result 0] [prune_gcc_output [lindex $result 1]]]
> +	set result [list [lindex $result 0] [prune_file_path [lindex $result 1]]]
>   	return $result
>       }
>   }
> diff --git gcc/testsuite/lib/prune.exp gcc/testsuite/lib/prune.exp
> index 65028c2..df0e053 100644
> --- gcc/testsuite/lib/prune.exp
> +++ gcc/testsuite/lib/prune.exp
> @@ -68,13 +68,19 @@ proc prune_gcc_output { text } {
>       # Ignore harmless warnings from Xcode 4.0.
>       regsub -all "(^|\n)\[^\n\]*ld: warning: could not create compact unwind for\[^\n\]*" $text "" text
>   
> +    #send_user "After:$text\n"
> +
> +    return $text
> +}
> +
> +proc prune_file_path { text } {
> +    global srcdir
> +
>       # Truncate absolute file path into relative path.
>       set topdir "[file dirname [file dirname [file dirname $srcdir]]]"
>       regsub -all "$srcdir\/" $text "" text
>       regsub -all "$topdir\/" $text "" text
>   
> -    #send_user "After:$text\n"
> -
>       return $text
>   }
>   
> 	Marek
>
>
>


  reply	other threads:[~2014-11-12 14:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-11 16:58 Jiong Wang
2014-11-11 19:06 ` Mike Stump
2014-11-12 14:10 ` Marek Polacek
2014-11-12 14:38   ` Jiong Wang [this message]
2014-11-12 18:35   ` Mike Stump

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=546370C7.9050606@arm.com \
    --to=jiong.wang@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mikestump@comcast.net \
    --cc=polacek@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).