#!/bin/sh
# Copyright (c) 2001 by Sun Microsystems, Inc.
# All rights reserved.

PATH="`pwd`/..:$PATH"; export PATH

errs=0

pass() {
	echo "$0: passed: $name" 1>&2
}

fail() {
	echo "$0: failed: $name" 1>&2
	errs=`expr $errs + 1`
}

############################################################################
# libc_a:

name="libc.a static link test on libc_a"
if abicheck ./libc_a 2>/dev/null | grep 'STATIC_LINK:.*libc' > /dev/null; then
	pass
else
	fail
fi

############################################################################
# public1:

name="public1: only calls public syms"
if [ "`abicheck ./public1 2>/dev/null`" = "./public1: OK" ]; then
	pass
else
	fail
fi

############################################################################
# private1:

name="private1: calls private sym in libc"
if abicheck ./private1 2>/dev/null | egrep 'PRIVATE:.*libc.*(__open|__nanosleep)' > /dev/null; then
	pass
else
	fail
fi

exit $errs
