From 55026b4cf9d64457cbddf4c57867add3df71f17a Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 25 Nov 2014 20:54:16 +0000 Subject: [PATCH] Add a test for PR target/63527 PR target/63527 * gcc.target/i386/pr63527.c: New test. From-SVN: r218061 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr63527.c | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/pr63527.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9dc2269427a..1c17f23af07 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-11-25 H.J. Lu + + PR target/63527 + * gcc.target/i386/pr63527.c: New test. + 2014-11-25 Martin Liska PR bootstrap/64050 diff --git a/gcc/testsuite/gcc.target/i386/pr63527.c b/gcc/testsuite/gcc.target/i386/pr63527.c new file mode 100644 index 00000000000..169bc0859f6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr63527.c @@ -0,0 +1,25 @@ +/* PR rtl-optimization/pr63527 */ +/* { dg-do compile { target { ia32 && fpic } } } */ +/* { dg-options "-O2 -fPIC" } */ + +struct cache_file +{ + char magic[sizeof "ld.so-1.7.0" - 1]; + unsigned int nlibs; +}; +typedef unsigned int size_t; +size_t cachesize __attribute__ ((visibility ("hidden"))); +struct cache_file *cache __attribute__ ((visibility ("hidden"))); +extern int __munmap (void *__addr, size_t __len); +void +_dl_unload_cache (void) +{ + if (cache != ((void *)0) && cache != (struct cache_file *) -1) + { + __munmap (cache, cachesize); + cache = ((void *)0) ; + } +} + +/* We shouldn't load EBX again. */ +/* { dg-final { scan-assembler-not "movl\[ \t\]%\[^,\]+, %ebx" } } */ -- 2.30.2