]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.dwarf2/imported-unit.exp
[gdb/testsuite] Fix imported-unit.exp FAIL without psymtabs
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.dwarf2 / imported-unit.exp
index 80d66283572342e2eec5717f11dc3a043931d786..41a7505459466e53c64ad5dbe1770490ce33d870 100644 (file)
@@ -149,19 +149,25 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
 
 gdb_test_no_output "set language c++"
 
+set psymtabs_p [psymtabs_p]
+
 # Verify that the partial symtab for the unit importing the partial unit does
 # not contain the static partial symbol int, which is defined in the partial
 # unit.  Test-case for PR25646.
-gdb_test "main print psymbols" \
-    [multi_line \
-        "  Depends on 1 other partial symtabs\." \
-        "\[^\r\n\]*" \
-        "  Global partial symbols:" \
-        "    `main', function, $hex" \
-        "" \
-        ".*"] \
-    "no static partial symbols in importing unit"
-
+set test "no static partial symbols in importing unit"
+if { $psymtabs_p } {
+    gdb_test "main print psymbols" \
+       [multi_line \
+            "  Depends on 1 other partial symtabs\." \
+            "\[^\r\n\]*" \
+            "  Global partial symbols:" \
+            "    `main', function, $hex" \
+            "" \
+            ".*"] \
+       $test
+} else {
+    unsupported $test
+}
 # Sanity check
 gdb_test "ptype main" "= int \\(void\\)"