Commit 7c72138a by Tom Tromey Committed by Tom Tromey

regress-demangle: New file.

	* testsuite/regress-demangle: New file.
	* testsuite/demangle-expected: New file.
	* Makefile.in (all, check, installcheck, info, install-info,
	clean-info, dvi, install, etags, tags, mostlyclean, clean,
	distclean, maintainer-clean, realclean): Depend on corresponding
	`-subdir' target.
	(all-subdir check-subdir installcheck-subdir info-subdir
	install-info-subdir clean-info-subdir dvi-subdir
	install-info-subdir etags-subdir mostlyclean-subdir clean-subdir
	distclean-subdir maintainer-clean-subdir): New target.
	* testsuite/Makefile.in: New file.
	* configure: Rebuilt.
	* configure.in: Create testsuite/Makefile.

From-SVN: r26205
parent 4f65832d
1999-04-05 Tom Tromey <tromey@cygnus.com>
* testsuite/regress-demangle: New file.
* testsuite/demangle-expected: New file.
* Makefile.in (all, check, installcheck, info, install-info,
clean-info, dvi, install, etags, tags, mostlyclean, clean,
distclean, maintainer-clean, realclean): Depend on corresponding
`-subdir' target.
(all-subdir check-subdir installcheck-subdir info-subdir
install-info-subdir clean-info-subdir dvi-subdir
install-info-subdir etags-subdir mostlyclean-subdir clean-subdir
distclean-subdir maintainer-clean-subdir): New target.
* testsuite/Makefile.in: New file.
* configure: Rebuilt.
* configure.in: Create testsuite/Makefile.
1999-04-02 Mark Mitchell <mark@codesourcery.com> 1999-04-02 Mark Mitchell <mark@codesourcery.com>
* splay-tree.h (splay_tree_compare_pointers): Define. * splay-tree.h (splay_tree_compare_pointers): Define.
......
# #
# Makefile # Makefile
# Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998 # Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
# Free Software Foundation # Free Software Foundation
# #
# This file is part of the libiberty library. # This file is part of the libiberty library.
...@@ -87,11 +87,12 @@ FLAGS_TO_PASS = \ ...@@ -87,11 +87,12 @@ FLAGS_TO_PASS = \
"RANLIB=$(RANLIB)" \ "RANLIB=$(RANLIB)" \
"SHELL=$(SHELL)" "SHELL=$(SHELL)"
all: stamp-picdir $(TARGETLIB) needed-list required-list all: stamp-picdir $(TARGETLIB) needed-list required-list all-subdir
@$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
.PHONY: check installcheck .PHONY: check installcheck
check installcheck: check: check-subdir
installcheck: installcheck-subdir
@host_makefile_frag@ @host_makefile_frag@
...@@ -103,7 +104,10 @@ COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES) ...@@ -103,7 +104,10 @@ COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES)
$(COMPILE.c) $(PICFLAG) $< -o pic/$@ $(COMPILE.c) $(PICFLAG) $< -o pic/$@
$(COMPILE.c) $< $(COMPILE.c) $<
info install-info clean-info dvi: info: info-subdir
install-info: install-info-subdir
clean-info: clean-info-subdir
dvi: dvi-subdir
# Include files that are in this directory. # Include files that are in this directory.
HFILES = alloca-conf.h HFILES = alloca-conf.h
...@@ -136,7 +140,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA) ...@@ -136,7 +140,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA)
$(RANLIB) $(TARGETLIB) $(RANLIB) $(TARGETLIB)
INSTALL_DEST = @INSTALL_DEST@ INSTALL_DEST = @INSTALL_DEST@
install: install_to_$(INSTALL_DEST) install: install_to_$(INSTALL_DEST) install-subdir
install_to_libdir: all install_to_libdir: all
$(INSTALL_DATA) $(TARGETLIB) $(libdir)$(MULTISUBDIR)/$(TARGETLIB).n $(INSTALL_DATA) $(TARGETLIB) $(libdir)$(MULTISUBDIR)/$(TARGETLIB).n
...@@ -171,7 +175,7 @@ stamp-picdir: ...@@ -171,7 +175,7 @@ stamp-picdir:
.PHONY: all etags tags ls clean stage1 stage2 .PHONY: all etags tags ls clean stage1 stage2
etags tags: TAGS etags tags: TAGS etags-subdir
TAGS: $(CFILES) $(HFILES) TAGS: $(CFILES) $(HFILES)
etags `for i in $(HFILES) $(CFILES); do echo $(srcdir)/$$i ; done` etags `for i in $(HFILES) $(CFILES); do echo $(srcdir)/$$i ; done`
...@@ -187,19 +191,19 @@ ls: ...@@ -187,19 +191,19 @@ ls:
# Need to deal with profiled libraries, too. # Need to deal with profiled libraries, too.
mostlyclean: mostlyclean: mostlyclean-subdir
rm -rf *.o pic core errs \#* *.E a.out rm -rf *.o pic core errs \#* *.E a.out
rm -f needed.awk needed2.awk errors dummy needed-list config.h stamp-* rm -f needed.awk needed2.awk errors dummy needed-list config.h stamp-*
rm -f $(CONFIG_H) $(NEEDED_LIST) stamp-picdir rm -f $(CONFIG_H) $(NEEDED_LIST) stamp-picdir
@$(MULTICLEAN) multi-clean DO=mostlyclean @$(MULTICLEAN) multi-clean DO=mostlyclean
clean: mostlyclean clean: mostlyclean clean-subdir
rm -f *.a required-list tmpmulti.out rm -f *.a required-list tmpmulti.out
@$(MULTICLEAN) multi-clean DO=clean @$(MULTICLEAN) multi-clean DO=clean
distclean: clean distclean: clean distclean-subdir
@$(MULTICLEAN) multi-clean DO=distclean @$(MULTICLEAN) multi-clean DO=distclean
rm -f *~ Makefile config.status xhost-mkfrag TAGS multilib.out rm -f *~ Makefile config.status xhost-mkfrag TAGS multilib.out
rm -f config.log rm -f config.log
maintainer-clean realclean: distclean maintainer-clean realclean: distclean maintainer-clean-subdir
force: force:
...@@ -213,6 +217,14 @@ stamp-h: config.in config.status ...@@ -213,6 +217,14 @@ stamp-h: config.in config.status
config.status: $(srcdir)/configure $(srcdir)/config.table config.status: $(srcdir)/configure $(srcdir)/config.table
$(SHELL) ./config.status --recheck $(SHELL) ./config.status --recheck
all-subdir check-subdir installcheck-subdir info-subdir \
install-info-subdir clean-info-subdir dvi-subdir install-subdir \
etags-subdir mostlyclean-subdir clean-subdir distclean-subdir \
maintainer-clean-subdir:
@target=`echo $@ | sed -e 's/-subdir//'`; \
cd testsuite && $(MAKE) $$target
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA): stamp-picdir $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA): stamp-picdir
alloca.o: config.h alloca.o: config.h
......
...@@ -176,6 +176,7 @@ fi ...@@ -176,6 +176,7 @@ fi
# if the host does not provide alloca, we set ALLOCA to alloca.o # if the host does not provide alloca, we set ALLOCA to alloca.o
setobjs= setobjs=
CHECK=
if test -n "${with_target_subdir}"; then if test -n "${with_target_subdir}"; then
# We are being configured as a target library. AC_REPLACE_FUNCS # We are being configured as a target library. AC_REPLACE_FUNCS
...@@ -210,8 +211,16 @@ if test -n "${with_target_subdir}"; then ...@@ -210,8 +211,16 @@ if test -n "${with_target_subdir}"; then
setobjs=yes setobjs=yes
fi fi
else
# Not a target library, so we set things up to run the test suite.
CHECK=check-cplus-dem
fi fi
AC_SUBST(CHECK)
if test -z "${setobjs}"; then if test -z "${setobjs}"; then
case "${host}" in case "${host}" in
...@@ -321,7 +330,7 @@ fi ...@@ -321,7 +330,7 @@ fi
AC_SUBST(INSTALL_DEST) AC_SUBST(INSTALL_DEST)
# We need multilib support, but only if configuring for the target. # We need multilib support, but only if configuring for the target.
AC_OUTPUT(Makefile, AC_OUTPUT(Makefile testsuite/Makefile,
[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
if test -n "$CONFIG_FILES"; then if test -n "$CONFIG_FILES"; then
if test -n "${with_target_subdir}"; then if test -n "${with_target_subdir}"; then
......
#
# Makefile
# Copyright (C) 1999
# Free Software Foundation
#
# This file is part of the libiberty library.
# Libiberty is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# Libiberty is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with libiberty; see the file COPYING.LIB. If not,
# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# This file was written by Tom Tromey <tromey@cygnus.com>.
#
# Makefile for libiberty/testsuite directory
#
srcdir = @srcdir@
VPATH = @srcdir@
SHELL = @SHELL@
CC = @CC@
CFLAGS = @CFLAGS@
LIBCFLAGS = $(CFLAGS)
# Multilib support variables.
MULTISRCTOP =
INCDIR=$(srcdir)/../$(MULTISRCTOP)../include
all:
check: @CHECK@
# Run some tests of the demangler.
check-cplus-dem: test-filter $(srcdir)/demangle-expected
$(SHELL) $(srcdir)/regress-demangle $(srcdir)/demangle-expected
# Note that we just hard-code prepends_underscore to 0. This doesn't
# matter since any particular test can override the default if need
# be.
TEST_COMPILE = $(CC) @DEFS@ $(LIBCFLAGS) -I.. -I$(INCDIR) $(HDEFINES)
test-filter: $(srcdir)/../cplus-dem.c
echo 'int prepends_underscore = 0;' > test-us.c
$(TEST_COMPILE) -o test-filter -DMAIN -DVERSION='"none"' @DEFS@ \
$(srcdir)/../cplus-dem.c test-us.c -L.. -liberty
# Standard (either GNU or Cygnus) rules we don't use.
info install-info clean-info dvi install etags tags installcheck:
# The standard clean rules.
mostlyclean:
rm -f test-us.c test-filter
clean: mostlyclean
distclean: clean
rm -f Makefile
maintainer-clean realclean: distclean
Makefile: $(srcdir)/Makefile.in ../config.status
CONFIG_FILES=testsuite/Makefile CONFIG_HEADERS= \
cd .. && $(SHELL) ./config.status
#! /bin/sh
# Run a regression test for the demangler.
# Usage: regress-demangle TEST-FILE
failures=0
count=0
sed -e '/^#/ d' "$1" | (
while read type; do
read mangled
read demangled
x="`echo $mangled | ./test-filter $type`"
count=`expr $count + 1`
if test "x$x" != "x$demangled"; then
failures=`expr $failures + 1`
echo "FAIL: $type $mangled"
fi
done
if test $failures -eq 0; then
echo "All $count tests passed"
else
echo "$failures of $count tests failed"
fi
test $failures -eq 0
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment