run.sh 542 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. # Copyright 2023 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. set -eu
  9. set -x
  10. cd $(dirname $0)
  11. if test -n "${1:-}"; then
  12. ARCH="$1"
  13. fi
  14. . ../common.sh
  15. for i in `seq 0 8192`; do
  16. echo "int foo$i() { return $i; }"
  17. done > test.c
  18. $CC $CFLAGS -shared -fPIC test.c -o libtest.so
  19. ${PYTHON:-} ../../implib-gen.py -q --target $TARGET libtest.so
  20. $CC $CFLAGS libtest.so.* main.c -ldl
  21. LD_LIBRARY_PATH=.:${LD_LIBRARY_PATH:-} $INTERP ./a.out