This commit was generated by cvs2svn to track changes on a CVS vendor
[deliverable/binutils-gdb.git] / gas / testsuite / lib / gas-dg.exp
1 # Define gas callbacks for dg.exp.
2
3 load_lib dg.exp
4
5 # The use of this function is still in a bit of flux.
6 # It should be theoretically possible to assemble, link, and run a file
7 # but we currently don't support that. Assembler testcases aren't usually
8 # that elaborate anyway. :-)
9
10 proc gas-dg-test { prog do_what tool_flags default_tool_flags libs } {
11 switch $do_what {
12 "preprocess" {
13 }
14 "assemble" {
15 }
16 "link" {
17 }
18 "run" {
19 }
20 default {
21 perror "$do_what: not a valid dg-do keyword"
22 return
23 }
24 }
25
26 # gas_start prepends $srcdir/$subdir so we must remove it from PROG
27 # if present. First remove extraneous //'s.
28 global srcdir subdir
29 set dir "$srcdir/$subdir"
30 regsub -all "//" $dir "/" dir
31 regsub -all "//" $prog "/" prog
32 if [string match "$dir/*" $prog] {
33 regsub "$dir" $prog "" prog
34 }
35
36 # FIXME: This should be gas_start but it doesn't set comp_output.
37 gas_run $prog $tool_flags ""
38 }
39
40 proc gas-dg-prune { system text } {
41 #send_user "Before:$text\n"
42 regsub -all "(^|\n)\[^\n\]*: Assembler messages:\[^\n\]*" $text "" text
43 regsub -all "(^|\n)\[^\n\]*: End of file not at end\[^\n\]*Newline inserted." $text "" text
44 #send_user "After:$text\n"
45
46 return $text
47 }
This page took 0.034484 seconds and 5 git commands to generate.