summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-06 14:25:58 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-06 14:25:58 +0000
commitaa814961282689bad3a81d224fb39c23efd873b3 (patch)
treee4acc2d419bc6b1800905e4bca5b7271fa23812a /gcc/testsuite
parent1db7b8a843e41f8e4858fbbdaac698e9f4ea371e (diff)
downloadgcc-aa814961282689bad3a81d224fb39c23efd873b3.tar.gz
Add testcases for PRs 47766/47715.
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177511 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog11
-rw-r--r--gcc/testsuite/gcc.dg/pr47766.c13
-rw-r--r--gcc/testsuite/gcc.dg/tls/pr47715-1.c11
-rw-r--r--gcc/testsuite/gcc.dg/tls/pr47715-2.c10
-rw-r--r--gcc/testsuite/gcc.dg/tls/pr47715-3.c18
-rw-r--r--gcc/testsuite/gcc.dg/tls/pr47715-4.c24
6 files changed, 87 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3b004cf4f60..68d470adcbc 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/gcc.dg/pr47766.c b/gcc/testsuite/gcc.dg/pr47766.c
new file mode 100644
index 00000000000..50e2feebadb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr47766.c
@@ -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;
+}
diff --git a/gcc/testsuite/gcc.dg/tls/pr47715-1.c b/gcc/testsuite/gcc.dg/tls/pr47715-1.c
new file mode 100644
index 00000000000..ef8c5394a90
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/pr47715-1.c
@@ -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;
+}
diff --git a/gcc/testsuite/gcc.dg/tls/pr47715-2.c b/gcc/testsuite/gcc.dg/tls/pr47715-2.c
new file mode 100644
index 00000000000..d11239548f6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/pr47715-2.c
@@ -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;
+}
diff --git a/gcc/testsuite/gcc.dg/tls/pr47715-3.c b/gcc/testsuite/gcc.dg/tls/pr47715-3.c
new file mode 100644
index 00000000000..ba2003c7c22
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/pr47715-3.c
@@ -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);
+}
diff --git a/gcc/testsuite/gcc.dg/tls/pr47715-4.c b/gcc/testsuite/gcc.dg/tls/pr47715-4.c
new file mode 100644
index 00000000000..980d7e985df
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/pr47715-4.c
@@ -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;
+}