URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/gnu-old/gcc-4.2.2/gcc/testsuite/g++.dg/tls
- from Rev 154 to Rev 816
- ↔ Reverse comparison
Rev 154 → Rev 816
/init-1.C
0,0 → 1,14
/* Valid initializations. */ |
/* { dg-require-effective-target tls } */ |
|
__thread int i = 42; |
|
static int j; |
__thread int *p = &j; |
|
/* Note that this is valid in C++ (unlike C) as a run-time initialization. */ |
int *q = &i; |
|
/* Valid because "const int k" is an integral constant expression in C++. */ |
__thread const int k = 42; |
__thread const int l = k; |
init-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: diag-1.C
===================================================================
--- diag-1.C (nonexistent)
+++ diag-1.C (revision 816)
@@ -0,0 +1,31 @@
+// Valid __thread specifiers.
+// { dg-require-effective-target tls }
+
+__thread int g1;
+extern __thread int g2;
+static __thread int g3;
+
+void foo()
+{
+ extern __thread int l1;
+ static __thread int l2;
+}
+
+struct A {
+ static __thread int i;
+};
+
+__thread int A::i = 42;
+
+template struct B {
+ static __thread T t;
+};
+
+template
+__thread T B::t = 42;
+
+void bar ()
+{
+ int j = B::t;
+ int k = B::t;
+}
diag-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: init-2.C
===================================================================
--- init-2.C (nonexistent)
+++ init-2.C (revision 816)
@@ -0,0 +1,14 @@
+/* Invalid initializations. */
+/* { dg-require-effective-target tls } */
+
+extern __thread int i;
+__thread int *p = &i; /* { dg-error "dynamically initialized" } */
+
+extern int f();
+__thread int j = f(); /* { dg-error "dynamically initialized" } */
+
+struct S
+{
+ S();
+};
+__thread S s; /* { dg-error "" } two errors here */
init-2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: diag-2.C
===================================================================
--- diag-2.C (nonexistent)
+++ diag-2.C (revision 816)
@@ -0,0 +1,26 @@
+/* Invalid __thread specifiers. */
+/* { dg-require-effective-target tls } */
+
+__thread extern int g1; /* { dg-error "'__thread' before 'extern'" } */
+__thread static int g2; /* { dg-error "'__thread' before 'static'" } */
+__thread __thread int g3; /* { dg-error "duplicate '__thread'" } */
+typedef __thread int g4; /* { dg-error "multiple storage classes" } */
+
+void foo()
+{
+ __thread int l1; /* { dg-error "implicitly auto and declared '__thread'" } */
+ auto __thread int l2; /* { dg-error "multiple storage classes" } */
+ __thread extern int l3; /* { dg-error "'__thread' before 'extern'" } */
+ register __thread int l4; /* { dg-error "multiple storage classes" } */
+}
+
+__thread void f1 (); /* { dg-error "invalid for function" } */
+extern __thread void f2 (); /* { dg-error "invalid for function" } */
+static __thread void f3 (); /* { dg-error "invalid for function" } */
+__thread void f4 () { } /* { dg-error "invalid for function" } */
+
+void bar(__thread int p1); /* { dg-error "(invalid in parameter)|(specified for parameter)" } */
+
+struct A {
+ __thread int i; /* { dg-error "storage class specified" } */
+};
diag-2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: diag-3.C
===================================================================
--- diag-3.C (nonexistent)
+++ diag-3.C (revision 816)
@@ -0,0 +1,11 @@
+// Report invalid extern and __thread combinations.
+// { dg-require-effective-target tls }
+
+extern int j; // { dg-error "previously declared here" }
+__thread int j; // { dg-error "follows non-thread-local" }
+
+extern __thread int i; // { dg-error "previously declared here" }
+int i; // { dg-error "follows thread-local" }
+
+extern __thread int k; // This is fine.
+__thread int k;
diag-3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: diag-4.C
===================================================================
--- diag-4.C (nonexistent)
+++ diag-4.C (revision 816)
@@ -0,0 +1,10 @@
+/* Invalid __thread specifiers. */
+/* { dg-require-effective-target tls } */
+
+__thread typedef int g4; /* { dg-error "multiple storage classes" } */
+
+void foo()
+{
+ __thread auto int l2; /* { dg-error "multiple storage classes" } */
+ __thread register int l4; /* { dg-error "multiple storage classes" } */
+}
diag-4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static-1.C
===================================================================
--- static-1.C (nonexistent)
+++ static-1.C (revision 816)
@@ -0,0 +1,29 @@
+// { dg-do run }
+// { dg-options "-O2" }
+// { dg-additional-sources "static-1a.cc" }
+// { dg-require-effective-target tls_runtime }
+
+extern "C" void abort ();
+extern int test ();
+
+struct A
+{
+ static __thread int i;
+};
+
+__thread int A::i = 8;
+
+int
+main ()
+{
+ if (A::i != 8)
+ abort ();
+
+ if (test ())
+ abort ();
+
+ if (A::i != 17)
+ abort ();
+
+ return 0;
+}
static-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: diag-5.C
===================================================================
--- diag-5.C (nonexistent)
+++ diag-5.C (revision 816)
@@ -0,0 +1,5 @@
+// PR c++/30536
+// Invalid __thread specifiers.
+// { dg-require-effective-target tls }
+
+struct A { __thread register int i; }; // { dg-error "multiple storage classes|storage class specified" }
diag-5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: static-1a.cc
===================================================================
--- static-1a.cc (nonexistent)
+++ static-1a.cc (revision 816)
@@ -0,0 +1,19 @@
+// { dg-do run }
+// { dg-options "-O2" }
+// { dg-additional-sources "static-1a.cc" }
+// { dg-require-effective-target tls_runtime }
+
+struct A
+{
+ static __thread int i;
+};
+
+int
+test ()
+{
+ if (A::i != 8)
+ return 1;
+
+ A::i = 17;
+ return 0;
+}
Index: trivial.C
===================================================================
--- trivial.C (nonexistent)
+++ trivial.C (revision 816)
@@ -0,0 +1,3 @@
+// { dg-require-effective-target tls }
+
+__thread int i;
trivial.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: tls.exp
===================================================================
--- tls.exp (nonexistent)
+++ tls.exp (revision 816)
@@ -0,0 +1,35 @@
+# Copyright (C) 2002, 2005, 2007 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# .
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib g++-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CXXFLAGS
+if ![info exists DEFAULT_CXXFLAGS] then {
+ set DEFAULT_CXXFLAGS " -ansi -pedantic-errors -Wno-long-long"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C]] "" $DEFAULT_CXXFLAGS
+
+# All done.
+dg-finish