diff options
Diffstat (limited to 'trunk/testsuite')
-rw-r--r-- | trunk/testsuite/Makefile.am | 2 | ||||
-rw-r--r-- | trunk/testsuite/Makefile.in | 2 | ||||
-rwxr-xr-x | trunk/testsuite/cxx1.sh | 7 | ||||
-rw-r--r-- | trunk/testsuite/cxx2.C | 51 | ||||
-rwxr-xr-x | trunk/testsuite/cxx2.sh | 19 |
5 files changed, 76 insertions, 5 deletions
diff --git a/trunk/testsuite/Makefile.am b/trunk/testsuite/Makefile.am index 3af929b..e378e3b 100644 --- a/trunk/testsuite/Makefile.am +++ b/trunk/testsuite/Makefile.am @@ -12,7 +12,7 @@ TESTS = movelibs.sh \ shuffle6.sh shuffle7.sh shuffle8.sh undo1.sh \ layout1.sh layout2.sh \ tls1.sh tls2.sh tls3.sh tls4.sh tls5.sh tls6.sh tls7.sh \ - cxx1.sh quick1.sh quick2.sh quick3.sh cycle1.sh cycle2.sh \ + cxx1.sh cxx2.sh quick1.sh quick2.sh quick3.sh cycle1.sh cycle2.sh \ deps1.sh deps2.sh \ undosyslibs.sh TESTS_ENVIRONMENT = \ diff --git a/trunk/testsuite/Makefile.in b/trunk/testsuite/Makefile.in index 53feb82..8b73262 100644 --- a/trunk/testsuite/Makefile.in +++ b/trunk/testsuite/Makefile.in @@ -107,7 +107,7 @@ TESTS = movelibs.sh \ shuffle6.sh shuffle7.sh shuffle8.sh undo1.sh \ layout1.sh layout2.sh \ tls1.sh tls2.sh tls3.sh tls4.sh tls5.sh tls6.sh tls7.sh \ - cxx1.sh quick1.sh quick2.sh quick3.sh cycle1.sh cycle2.sh \ + cxx1.sh cxx2.sh quick1.sh quick2.sh quick3.sh cycle1.sh cycle2.sh \ deps1.sh deps2.sh \ undosyslibs.sh diff --git a/trunk/testsuite/cxx1.sh b/trunk/testsuite/cxx1.sh index a48cc65..c99f198 100755 --- a/trunk/testsuite/cxx1.sh +++ b/trunk/testsuite/cxx1.sh @@ -11,8 +11,9 @@ savelibs echo $PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx1 > cxx1.log $PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx1 >> cxx1.log 2>&1 || exit 1 grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx1.log | grep -q -v 'C++ conflict' && exit 2 -LD_LIBRARY_PATH=. ./cxx1 || exit 3 -readelf -a ./cxx1 >> cxx1.log 2>&1 || exit 4 +[ $( grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx1.log | grep 'Removing C++ conflict' | wc -l ) -ge 5 ] || exit 3 +LD_LIBRARY_PATH=. ./cxx1 || exit 4 +readelf -a ./cxx1 >> cxx1.log 2>&1 || exit 5 # So that it is not prelinked again chmod -x ./cxx1 -comparelibs >> cxx1.log 2>&1 || exit 5 +comparelibs >> cxx1.log 2>&1 || exit 6 diff --git a/trunk/testsuite/cxx2.C b/trunk/testsuite/cxx2.C new file mode 100644 index 0000000..8b6e0bf --- /dev/null +++ b/trunk/testsuite/cxx2.C @@ -0,0 +1,51 @@ +#include "cxx1.h" +extern "C" void abort (void); + +int A::a () +{ + return 30; +} + +int A::b () +{ + return 31; +} + +int B::a () +{ + return 32; +} + +int C::a () +{ + return 33; +} + +int C::b () +{ + return 34; +} + +void +check (A *x, B *y) +{ + C d; + if (x->b () != 31) + abort (); + if (y->B::a () != 32) + abort (); + if (d.a () != 33) + abort (); + if (d.C::b () != 34) + abort (); +} + +int +main () +{ + A x; + if (x.a () != 30) + abort (); + do_check (check, &x); + return 0; +} diff --git a/trunk/testsuite/cxx2.sh b/trunk/testsuite/cxx2.sh new file mode 100755 index 0000000..edad081 --- /dev/null +++ b/trunk/testsuite/cxx2.sh @@ -0,0 +1,19 @@ +#!/bin/bash +. `dirname $0`/functions.sh +rm -f cxx2 cxx2lib*.so cxx2.log +rm -f prelink.cache +$CXX -shared -O2 -fpic -o cxx2lib1.so $srcdir/cxx1lib1.C +$CXX -shared -O2 -fpic -o cxx2lib2.so $srcdir/cxx1lib2.C cxx2lib1.so +BINS="cxx2" +LIBS="cxx2lib1.so cxx2lib2.so" +$CXXLINK -o cxx2 $srcdir/cxx2.C -Wl,--rpath-link,. cxx2lib2.so +savelibs +echo $PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx2 > cxx2.log +$PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx2 >> cxx2.log 2>&1 || exit 1 +grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx2.log | grep -q -v 'C++ conflict' && exit 2 +[ $( grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx2.log | grep 'Removing C++ conflict' | wc -l ) -ge 9 ] || exit 3 +LD_LIBRARY_PATH=. ./cxx2 || exit 4 +readelf -a ./cxx2 >> cxx2.log 2>&1 || exit 5 +# So that it is not prelinked again +chmod -x ./cxx2 +comparelibs >> cxx2.log 2>&1 || exit 6 |