diff options
Diffstat (limited to 'gcc/testsuite/jit.dg/jit.exp')
-rw-r--r-- | gcc/testsuite/jit.dg/jit.exp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/jit.dg/jit.exp b/gcc/testsuite/jit.dg/jit.exp index 10b98bd..3568dbb 100644 --- a/gcc/testsuite/jit.dg/jit.exp +++ b/gcc/testsuite/jit.dg/jit.exp @@ -864,6 +864,39 @@ proc jit-verify-assembler { args } { jit-run-executable ${executable_from_asm} ${dg-output-text} } +# Assuming that a .s file has been written out named +# OUTPUT_FILENAME, check that the argument matches the +# output file. +# For use by the test-link-section-assembler.c testcase. +proc jit-verify-assembler-output { args } { + verbose "jit-verify-assembler: $args" + + set dg-output-text [lindex $args 0] + verbose "dg-output-text: ${dg-output-text}" + + upvar 2 name name + verbose "name: $name" + + upvar 2 prog prog + verbose "prog: $prog" + set asm_filename [jit-get-output-filename $prog] + verbose " asm_filename: ${asm_filename}" + + # Read the assembly file. + set f [open $asm_filename r] + set content [read $f] + close $f + + # Verify that the assembly matches the regex. + if { ![regexp ${dg-output-text} $content] } { + fail "${asm_filename} output pattern test, is ${content}, should match ${dg-output-text}" + verbose "Failed test for output pattern ${dg-output-text}" 3 + } else { + pass "${asm_filename} output pattern test, ${dg-output-text}" + verbose "Passed test for output pattern ${dg-output-text}" 3 + } + +} # Assuming that a .o file has been written out named # OUTPUT_FILENAME, invoke the driver to try to turn it into # an executable, and try to run the result. |