mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-20 14:39:29 +08:00
tls.exp, [...]: New directory and files.
* gcc.dg/tls/tls.exp, gcc.dg/tls/trivial.c, gcc.dg/tls/diag-1.c, gcc.dg/tls/diag-2.c, gcc.dg/tls/init-1.c: New directory and files. From-SVN: r53716
This commit is contained in:
parent
3d78f2e96e
commit
ec221d715c
@ -1,3 +1,8 @@
|
||||
2002-05-21 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* gcc.dg/tls/tls.exp, gcc.dg/tls/trivial.c, gcc.dg/tls/diag-1.c,
|
||||
gcc.dg/tls/diag-2.c, gcc.dg/tls/init-1.c: New directory and files.
|
||||
|
||||
Tue May 21 14:25:32 2002 Brian R. Gaeke <brg@dgate.ORG>
|
||||
|
||||
* g++.dg/other/copy2.C: New test.
|
||||
|
11
gcc/testsuite/gcc.dg/tls/diag-1.c
Normal file
11
gcc/testsuite/gcc.dg/tls/diag-1.c
Normal file
@ -0,0 +1,11 @@
|
||||
/* Valid __thread specifiers. */
|
||||
|
||||
__thread int g1;
|
||||
extern __thread int g2;
|
||||
static __thread int g3;
|
||||
|
||||
void foo()
|
||||
{
|
||||
extern __thread int l1;
|
||||
static __thread int l2;
|
||||
}
|
21
gcc/testsuite/gcc.dg/tls/diag-2.c
Normal file
21
gcc/testsuite/gcc.dg/tls/diag-2.c
Normal file
@ -0,0 +1,21 @@
|
||||
/* Invalid __thread specifiers. */
|
||||
|
||||
__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 storage class for function" } */
|
||||
extern __thread void f2 (); /* { dg-error "invalid storage class for function" } */
|
||||
static __thread void f3 (); /* { dg-error "invalid storage class for function" } */
|
||||
__thread void f4 () { } /* { dg-error "function definition declared `__thread'" } */
|
||||
|
||||
void bar(__thread int p1); /* { dg-error "storage class specified for parameter" } */
|
4
gcc/testsuite/gcc.dg/tls/init-1.c
Normal file
4
gcc/testsuite/gcc.dg/tls/init-1.c
Normal file
@ -0,0 +1,4 @@
|
||||
/* Invalid initializations. */
|
||||
|
||||
extern __thread int i;
|
||||
int *p = &i; /* { dg-error "initializer element is not constant" } */
|
45
gcc/testsuite/gcc.dg/tls/tls.exp
Normal file
45
gcc/testsuite/gcc.dg/tls/tls.exp
Normal file
@ -0,0 +1,45 @@
|
||||
# Copyright (C) 2002 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 2 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 this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# GCC testsuite that uses the `dg.exp' driver.
|
||||
|
||||
# Load support procs.
|
||||
load_lib gcc-dg.exp
|
||||
|
||||
# Test for thread-local data supported by the platform. If it
|
||||
# isn't, everything will fail with the "not supported" message.
|
||||
|
||||
set comp_output [gcc_target_compile \
|
||||
"$srcdir/$subdir/trivial.c" "trivial.S" assembly ""]
|
||||
if { [string match "*not supported*" $comp_output] } {
|
||||
return 0
|
||||
}
|
||||
|
||||
# If a testcase doesn't have special options, use these.
|
||||
global DEFAULT_CFLAGS
|
||||
if ![info exists DEFAULT_CFLAGS] then {
|
||||
set DEFAULT_CFLAGS " -ansi -pedantic-errors"
|
||||
}
|
||||
|
||||
# Initialize `dg'.
|
||||
dg-init
|
||||
|
||||
# Main loop.
|
||||
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
|
||||
"" $DEFAULT_CFLAGS
|
||||
|
||||
# All done.
|
||||
dg-finish
|
1
gcc/testsuite/gcc.dg/tls/trivial.c
Normal file
1
gcc/testsuite/gcc.dg/tls/trivial.c
Normal file
@ -0,0 +1 @@
|
||||
__thread int i;
|
Loading…
Reference in New Issue
Block a user