#! /bin/bash
#
echo "create reachable.cpp"
cat << EOF > reachable.cpp
# include <iostream>
# include <vector>
# include <cppad/cppad.hpp>

# define SHOW_ERROR 1

int main (int argc, char *argv[])
{
  CppAD::vector< CppAD::AD<double> > x(2);
  x.resize(0);

  // vagrind will generate an error message about a reachable block of memory.
  // The intention is that, when no multi-threading is done, the user should
  // note have to worry about the CppAD::thread_alloc memory allocator; i.e.,
  // this should not be necessary.
# if ! SHOW_ERROR
  CppAD::thread_alloc::free_available(0);
# endif

  return 0;
}
EOF
#
echo "g++ -g -I $HOME/prefix/cppad/include reachable.cpp -o reachable"
g++ -g -I $HOME/prefix/cppad/include reachable.cpp -o reachable
#
echo "valgrind --leak-check=full --show-reachable=yes ./reachable"
valgrind --leak-check=full --show-reachable=yes ./reachable


Add script for a new bug
Add script for a new bug

git-svn-id: 3f5418f4deb1796ec361794c2e3ca0aec3c9c1fd@2297 0e562018-b8fb-0310-a933-ecf073c7c197
