| 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 | } |
| 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 | |
| 60 | # FIXME: Due to difference in what "consecutive octets" means. |
| 61 | setup_xfail "*c4x*-*-*" "*c54x*-*" |
| 62 | run_dump_test strings |
| 63 | } |
| 64 | |
| 65 | run_dump_test app1 |
| 66 | run_dump_test app2 |
| 67 | run_dump_test app3 |
| 68 | run_dump_test app4 |
| 69 | |
| 70 | run_list_test badarg "" |
| 71 | case $target_triplet in { |
| 72 | { *c54x*-*-* } { } |
| 73 | { *c4x*-*-* } { } |
| 74 | { h8500-*-* } { } |
| 75 | { m68*-*-* } { } |
| 76 | { m88*-*-* } { } |
| 77 | { mmix-* } { } |
| 78 | default { run_list_test dot "-alm" } |
| 79 | } |
| 80 | run_list_test end "" |
| 81 | run_list_test purge "--hash-size=8000" |
| 82 | run_list_test redef "" |