lappend cpus_expected m16c m32c m32r m68hc11 m68hc12 m68k MCore mep c5 h1 MicroBlaze
lappend cpus_expected mips mn10200 mn10300 ms1 msp MSP430 nds32 n1h_v3 ns32k
lappend cpus_expected or1k or1knd pj powerpc pyramid riscv romp rs6000 s390 sh sparc
-lappend cpus_expected tic54x tic80 tilegx tms320c30 tms320c4x tms320c54x
+lappend cpus_expected tic54x tilegx tms320c30 tms320c4x tms320c54x
lappend cpus_expected v850 vax x86-64 xscale xtensa z8k z8001 z8002
# Make sure the target CPU shows up in the list.
test_objdump_dotnet_assemblies
+# Test objdump -S
+
+proc test_objdump_S { } {
+ global srcdir
+ global subdir
+ global OBJDUMP
+ global OBJDUMPFLAGS
+
+ set test "objdump -S"
+
+ if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog executable debug] != "" } {
+ unsupported "$test (build)"
+ return
+ }
+
+ set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -D -S tmpdir/testprog"]
+
+ set want "static int local = 2"
+
+ if [regexp $want $got] then {
+ pass $test
+ } else {
+ fail $test
+ }
+
+ set test "objdump --source-comment"
+
+ set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble-all --source-comment=// tmpdir/testprog"]
+
+ set want "//static int local = 2"
+
+ if [regexp $want $got] then {
+ pass $test
+ } else {
+ fail $test
+ }
+}
+
+test_objdump_S
+
# 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