Allow objdump to recognise the System.Runtime.dll files that get shipped with .NET...
[deliverable/binutils-gdb.git] / binutils / testsuite / binutils-all / objdump.exp
index beaf44f954e27928451c04433710000696496e3c..b46fd0a8bb44d2616aa35852d88e18991a8f1fe3 100644 (file)
@@ -732,6 +732,49 @@ if {[is_elf_format]} then {
     remote_file host delete $testfile3
 }
 
+# Test objdump on .NET assemblies (PE files)
+
+proc test_objdump_dotnet_assemblies {} {
+    global OBJDUMP
+    global base_dir
+
+    set test "dotnet-assemblies"
+
+    set got [binutils_run "$base_dir/testsuite/gentestdlls" "tmpdir"]
+    set want "wrote dotnet-linux-x86-64.dll"
+    if ![regexp $want $got] then {
+       unsupported "$test"
+    }
+
+    set test "dotnet-assemblies (32-bit)"
+    set want "file format pei-i386"
+    set got [binutils_run $OBJDUMP "-x tmpdir/simple-i386.dll"]
+    if ![regexp $want $got] then {
+       if [regexp "file format not recognized" $got] then {
+           unsupported $test
+       } else {
+           fail "$test"
+       }
+    } else {
+       pass $test
+    }
+
+    set test "dotnet-assemblies (64-bit)"
+    set want "file format pei-x86-64"
+    set got [binutils_run $OBJDUMP "-x tmpdir/dotnet-linux-x86-64.dll"]
+    if ![regexp $want $got] then {
+       if [regexp "file format not recognized" $got] then {
+           unsupported $test
+       } else {
+           fail "$test"
+       }
+    } else {
+       pass $test
+    }
+}
+
+test_objdump_dotnet_assemblies
+
 # Options which are not tested: -a -D -R -T -x -l --stabs
 # I don't see any generic way to test any of these other than -a.
 # Tests could be written for specific targets, and that should be done
This page took 0.024078 seconds and 4 git commands to generate.