+# 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
+