diff options
author | Florian Weimer <fweimer@redhat.com> | 2018-01-08 14:57:25 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2018-01-08 14:57:25 +0100 |
commit | 579396ee082565ab5f42ff166a264891223b7b82 (patch) | |
tree | 134c81ee31299fdaca62dc18dc1ba418ee6b1c0f /nptl/Makefile | |
parent | dabd75b6a1180c2ca6a6f966f08cc00e8e72cce9 (diff) | |
download | glibc-579396ee082565ab5f42ff166a264891223b7b82.tar.gz glibc-579396ee082565ab5f42ff166a264891223b7b82.tar.xz glibc-579396ee082565ab5f42ff166a264891223b7b82.zip |
nptl: Add test for callee-saved register restore in pthread_exit
GCC PR 83641 results in a miscompilation of libpthread, which causes pthread_exit not to restore callee-saved registers before running destructors for objects on the stack. This test detects this situation: info: unsigned int, direct pthread_exit call tst-thread-exit-clobber.cc:80: numeric comparison failure left: 4148288912 (0xf741dd90); from: value right: 1600833940 (0x5f6ac994); from: magic_values.v2 info: double, direct pthread_exit call info: unsigned int, indirect pthread_exit call info: double, indirect pthread_exit call error: 1 test failures
Diffstat (limited to 'nptl/Makefile')
-rw-r--r-- | nptl/Makefile | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nptl/Makefile b/nptl/Makefile index 48b7e4bc9e..7265c0a53c 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -229,6 +229,8 @@ CFLAGS-pt-system.c += -fexceptions LDLIBS-tst-once5 = -lstdc++ CFLAGS-tst-thread_local1.o = -std=gnu++11 LDLIBS-tst-thread_local1 = -lstdc++ +CFLAGS-tst-thread-exit-clobber.o = -std=gnu++11 +LDLIBS-tst-thread-exit-clobber = -lstdc++ tests = tst-attr1 tst-attr2 tst-attr3 tst-default-attr \ tst-mutex1 tst-mutex2 tst-mutex3 tst-mutex4 tst-mutex5 tst-mutex6 \ @@ -304,7 +306,8 @@ tests = tst-attr1 tst-attr2 tst-attr3 tst-default-attr \ c89 gnu89 c99 gnu99 c11 gnu11) \ tst-bad-schedattr \ tst-thread_local1 tst-mutex-errorcheck tst-robust10 \ - tst-robust-fork tst-create-detached tst-memstream + tst-robust-fork tst-create-detached tst-memstream \ + tst-thread-exit-clobber tests-internal := tst-rwlock19 tst-rwlock20 \ tst-sem11 tst-sem12 tst-sem13 \ @@ -458,7 +461,7 @@ tests-unsupported += tst-cancel24 tst-cancel24-static tst-once5 endif # These tests require a C++ compiler and runtime with thread_local support. ifneq ($(have-cxx-thread_local),yes) -tests-unsupported += tst-thread_local1 +tests-unsupported += tst-thread_local1 tst-thread-exit-clobber endif include ../Rules |