Add a test for PR target/63527
authorH.J. Lu <hongjiu.lu@intel.com>
Tue, 25 Nov 2014 20:54:16 +0000 (20:54 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Tue, 25 Nov 2014 20:54:16 +0000 (12:54 -0800)
PR target/63527
* gcc.target/i386/pr63527.c: New test.

From-SVN: r218061

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr63527.c [new file with mode: 0644]

index 9dc2269427a385b86dde295b149d4fe91f2fed23..1c17f23af0708d76d5f98cb2d78f1651bd7da219 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/63527
+       * gcc.target/i386/pr63527.c: New test.
+
 2014-11-25  Martin Liska  <mliska@suse.cz>
 
        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 (file)
index 0000000..169bc08
--- /dev/null
@@ -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" } } */