OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/tags/gnu-dev/fsf-gcc-snapshot-1-mar-12/or1k-gcc/gcc/testsuite/g++.dg/tls
    from Rev 693 to Rev 783
    Reverse comparison

Rev 693 → Rev 783

/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;
/diag-1.C
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 <typename T> struct B {
static __thread T t;
};
 
template <typename T>
__thread T B<T>::t = 42;
 
void bar ()
{
int j = B<int>::t;
int k = B<const int>::t;
}
/init-2.C
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 */
/diag-2.C
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|data types" } */
__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-3.C
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;
/static-1.C
0,0 → 1,30
// { dg-do run }
// { dg-options "-O2" }
// { dg-require-effective-target tls_runtime }
// { dg-add-options tls }
// { dg-additional-sources "static-1a.cc" }
 
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;
}
/diag-4.C
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|data types" } */
__thread register int l4; /* { dg-error "multiple storage classes" } */
}
/diag-5.C
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" }
/static-1a.cc
0,0 → 1,20
// { dg-do run }
// { dg-options "-O2" }
// { dg-require-effective-target tls_runtime }
// { dg-add-options tls }
// { dg-additional-sources "static-1a.cc" }
 
struct A
{
static __thread int i;
};
 
int
test ()
{
if (A::i != 8)
return 1;
 
A::i = 17;
return 0;
}
/trivial.C
0,0 → 1,3
// { dg-require-effective-target tls }
 
__thread int i;
/tls.exp
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
# <http://www.gnu.org/licenses/>.
 
# 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 " -pedantic-errors -Wno-long-long"
}
 
# Initialize `dg'.
dg-init
 
# Main loop.
g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C]] $DEFAULT_CXXFLAGS
 
# All done.
dg-finish

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.