[PING, testsuite] Add dot-file scan to test-case

Tom de Vries Tom_deVries@mentor.com
Mon Apr 18 07:59:00 GMT 2016


On 18-04-16 09:30, Richard Biener wrote:
>>> diff --git a/gcc/testsuite/lib/scandump.exp b/gcc/testsuite/lib/scandump.exp
>>> > >index 74d27cc..89b3944 100644
>>> > >--- a/gcc/testsuite/lib/scandump.exp
>>> > >+++ b/gcc/testsuite/lib/scandump.exp
>>> > >@@ -22,7 +22,7 @@
>>> > >   # Extract the constant part of the dump file suffix from the regexp.
>>> > >   # Argument 0 is the regular expression.
>>> > >   proc dump-suffix { arg } {
>>> > >-    set idx [expr [string last "." $arg] + 1]
>>> > >+    set idx [expr [string first "." $arg] + 1]
> Does that even work?  For t.c.012t.foo the first "." is after 't'.

With this patch:
....
diff --git a/gcc/testsuite/lib/scandump.exp b/gcc/testsuite/lib/scandump.exp
index 89b3944..89e5754 100644
--- a/gcc/testsuite/lib/scandump.exp
+++ b/gcc/testsuite/lib/scandump.exp
@@ -22,6 +22,7 @@
  # Extract the constant part of the dump file suffix from the regexp.
  # Argument 0 is the regular expression.
  proc dump-suffix { arg } {
+    puts "dump-suffix arg: $arg"
      set idx [expr [string first "." $arg] + 1]
      return [string range $arg $idx end]
  }
...

I see:
...
dump-suffix arg: [0-9][0-9][0-9]i.inline.dot
dump-suffix arg: [0-9][0-9][0-9]i.cp.dot
...

So, by cutting off after the first dot, we find 'inline.dot' and 'cp.dot', 
instead of just 'dot'.

Thanks,
- Tom



More information about the Gcc-patches mailing list