packaging: changed asan macro check for "bad %if condition"
[platform/upstream/prelink.git] / testsuite / ifunc3.sh
1 #!/bin/bash
2 . `dirname $0`/functions.sh
3 # First check if __thread is supported by ld.so/gcc/ld/as:
4 $CCLINK -o ifunctest $srcdir/ifunctest.c -Wl,--rpath-link,. > /dev/null 2>&1 || exit 77
5 ( ./ifunctest || { rm -f ifunctest; exit 77; } ) 2>/dev/null || exit 77
6 rm -f ifunctest ifunc3 ifunc3lib*.so ifunc3.log
7 rm -f prelink.cache
8 $CC -shared -O2 -fpic -o ifunc3lib1.so $srcdir/ifunc3lib1.c
9 $CC -shared -O2 -fpic -o ifunc3lib2.so $srcdir/ifunc1lib2.c ifunc3lib1.so
10 BINS="ifunc3"
11 LIBS="ifunc3lib1.so ifunc3lib2.so"
12 $CCLINK -o ifunc3 $srcdir/ifunc3.c -Wl,--rpath-link,. ifunc3lib2.so -lc ifunc3lib1.so
13 savelibs
14 echo $PRELINK ${PRELINK_OPTS--vm} ./ifunc3 >> ifunc3.log
15 $PRELINK ${PRELINK_OPTS--vm} ./ifunc3 >> ifunc3.log 2>&1 || exit 1
16 grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` ifunc3.log && exit 2
17 LD_LIBRARY_PATH=. ./ifunc3 || exit 3
18 readelf -a ./ifunc3 >> ifunc3.log 2>&1 || exit 4
19 # So that it is not prelinked again
20 chmod -x ./ifunc3
21 comparelibs >> ifunc3.log 2>&1 || exit 5