Fix bugs in powerpc pthread_once.
[glibc.git] / nptl / tst-tls6.sh
blob2622e3385918fbadb9eac0064f230771b2258753
1 #! /bin/sh
2 # A tls test.
3 # Copyright (C) 2003-2012 Free Software Foundation, Inc.
4 # This file is part of the GNU C Library.
6 # The GNU C Library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
11 # The GNU C Library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with the GNU C Library; if not, see
18 # <http://www.gnu.org/licenses/>.
20 set -e
22 common_objpfx=$1; shift
23 elf_objpfx=$1; shift
24 rtld_installed_name=$1; shift
25 logfile=$common_objpfx/nptl/tst-tls6.out
27 # We have to find libc and nptl
28 library_path=${common_objpfx}:${common_objpfx}nptl
29 tst_tls5="${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
30 ${common_objpfx}/nptl/tst-tls5"
32 LC_ALL=C
33 export LC_ALL
34 LANG=C
35 export LANG
37 > $logfile
38 fail=0
40 for aligned in a e f; do
41 echo "preload tst-tls5mod{$aligned,b,c,d}.so" >> $logfile
42 echo "===============" >> $logfile
43 LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{$aligned,b,c,d}.so \
44 | sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
45 echo >> $logfile
47 echo "preload tst-tls5mod{b,$aligned,c,d}.so" >> $logfile
48 echo "===============" >> $logfile
49 LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{b,$aligned,c,d}.so \
50 | sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
51 echo >> $logfile
53 echo "preload tst-tls5mod{b,c,d,$aligned}.so" >> $logfile
54 echo "===============" >> $logfile
55 LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{b,c,d,$aligned}.so \
56 | sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
57 echo >> $logfile
58 done
60 echo "preload tst-tls5mod{d,a,b,c,e}" >> $logfile
61 echo "===============" >> $logfile
62 LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,c,e}.so \
63 | sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
64 echo >> $logfile
66 echo "preload tst-tls5mod{d,a,b,e,f}" >> $logfile
67 echo "===============" >> $logfile
68 LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,e,f}.so \
69 | sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
70 echo >> $logfile
72 exit $fail