* Makefile.in: Bunch of fixes so it actually works in this

directory.  (E.g. add extra ../ where needed.)
	Also, add .exe to executables, so we can use suffix rules.
	* chexp.exp (test_print_reject):  Update syntax error message.
	* chillvars.ch (module PR_5020):  Moved from here ...
	* pr-5022.ch: ... to this new file.
	* chillvars.exp, pr-5020.exp (binfile):  Add .exe extension.
	* chillvars.exp, pr-5020.exp: Don't check all_flag.
	* pr-5020.exp:  Add more tests; fix "print y pretty" output.
This commit is contained in:
Per Bothner 1994-06-09 23:13:54 +00:00
parent f2f803c158
commit 605f94ba35
7 changed files with 63 additions and 55 deletions

View File

@ -28,6 +28,8 @@ chexp.exp
chillvars.ch
chillvars.exp
configure.in
pr-5020.ch
pr-5020.exp
Things-to-lose:

View File

@ -53,13 +53,13 @@ RUNTEST = runtest
RUNTESTFLAGS =
EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
echo $${rootme}/../../expect/expect ; \
EXPECT = `if [ -f $${rootme}../../../expect/expect ] ; then \
echo $${rootme}../../../expect/expect ; \
else echo expect ; fi`
RUNTEST_FOR_TARGET = ` \
if [ -f $${rootme}/../../dejagnu/site.exp ] ; then \
echo $${rootme}/../../dejagnu/runtest ; \
if [ -f $${rootme}../../../dejagnu/site.exp ] ; then \
echo $${rootme}../../../dejagnu/runtest ; \
else \
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
echo $(RUNTEST); \
@ -68,11 +68,12 @@ RUNTEST_FOR_TARGET = ` \
fi; \
fi`
CFLAGS = -g
CHILLFLAGS = $(CFLAGS)
CHILL_FOR_TARGET = ` \
if [ -f $${rootme}/../../gcc/Makefile ] ; then \
echo $${rootme}/../../gcc/xgcc -B$${rootme}../../gcc/; \
if [ -f $${rootme}../../../gcc/Makefile ] ; then \
echo $${rootme}../../../gcc/xgcc -B$${rootme}../../../gcc/; \
else \
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
echo gcc; \
@ -84,16 +85,16 @@ CHILL_FOR_TARGET = ` \
CHILL = $(CHILL_FOR_TARGET)
CHILL_LIB = ` \
if [ -f $${rootme}/../../gcc/ch/runtime/libchill.a ] ; then \
echo $${rootme}/../../gcc/ch/runtime/chillrt0.o \
$${rootme}/../../gcc/ch/runtime/libchill.a; \
if [ -f $${rootme}../../../gcc/ch/runtime/libchill.a ] ; then \
echo $${rootme}../../../gcc/ch/runtime/chillrt0.o \
$${rootme}../../../gcc/ch/runtime/libchill.a; \
else \
echo -lchill; \
fi`
GDB = ` \
if [ -f $${rootme}/../gdb ] ; \
then echo $${rootme}|sed -e 's@/[^/]*$$@@'|sed -e 's@$$@/gdb@' ; \
if [ -f $${rootme}../../gdb ] ; \
then echo $${rootme}../../gdb; \
else echo gdb; \
fi`
@ -101,15 +102,17 @@ GDBFLAGS = -nx
#### host, target, and site specific Makefile frags come in here.
EXECUTABLES = chillvars
EXECUTABLES = chillvars.exe pr-5020.exe pr-5022.exe
all: $(EXECUTABLES)
chillvars: chillvars.o
$(CHILL_FOR_TARGET) $(CHILLFLAGS) $(LDFLAGS) -o chillvars chillvars.o $(CHILL_LIB) $(LIBS)
.SUFFIXES: .ch .exe
chillvars.o: chillvars.ch
$(CHILL_FOR_TARGET) $(CHILLFLAGS) -fspecial_UC -c $(srcdir)/chillvars.ch
.o.exe:
$(CHILL_FOR_TARGET) $(CHILLFLAGS) $(LDFLAGS) -o $*.exe $*.o $(CHILL_LIB) $(LIBS)
.ch.o:
$(CHILL_FOR_TARGET) $(CHILLFLAGS) -fspecial_UC -c $<
.NOEXPORT:
INFODIRS=doc
@ -152,13 +155,11 @@ site.exp: ./config.status Makefile
installcheck:
check: site.exp all just-check
just-check:
rootme=`pwd`; export rootme; \
srcdir=${srcdir} ; export srcdir ; \
EXPECT=${EXPECT} ; export EXPECT ; \
if [ -f $${rootme}/../../expect/expect ] ; then \
TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
export TCL_LIBRARY ; fi ; \
$(RUNTEST_FOR_TARGET) $(RUNTESTFLAGS) --tool gdb GDB=$(GDB) --srcdir $(srcdir)
tests=`cd ${srcdir}; echo *.exp` ; \
rootme=`pwd`/; export rootme; \
cd .. ; \
$(MAKE) just-check RUNTESTFLAGS="${RUNTESTFLAGS} $${tests}" \
GDB=${GDB} EXPECT=${EXPECT}
clean mostlyclean:
-rm -f *~ core *.o a.out xgdb *.x $(EXECUTABLES)

View File

@ -220,7 +220,7 @@ proc test_print_reject { args } {
}
send "$sendthis\n"
expect {
-re ".*Invalid syntax in expression.*$prompt $" {
-re ".*A .* in expression.*\\.*$prompt $" {
incr passcount
return 1
}

View File

@ -200,17 +200,3 @@ write_arrays ();
booleans ();
END;
PR_5020: MODULE
dummy_pr_5020: PROC ();
END;
NEWMODE x = STRUCT (l LONG, b BOOL);
DCL y ARRAY ('a':'b') x;
y('a').l := 10;
y('a').b := TRUE;
y('b').l := 111;
y('b').b := FALSE;
dummy_pr_5020 ();
END;

View File

@ -289,13 +289,11 @@ proc test_structs {} {
# haven't tried to compile one, or the compilation failed for some reason.
# In either case, just notify the user and skip the tests in this file.
set binfile "chillvars"
set binfile "chillvars.exe"
set srcfile $binfile.ch
if ![file exists $objdir/$subdir/$binfile] then {
if $all_flag then {
warning "$binfile does not exist; tests suppressed."
}
warning "$binfile does not exist; tests suppressed."
} else {
do_tests
}

View File

@ -0,0 +1,19 @@
PR_5020: MODULE
dummy_pr_5020: PROC ();
END;
NEWMODE x = STRUCT (l LONG, b BOOL);
NEWMODE aset = SET (aa, bb);
DCL y ARRAY ('a':'b') x;
DCL setarr ARRAY (aset) x;
DCL intarr ARRAY(10:11) x;
DCL boolarr ARRAY (BOOL) x;
y('a').l, setarr(aa).l, intarr(10).l, boolarr(FALSE).l := 10;
y('a').b, setarr(aa).b, intarr(10).b, boolarr(FALSE).b := TRUE;
y('b').l, setarr(bb).l, intarr(11).l, boolarr(TRUE).l := 111;
y('b').b, setarr(bb).b, intarr(11).b, boolarr(TRUE).b := FALSE;
dummy_pr_5020 ();
END;

View File

@ -54,17 +54,21 @@ proc test_pr_5020 {} {
global prompt
runto dummy_pr_5020
gdb_test_exact "print y" \
{= [ ('a') [.l: 10, .b: TRUE], ('b') [.l: 111, .b: FALSE]]}
{= [('a'): [.l: 10, .b: TRUE], ('b'): [.l: 111, .b: FALSE]]}
gdb_test_exact "print boolarr" \
{= [(FALSE): [.l: 10, .b: TRUE], (TRUE): [.l: 111, .b: FALSE]]}
gdb_test_exact "print intarr" \
{= [(10): [.l: 10, .b: TRUE], (11): [.l: 111, .b: FALSE]]}
gdb_test_exact "print setarr" \
{= [(aa): [.l: 10, .b: TRUE], (bb): [.l: 111, .b: FALSE]]}
send "set print pretty\n" ; expect -re "$prompt $"
gdb_test_exact "print y" \
{= [
(`a`) [
.l: 10,
.b: TRUE
],
('b') [
.l: 111,
.b: FALSE
{= [('a'): [
.l: 10,
.b: TRUE
], ('b'): [
.l: 111,
.b: FALSE
]]} "print y pretty"
}
@ -72,13 +76,11 @@ proc test_pr_5020 {} {
# haven't tried to compile one, or the compilation failed for some reason.
# In either case, just notify the user and skip the tests in this file.
set binfile "chillvars"
set binfile "pr-5020.exe"
set srcfile $binfile.ch
if ![file exists $objdir/$subdir/$binfile] then {
if $all_flag then {
warning "$binfile does not exist; tests suppressed."
}
warning "$objdir/$subdir/$binfile does not exist; tests suppressed."
} else {
do_tests
}