]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gold/testsuite/discard_locals_test.sh
* target-reloc.h (relocate_section): Check the symbol table index
[thirdparty/binutils-gdb.git] / gold / testsuite / discard_locals_test.sh
index c09f833d340fa4d1ebf3adea6598957532e37fff..3fc679a45855622a0cb09fccf7b4361b3e6d4804 100755 (executable)
 # the resulting executable and check that symbols from two test library
 # archives are correctly hidden or left unmodified.
 
-check()
+check_discarded()
 {
     file=$1
+    sym=$2
 
-    found=`egrep "should_be_discarded" $file`
+    found=`egrep $sym $file`
     if test -n "$found"; then
        echo "These local symbols are not discarded in $file:"
        echo "$found"
@@ -39,6 +40,24 @@ check()
     fi
 }
 
-check "discard_locals_test.syms"
+check_non_discarded()
+{
+    file=$1
+    sym=$2
+
+    found=`egrep $sym $file`
+    if test -z "$found"; then
+       echo "This local symbol is discarded in $file:"
+       echo "$2"
+       exit 1
+    fi
+}
+
+check_discarded     "discard_locals_test.syms" "should_be_discarded"
+
+check_non_discarded "discard_locals_relocatable_test1.syms" ".LC0"
+check_discarded     "discard_locals_relocatable_test1.syms" "should_be_discarded"
+check_non_discarded "discard_locals_relocatable_test2.syms" ".LC0"
+check_discarded     "discard_locals_relocatable_test2.syms" "should_be_discarded"
 
 exit 0