* dwarf2read.c (dwarf_str_buffer): New.
[deliverable/binutils-gdb.git] / gas / testsuite / gas / mips / mips.exp
index 95cc01a0b63a154eb9502bee68b395229e217e89..d2d13e60d5ec4251e16c499159938125362b987c 100644 (file)
@@ -1,32 +1,39 @@
 #
 # Some generic MIPS tests
 #
-if [istarget mips*-*-*] then {
-    set no_mips16 0
-    set svr4pic [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] ]
-    set empic [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ]
-    set aout [expr [istarget *-*-bsd*] || [istarget *-*-netbsd*] || [istarget *-*-openbsd*]]
-    set ilocks [expr [istarget mips64vr4300*-*-*] || [istarget mips64vr4100*-*-*] || [istarget mipstx39*-*-*]]
-    set gpr_ilocks [expr [istarget mipstx39*-*-*]]
-
-# start-sanitize-tx19
-    set ilocks [expr $ilocks || [istarget mipstx19*-*-*]]
-    set gpr_ilocks [expr $gpr_ilocks || [istarget mipstx19*-*-*]]
-# end-sanitize-tx19
 
-# start-sanitize-vr4320
-    set ilocks [expr $ilocks || [istarget mips64vr4320*-*-*]]
+proc run_list_test { name opts } {
+    global srcdir subdir
+    set testname "MIPS $name"
+    set file $srcdir/$subdir/$name
+    gas_run ${name}.s $opts ">&dump.out"
+    if { [regexp_diff "dump.out" "${file}.l"] } then {
+       fail $testname
+       verbose "output is [file_contents "dump.out"]" 2
+       return
+    }
+    pass $testname
+}
 
-# end-sanitize-vr4320
-#start-sanitize-tx49
-    set ilocks [expr $ilocks || [istarget mips64tx49*-*-*]]
-    set no_mips16 [expr $no_mips16 || [istarget mips64tx49*-*-*]]
-#end-sanitize-tx49
+if { [istarget mips*-*-*] } then {
+    set no_mips16 0
+    set elf [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] || [istarget *-*-linux*] || [istarget *-*-netbsd*] ]
+    set ecoff [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ]
+    set aout [expr [istarget *-*-bsd*] || [istarget *-*-openbsd*] ]
+    set ilocks [istarget mipstx39*-*-*]
+    set gpr_ilocks [expr [istarget mipstx39*-*-*]]
+    set addr32 [expr [istarget mipstx39*-*-*]]
 
-# start-sanitize-vr5400
-    set ilocks [expr $ilocks || [istarget mips64vr5400*-*-*]]
-    set gpr_ilocks [expr $gpr_ilocks || [istarget mips64vr5400*-*-*]]
-# end-sanitize-vr5400
+    if { [istarget "mips*-*-*linux*"] } then {
+       set tmips "t"
+    } else {
+       set tmips ""
+    }
+    if [istarget mips*el-*-*] {
+       set el el
+    } {
+       set el ""
+    }
 
     run_dump_test "abs"
     run_dump_test "add"
@@ -40,41 +47,55 @@ if [istarget mips*-*-*] then {
     run_dump_test "bltu"
     if !$ilocks { run_dump_test "div" } else { run_dump_test "div-ilocks" }
     run_dump_test "dli"
-    run_dump_test "jal"
-    if $svr4pic { run_dump_test "jal-svr4pic" }
-    if $svr4pic { run_dump_test "jal-xgot" }
-    if $empic { run_dump_test "jal-empic" }
+    if $elf {
+       run_dump_test "elf-jal"
+    } else {
+       run_dump_test "jal"
+    }
+    if $elf { run_dump_test "jal-svr4pic" }
+    if $elf { run_dump_test "jal-xgot" }
+    if $ecoff { run_dump_test "jal-empic" }
     if !$aout { run_dump_test "la" }
-    if $svr4pic { run_dump_test "la-svr4pic" }
-    if $svr4pic { run_dump_test "la-xgot" }
-    if $empic { run_dump_test "la-empic" }
+    if $elf { run_dump_test "la-svr4pic" }
+    if $elf { run_dump_test "la-xgot" }
+    if $ecoff { run_dump_test "la-empic" }
     if !$aout { run_dump_test "lb" }
-    if $svr4pic { run_dump_test "lb-svr4pic" }
-    if $svr4pic {
+    if $elf { run_dump_test "lb-svr4pic" }
+    if $elf {
        # Both versions specify the cpu, so we can run both regardless of
        # the interlocking in the configured default cpu.
        run_dump_test "lb-xgot"
        run_dump_test "lb-xgot-ilocks"
     }
-    if $empic { run_dump_test "lb-empic" }
-    if !$aout { if !$gpr_ilocks { run_dump_test "ld" } else { run_dump_test "ld-ilocks" } } 
-    if $svr4pic { run_dump_test "ld-svr4pic" }
-    if $svr4pic { run_dump_test "ld-xgot" }
-    if $empic { run_dump_test "ld-empic" }
+    if $ecoff { run_dump_test "lb-empic" }
+    if !$aout { 
+        if !$gpr_ilocks { 
+            run_dump_test "ld" 
+        } else { 
+            if !$addr32 {
+                run_dump_test "ld-ilocks"
+            } else {
+                run_dump_test "ld-ilocks-addr32"
+            }
+        }
+    }
+    if $elf { run_dump_test "ld-svr4pic" }
+    if $elf { run_dump_test "ld-xgot" }
+    if $ecoff { run_dump_test "ld-empic" }
     run_dump_test "li"
     if !$aout { run_dump_test "lifloat" }
-    if $svr4pic { run_dump_test "lif-svr4pic" }
-    if $svr4pic { run_dump_test "lif-xgot" }
-    if $empic { run_dump_test "lif-empic" }
+    if $elf { run_dump_test "lif-svr4pic" }
+    if $elf { run_dump_test "lif-xgot" }
+    if $ecoff { run_dump_test "lif-empic" }
     run_dump_test "mips4"
     if !$ilocks { run_dump_test "mul" } else { run_dump_test "mul-ilocks" }
     run_dump_test "rol"
     if !$aout { run_dump_test "sb" }
     run_dump_test "trunc"
     if !$aout { run_dump_test "ulh" }
-    if $svr4pic { run_dump_test "ulh-svr4pic" }
-    if $svr4pic { run_dump_test "ulh-xgot" }
-    if $empic { run_dump_test "ulh-empic" }
+    if $elf { run_dump_test "ulh-svr4pic" }
+    if $elf { run_dump_test "ulh-xgot" }
+    if $ecoff { run_dump_test "ulh-empic" }
     if !$aout {
        run_dump_test "ulw"
        run_dump_test "uld"
@@ -84,18 +105,66 @@ if [istarget mips*-*-*] then {
     }
     # The mips16 test can only be run on ELF, because only ELF
     # supports the necessary mips16 reloc.
-    if { $svr4pic && !$no_mips16 } { run_dump_test "mips16" }
+    if { $elf && !$no_mips16 } { run_dump_test "mips16" }
     run_dump_test "delay"
     run_dump_test "nodelay"
-# start-sanitize-vr5400
-    run_dump_test "vr5400"
-# end-sanitize-vr5400
-# start-sanitize-r5900
-    run_dump_test "r5900"
-    run_dump_test "vu0"
-# end-sanitize-r5900
     run_dump_test "mips4010"
     run_dump_test "mips4650"
     run_dump_test "mips4100"
+    run_dump_test "perfcount"
+    # Linux uses ELF stabs, which doesn't support line number.
+    setup_xfail "mips*-*-*linux*"
     run_dump_test "lineno"
+    run_dump_test "sync"
+    run_dump_test "mips32"
+    run_dump_test "mips64"
+    run_dump_test "sb1-ext-ps"
+
+    # It will always fail until someone fixes it.
+    setup_xfail "mips*-*-*"
+    run_dump_test "relax"
+
+    run_list_test "illegal" ""
+
+    run_dump_test "mips-gp32-fp32"
+    run_dump_test "mips-gp32-fp64"
+    run_dump_test "mips-gp64-fp32"
+    run_dump_test "mips-gp64-fp64"
+
+    if $elf {
+       # Make sure that -mcpu=FOO and -mFOO are equivalent.  Assemble a file
+       # containing 4650-specific instructions with -m4650 and -mcpu=4650,
+       # and verify that they're the same.  Specifically, we're checking
+       # that the EF_MIPS_MACH field is set, and that the 4650 'mul'
+       # instruction does get used.  In previous versions of GAS, 
+       # only -mcpu=4650 would set the EF_MIPS_MACH field; -m4650 wouldn't.
+       run_dump_test "elf_e_flags1"
+       run_dump_test "elf_e_flags2"
+       run_dump_test "elf_e_flags3"
+       run_dump_test "elf_e_flags4"
+    
+       run_dump_test "mips-gp32-fp32-pic"
+       run_dump_test "mips-gp32-fp64-pic"
+       run_dump_test "mips-gp64-fp32-pic"
+       run_dump_test "mips-gp64-fp64-pic"
+
+       run_dump_test "mips-abi32"
+       run_dump_test "mips-abi32-pic"
+
+       run_dump_test "elf${el}-rel"
+       if [istarget mips64*-*-*] { 
+           run_dump_test "elf${el}-rel2"
+           run_dump_test "elf-rel4"
+       } {
+           run_dump_test "e32${el}-rel2"
+           run_dump_test "e32-rel4"
+       }
+       run_dump_test "elf${el}-rel3"
+       run_dump_test "${tmips}${el}empic"
+       run_dump_test "empic2"
+       if { !$no_mips16 } { 
+           run_dump_test "${tmips}mips${el}16-e" 
+           run_dump_test "${tmips}mips${el}16-f" 
+       }
+    }
 }
This page took 0.027586 seconds and 4 git commands to generate.