aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2020-05-08 12:18:41 +0200
committerMark Wielaard <mark@klomp.org>2020-05-08 18:50:16 +0200
commita8493c12a707390fb8307fe60fe83e1aed960f89 (patch)
treee447cb704dc63c212ab6fa3946da143e33991105 /tests
parente1db5cdc9f230f8de4df1a0f38dca69b283ee57a (diff)
downloadplatform_external_elfutils-a8493c12a707390fb8307fe60fe83e1aed960f89.tar.gz
platform_external_elfutils-a8493c12a707390fb8307fe60fe83e1aed960f89.tar.bz2
platform_external_elfutils-a8493c12a707390fb8307fe60fe83e1aed960f89.zip
libdw: Skip imported compiler_units in libdw_visit_scopes walking DIE tree
Some gcc -flto versions imported other top-level compile units, skip those. Otherwise we'll visit various DIE trees multiple times. Note in the testcase that with newer GCC versions function foo is fully inlined and does appear only once (as declared, but not as separate subprogram). Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog9
-rw-r--r--tests/Makefile.am1
-rwxr-xr-xtests/run-allfcts.sh27
-rwxr-xr-xtests/testfile-lto-gcc8.bz2bin0 -> 3686 bytes
-rwxr-xr-xtests/testfile-lto-gcc9.bz2bin0 -> 3809 bytes
5 files changed, 37 insertions, 0 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index b59ebc9f..4e9ae020 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,5 +1,14 @@
2020-05-05 Mark Wielaard <mark@klomp.org>
+ * testfile-lto-gcc8.bz2: New test file.
+ * testfile-lto-gcc9.bz2: Likewise.
+ * Makefile.am (EXTRA_DIST): Add testfile-lto-gcc8.bz2 and
+ testfile-lto-gcc9.bz2.
+ * run-allfcts.sh: Add testfile-lto-gcc9 and testfile-lto-gcc8
+ tests.
+
+2020-05-05 Mark Wielaard <mark@klomp.org>
+
* testfile-lto-gcc10.bz2: New test file.
* Makefile.am (EXTRA_DIST): Add testfile-lto-gcc10.bz2.
* run-allfcts.sh: Add testfile-lto-gcc10 test.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2fed12e1..a7ad07d0 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -219,6 +219,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \
testfile13.bz2 run-strip-test3.sh run-allfcts.sh \
testfile_class_func.bz2 testfile_nested_funcs.bz2 \
testfile-lto-gcc10.bz2 \
+ testfile-lto-gcc9.bz2 testfile-lto-gcc8.bz2 \
run-line2addr.sh run-elflint-test.sh testfile14.bz2 \
run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
run-strip-test7.sh run-strip-test8.sh run-strip-groups.sh \
diff --git a/tests/run-allfcts.sh b/tests/run-allfcts.sh
index f8c1ce78..9c0a55d8 100755
--- a/tests/run-allfcts.sh
+++ b/tests/run-allfcts.sh
@@ -143,4 +143,31 @@ testrun_compare ${abs_builddir}/allfcts testfile-lto-gcc10 <<\EOF
/home/mark/src/tests/testfile-lto-main.c:6:main
EOF
+# Using gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
+# gcc -g -O2 -flto -c testfile-lto-func.c
+# gcc -g -O2 -flto -c testfile-lto-main.c
+# gcc -g -O2 -flto -o testfile-lto-gcc8 testfile-lto-func.o testfile-lto-main.o
+
+testfiles testfile-lto-gcc8
+
+testrun_compare ${abs_builddir}/allfcts testfile-lto-gcc8 <<\EOF
+/home/mark/src/tests/testfile-lto-func.c:4:foo
+/home/mark/src/tests/testfile-lto-main.c:6:main
+/home/mark/src/tests/testfile-lto-main.c:6:main
+/home/mark/src/tests/testfile-lto-func.c:4:foo
+EOF
+
+# gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2)
+# gcc -g -O2 -flto -c testfile-lto-func.c
+# gcc -g -O2 -flto -c testfile-lto-main.c
+# gcc -g -O2 -flto -o testfile-lto-gcc9 testfile-lto-func.o testfile-lto-main.o
+
+testfiles testfile-lto-gcc9
+
+testrun_compare ${abs_builddir}/allfcts testfile-lto-gcc9 <<\EOF
+/home/mark/src/tests/testfile-lto-main.c:6:main
+/home/mark/src/tests/testfile-lto-func.c:4:foo
+/home/mark/src/tests/testfile-lto-main.c:6:main
+EOF
+
exit 0
diff --git a/tests/testfile-lto-gcc8.bz2 b/tests/testfile-lto-gcc8.bz2
new file mode 100755
index 00000000..cf744d9e
--- /dev/null
+++ b/tests/testfile-lto-gcc8.bz2
Binary files differ
diff --git a/tests/testfile-lto-gcc9.bz2 b/tests/testfile-lto-gcc9.bz2
new file mode 100755
index 00000000..df503618
--- /dev/null
+++ b/tests/testfile-lto-gcc9.bz2
Binary files differ