3bd1982dae9b291da2c4d85566c63806c812f886
[external/binutils.git] / gas / testsuite / gas / macros / macros.exp
1 # Run some tests of gas macros.
2
3 proc run_list_test { name opts } {
4     global srcdir subdir
5     set testname "macros $name"
6     set file $srcdir/$subdir/$name
7     gas_run ${name}.s $opts ">&dump.out"
8     if { [regexp_diff "dump.out" "${file}.l"] } then {
9         fail $testname
10         verbose "output is [file_contents "dump.out"]" 2
11         return
12     }
13     pass $testname
14 }
15
16 if { ![istarget hppa*-*-*] || [istarget *-*-linux*] } {
17     run_dump_test test1
18 }
19
20 if { ![istarget *c54x*-*-*] && ![istarget *c4x*-*-*] } {
21     run_dump_test test2
22 }
23
24 run_dump_test test3
25
26 if { ![istarget *c54x*-*-*] && ![istarget *c4x*-*-*] } {
27     run_dump_test irp
28     run_dump_test rept
29     run_dump_test repeat
30     run_dump_test vararg
31 }
32
33 gas_test_error "err.s" "" "macro infinite recursion"
34
35 # The tic4x-coff target fails the next test because it defines '&'
36 # as its line separator character, so the expression "(0 & TFLAG_C)"
37 # becomes divided up into two lines and the parser complains about
38 # a missing closing parenthesis for the first line.
39 setup_xfail "tic4x*-*"
40 gas_test "and.s" "" "" "logical and in macro definition"
41
42 case $target_triplet in {
43     { hppa*-*-* } { if [istarget *-*-linux*] { run_dump_test semi } }
44     { *c4x*-*-* } { }
45     { *c54x*-*-* } { }
46     default {
47         run_dump_test semi
48     }
49 }
50
51 if { ![istarget hppa*-*-*] || [istarget *-*-linux*] } {
52     # FIXME: Due to macro mishandling of ONLY_STANDARD_ESCAPES.
53     setup_xfail "avr-*" "cris-*" "crisv32-*" "msp430-*"
54
55     # These fail due to NO_STRING_ESCAPES
56     setup_xfail "powerpc*-*-aix*" "powerpc*-*-beos*" "powerpc*-*-macos*"
57     setup_xfail "powerpc*-*-pe" "powerpc*-*-*win*"
58     setup_xfail "rs6000-*-*"
59     setup_xfail "z80-*-*"
60
61     # FIXME: Due to difference in what "consecutive octets" means.
62     setup_xfail "*c4x*-*-*" "*c54x*-*"
63     run_dump_test strings
64 }
65
66 run_dump_test app1
67 run_dump_test app2
68 run_dump_test app3
69 run_dump_test app4
70
71 run_list_test badarg ""
72 case $target_triplet in {
73     { *c54x*-*-* } { }
74     { *c4x*-*-* } { }
75     { h8500-*-* } { }
76     { m68*-*-* } { }
77     { m88*-*-* } { }
78     { mmix-* } { }
79     { z80-* } { }
80     default { run_list_test dot "-alm" }
81 }
82 run_list_test end ""
83 run_list_test purge "--hash-size=8000"
84 run_list_test redef ""