run.sh 845 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. # Copyright 2019-2022 Yury Gribov
  3. #
  4. # The MIT License (MIT)
  5. #
  6. # Use of this source code is governed by MIT license that can be
  7. # found in the LICENSE.txt file.
  8. # This test checks that exceptions are successfully propagated
  9. # through implib wrappers.
  10. set -eu
  11. cd $(dirname $0)
  12. if test -n "${1:-}"; then
  13. ARCH="$1"
  14. fi
  15. . ../common.sh
  16. export LD_LIBRARY_PATH=.:${LD_LIBRARY_PATH:-}
  17. $CXX $CFLAGS -shared -fPIC interposed.cpp -o libinterposed.so
  18. $CXX $CFLAGS main.cpp -L. -linterposed
  19. $INTERP ./a.out 2>&1 | tee ref.log
  20. ${PYTHON:-} ../../implib-gen.py -q --target $TARGET --vtables libinterposed.so
  21. $CXX $CFLAGS -Wno-deprecated main.cpp libinterposed.so.tramp.S libinterposed.so.init.c $LIBS
  22. $INTERP ./a.out 2>&1 | tee new.log
  23. if ! diff ref.log new.log; then
  24. echo "Vtable interception in implibs fails"
  25. exit 1
  26. fi
  27. echo SUCCESS