When gcc-dg-runtest is used to run a test the test is run several times with different options. For clarity of the log, the test infrastructure then append the options to the testname. This means that all the code that must deal with the testcase itself (eg. removing the output files after the test has run) needs to remove the option name. There is already a pattern (see below) for this in several place of the testsuite framework but it is also missing in many places. This patch fixes all of these places. The pattern is as follows: set testcase [testname-for-summary] ; The name might include a list of options; extract the file name. set testcase [lindex $testcase 0] ChangeLog entry is as follows: *** gcc/testsuite/ChangeLog *** 2017-11-08 Thomas Preud'homme * lib/scanasm.exp (scan-assembler): Extract filename from testname used in summary. (scan-assembler-not): Likewise. (scan-hidden): Likewise. (scan-not-hidden): Likewise. (scan-stack-usage): Likewise. (scan-stack-usage-not): Likewise. (scan-assembler-times): Likewise. (scan-assembler-dem): Likewise. (scan-assembler-dem-not): Likewise. (object-size): Likewise. (scan-lto-assembler): Likewise. * lib/scandump.exp (scan-dump): Likewise. (scan-dump-times): Likewise. (scan-dump-not): Likewise. (scan-dump-dem): Likewise. (scan-dump-dem-not): Likewise Testing: Ran testsuite on bootstrap aarch64-linux-gnu and x86_64-linux-gnu compiled with C, fortran and ada support without any regression. Is this ok for trunk? Best regards, Thomas