re PR target/27758 (-O0 -fpic link failure)
authorJakub Jelinek <jakub@redhat.com>
Fri, 26 May 2006 14:19:16 +0000 (16:19 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 26 May 2006 14:19:16 +0000 (16:19 +0200)
PR target/27758
* gcc.dg/pr27758.c: New test.

From-SVN: r114133

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr27758.c [new file with mode: 0644]

index 320143915b36fb95c84c8ab5d1c295f8088849cd..30b650d68894ec5e2c68378949cc0cb5299ff4b6 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/27758
+       * gcc.dg/pr27758.c: New test.
+
 2006-05-24  Falk Hueffner  <falk@debian.org>
 
        * gcc.c-torture/compile/pr27571.c: New test.
diff --git a/gcc/testsuite/gcc.dg/pr27758.c b/gcc/testsuite/gcc.dg/pr27758.c
new file mode 100644 (file)
index 0000000..d385fc5
--- /dev/null
@@ -0,0 +1,24 @@
+/* PR target/27758 */
+/* { dg-do run { target fpic } } */
+/* { dg-options "-O0 -fpic" } */
+
+typedef int (*fn) (void);
+
+static inline int
+foo (void)
+{
+  return 1;
+}
+   
+fn
+test (void)
+{
+  return foo;
+}
+
+int
+main (void)
+{
+  fn f = test ();
+  return f () != 1;
+}