OSDN Git Service

2004-07-20 H.J. Lu <hongjiu.lu@intel.com>
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Jul 2004 02:35:55 +0000 (02:35 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Jul 2004 02:35:55 +0000 (02:35 +0000)
PR target/16559
* gcc.dg/ia64-fptr-1.c: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84995 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ia64-fptr-1.c [new file with mode: 0644]

index eb1a341..424bfd8 100644 (file)
@@ -1,3 +1,8 @@
+2004-07-20  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/16559
+       * gcc.dg/ia64-fptr-1.c: New file.
+
 2004-07-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
 
        PR c++/14497
diff --git a/gcc/testsuite/gcc.dg/ia64-fptr-1.c b/gcc/testsuite/gcc.dg/ia64-fptr-1.c
new file mode 100644 (file)
index 0000000..bb11066
--- /dev/null
@@ -0,0 +1,37 @@
+/* { dg-do run { target ia64-*-* } } */
+/* { dg-options "-O2" } */
+
+/* Test function descriptor access.  */
+
+extern unsigned long *_GLOBAL_OFFSET_TABLE_;
+extern void abort(void);
+
+struct ia64_fdesc
+{
+  unsigned long func;
+  unsigned long gp;
+};
+
+void
+os_boot_rendez (void)
+{
+}
+
+static int
+check (unsigned long gp)
+{
+  return gp != (unsigned long) &_GLOBAL_OFFSET_TABLE_;
+}
+
+int
+main (int argc, char **argv)
+{
+  int i;
+  int res = 0;
+
+  for (i = 0; i < 1; i++)
+    res += check (((struct ia64_fdesc *) os_boot_rendez)->gp);
+  if (res)
+    abort ();
+  return res;
+}