summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tls/struct-1.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-09-20 20:03:40 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-09-20 20:03:40 +0000
commit2db7f8d113db10e3c5fe9ab7b98a9a929e376f8e (patch)
tree40b72a7d0c6f2634ba60c1c20e259c5ab881bd79 /gcc/testsuite/gcc.dg/tls/struct-1.c
parentdbb7d6f7169c9b258895092bac266bb96c554774 (diff)
downloadgcc-2db7f8d113db10e3c5fe9ab7b98a9a929e376f8e.tar.gz
* gcc.dg/tls/struct-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57367 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/tls/struct-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/tls/struct-1.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tls/struct-1.c b/gcc/testsuite/gcc.dg/tls/struct-1.c
new file mode 100644
index 00000000000..11151236d90
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/struct-1.c
@@ -0,0 +1,32 @@
+/* This testcase ICEd on IA-32 because the backend was inconsistent whether
+ to allow addends for @dtpoff relocs or not. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fpic" } */
+
+struct S {
+ int s0, s1, s2, s3;
+};
+static __thread struct S x;
+extern void abort (void);
+extern void exit (int);
+
+void
+foo (struct S *s)
+{
+ s->s2 = 231;
+}
+
+void
+bar (void)
+{
+ if (x.s0 == 231 || x.s2 != 231)
+ abort ();
+}
+
+int
+main ()
+{
+ foo (&x);
+ bar ();
+ exit (0);
+}