public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH: Add testcases for PRs 47766/47715
@ 2011-08-06 14:37 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2011-08-06 14:37 UTC (permalink / raw)
  To: gcc-patches

Hi,

I checked in this patch to add testcases for PRs 47766/47715.


H.J.
---
Index: gcc.dg/pr47766.c
===================================================================
--- gcc.dg/pr47766.c	(revision 0)
+++ gcc.dg/pr47766.c	(revision 0)
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fstack-protector" } */
+/* { dg-require-effective-target fstack_protector } */
+
+int
+parse_opt (int key)
+{
+   struct
+   {
+     int arg[key];
+   } reqdata;
+  return 0;
+}
Index: gcc.dg/tls/pr47715-1.c
===================================================================
--- gcc.dg/tls/pr47715-1.c	(revision 0)
+++ gcc.dg/tls/pr47715-1.c	(revision 0)
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC" } */
+/* { dg-require-effective-target tls } */
+
+extern __thread int h_errno;
+int *
+__h_errno_location (void)
+{
+  return &h_errno;
+}
Index: gcc.dg/tls/pr47715-2.c
===================================================================
--- gcc.dg/tls/pr47715-2.c	(revision 0)
+++ gcc.dg/tls/pr47715-2.c	(revision 0)
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC" } */
+/* { dg-require-effective-target tls } */
+
+extern __thread int *__libc_resp;
+int
+__res_init(void) {
+  return *__libc_resp;
+}
Index: gcc.dg/tls/pr47715-3.c
===================================================================
--- gcc.dg/tls/pr47715-3.c	(revision 0)
+++ gcc.dg/tls/pr47715-3.c	(revision 0)
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC" } */
+/* { dg-require-effective-target tls } */
+
+struct initial_sp
+{
+  void *sp;
+  long len;
+};
+__thread 
+struct initial_sp __morestack_initial_sp;
+void bar (void *);
+void
+foo ()
+{
+  bar (&__morestack_initial_sp.len);
+}
Index: gcc.dg/tls/pr47715-4.c
===================================================================
--- gcc.dg/tls/pr47715-4.c	(revision 0)
+++ gcc.dg/tls/pr47715-4.c	(revision 0)
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+/* { dg-require-effective-target tls } */
+
+struct gomp_team_state
+{
+  struct gomp_team_state *prev_ts;
+  unsigned team_id;
+  unsigned level;
+};
+struct gomp_thread
+{
+  void *data;
+  struct gomp_team_state ts;
+};
+extern __thread struct gomp_thread gomp_tls_data;
+int
+foo (int level)
+{
+  struct gomp_team_state *ts = &gomp_tls_data.ts;
+  if (level < 0 || level > ts->level)
+    return -1;
+  return ts->team_id;
+}
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 177510)
+++ ChangeLog	(working copy)
@@ -1,3 +1,14 @@
+2011-08-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR target/47766
+	* gcc.dg/pr47766.c: New.
+
+	PR target/47715
+	* gcc.dg/tls/pr47715-1.c: New.
+	* gcc.dg/tls/pr47715-2.c: Likewise.
+	* gcc.dg/tls/pr47715-3.c: Likewise.
+	* gcc.dg/tls/pr47715-4.c: Likewise.
+
 2011-08-06  Nicola Pero  <nicola.pero@meta-innovation.com>
 
 	PR libobjc/50002

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-06 14:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-06 14:37 PATCH: Add testcases for PRs 47766/47715 H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).