/* Copyright (C) 1990, Digital Equipment Corporation.         */
/* All rights reserved.                                       */
/* See the file COPYRIGHT for a full description.             */

/* Last modified on Mon Nov  2 16:17:49 PST 1992 by kalsow    */
/*      modified on Tue Mar 12 22:05:06 1991 by muller        */

#ifdef LOCAL
M3      = m3xx -Y0@/udir/kalsow/m3/m3compiler/mips/m3compiler@
#endif

COMPILE = $(M3) -c -g -k -w1 -D../.. -nostd

all::       /* run all tests */
new_base::  /* run all tests & capture their output as the new base case */
tidy::      /* remove the trash */
scratch::   /* remove all derived files */

#define testdir(d,comment)                                                  @@\
                                                                            @@\
all:: d##_X                                                                 @@\
new_base:: d##_base                                                         @@\
scratch:: ; -rm -fr d##_X                                                   @@\
d:: d##_X                                                                   @@\
d##_base:: d##_X ; @mv d##_X/stdout d##_X/stderr d                          @@\
d##_X:: FRC ;\                                                              @@\
-@ echo --- d --- comment  ;\                                               @@\
   rm -fr d##_X ;\                                                          @@\
   mkdir d##_X ;\                                                           @@\
   (cd d##_X ; $(COMPILE) ../d >stdout ) 1>&2 2>d##_X/stderr ;\             @@\
   if test -r d/stdout;\                                                    @@\
     then diff d/stdout d##_X/stdout;\                                      @@\
     else cat d##_X/stdout;\                                                @@\
   fi;\                                                                     @@\
   if test -r d/stderr;\                                                    @@\
     then diff d/stderr d##_X/stderr;\                                      @@\
     else cat d##_X/stderr;\                                                @@\
   fi;\                                                                     @@\
   rm -f d##_X/a.out

testdir (c001, "empty program")
testdir (c002, "empty unsafe program")
testdir (c003, "a program with two statements")
testdir (c004, "declaration of REF INTEGER")
testdir (c005, "declaration of T subtype REFANY")
testdir (c006, "variables in nested blocks and procedures")
testdir (c007, "a procedure with an integer argument")
testdir (c008, "CASE statements")
testdir (c009, "FOR and EXIT statements")
testdir (c010, "IF statements")
testdir (c011, "address substraction")
testdir (c012, "LOOP and EXIT statements")
testdir (c013, "REPEAT and EXIT statements")
testdir (c014, "TRY FINALLY and RETURN statements")
testdir (c015, "imbricated TRY FINALLY statements")
testdir (c016, "TRY EXCEPT statements")
testdir (c017, "TYPECASE statements")
testdir (c018, "WHILE and EXIT statements")
testdir (c019, "WITH statements")
testdir (c020, "assignment of INTEGER subranges")
testdir (c021, "procedures and variables in an Interface")
testdir (c022, "user and language specified variable initialization")
testdir (c023, "simple subrange type in an Interface")
testdir (c024, "importing an external subrange type")
testdir (c025, "RECORD types variables and assignments")
testdir (c026, "fixed ARRAY types variables assignments and subscripting")
testdir (c027, "nested procedures with up-level variable references")
testdir (c028, "type minimization of REF/RECORD")
testdir (c029, "non-opaque OBJECTs")
testdir (c030, "opaque OBJECTS")
testdir (c031, "assignment and initialization of INTEGER subranges")
testdir (c032, "BRANDED REF types")
testdir (c033, "NEW of simple REF types")
testdir (c034, "NEW of REF types that require initialization")
testdir (c035, "NEW of open arrays")
testdir (c036, "NEW of OBJECTs with default and non-default slots")
testdir (c037, "NEW of opaque OBJECTs with default and non-default slots")
testdir (c038, "open ARRAY indexing")
testdir (c039, "SUBARRAY")
testdir (c040, "large INTEGER constants")
testdir (c041, "FIRST and LAST as constants")
testdir (c042, "SET declarations and constants")
testdir (c043, "RECORD constants")
testdir (c044, "escape character literals")
testdir (c045, "Text.PutStr -  passing a fixed array to an open array formal")
testdir (c046, "declaring an opaque type")
testdir (c047, "RAISE statements")
testdir (c048, "NUMBER")
testdir (c049, "based constants and BITS FOR...")
testdir (c050, "opaque object types")
testdir (c051, "revealing objects")
testdir (c052, "type identification")
testdir (c053, "MAX")
testdir (c054, "coverage of builtinWord")
testdir (c055, "coverage of arithmetic operations and relations")
testdir (c056, "twisted mutually recursive types")
testdir (c057, "CSE on array indexing expressions")
testdir (c058, "open array parameters")
testdir (c059, "recursive types and constant expressions")
testdir (c060, "nested procedures and variables")
testdir (c061, "CASE statements")
testdir (c062, "RCmaps of REF types")
testdir (c063, "NIL is a ROOT")
testdir (c064, "common subexpressions are not always common")
testdir (c065, "ADDRESS arithmetic")
testdir (c066, "Constructor expressions")
testdir (c067, "EXTERNAL vs. non EXTERNAL")
testdir (c068, "does refany have a typecell ?")
testdir (c069, "assignment of open arrays")
testdir (c070, "scopes")
testdir (c071, "procedures that return structures in C")
testdir (c072, "ASSERT")
testdir (c073, "procedure arguments")
testdir (c074, "INC and DEC - range checking")
testdir (c075, "casting open/fixed array to/from open/fixed array")
testdir (c076, "b3tests/b005 - more array problems")
testdir (c077, "global type names")
testdir (c078, "8-bit characters")
testdir (c079, "imported constants and types")
testdir (c080, "REF REF INTEGER")
testdir (c081, "REAL literals as parameters")
testdir (c082, "REAL lvalues vs. rvalues")
testdir (c083, "structured return value from nested procedure")
testdir (c084, "READONLY integer parameters")
testdir (c085, "INC on addresses")
testdir (c086, "LAST on arrays and subranges")
testdir (c087, "chained imports of structured constants")
testdir (c088, "up-level reference of REAL variables")
testdir (c089, "imported equivalent types")
testdir (c090, "arrays of refs")
testdir (c091, "UNUSED and OBSOLETE pragmas")
testdir (c092, "nested procedures")
testdir (c093, "TYPECASE with type expressions")
testdir (c094, "BITS 1 FOR [0..1]")
testdir (c095, "BITS 8 FOR [0..255]")
testdir (c096, "record constructor in WITH statement")
testdir (c097, "recursive types")
testdir (c098, "record constructor with packed fields")
testdir (c099, "local and imported equivalent types")
testdir (c100, "nested procedures and procedure parameters")
testdir (c101, "multiple record constructors in one WITH statement")
testdir (c102, "array constructor")
testdir (c103, "packed vs. non-packed subranges")
testdir (c104, "import and export of same interface")
testdir (c105, "packed record")
testdir (c106, "variable initialization in interface")
testdir (c107, "exported exception")
testdir (c108, "ObjectType.Method as constant")
testdir (c109, "mixed LOOPHOLE and SUBARRAY")
testdir (c110, "ObjectType.Method does not work")
testdir (c111, "external variables should not be initialized")
testdir (c112, "assignable types")
testdir (c113, "size of local copies of value formal arrays")
testdir (c114, "initialization of UNTRACED REF variables")
testdir (c115, ""line 15: illegal operand for MOD" ?")
testdir (c116, "subrange of enumerated type used as array index =b1tests/b003")
testdir (c117, "b1tests/b001 - array constructors")
testdir (c118, "b1tests/b002 - BYTESIZE illegal in CASE ?")
testdir (c119, "b1tests/b004 - open array actual / VAR fixed array formal")
testdir (c120, "b2tests/b001 - empty records cause improper C type")
testdir (c121, "b1tests/b008 - multiple timestamps for a single type")
testdir (c122, "the compiler dumps core !")
testdir (c123, "implicit import of large constants")
testdir (c124, "recursion on Module names is allowed")
testdir (c125, "LAST of subrange assignment in record constructor")
testdir (c126, "assignability of recursive types")
testdir (c127, "nasty scoping and lazy typechecking interactions")
testdir (c128, "nested constructors with procedure values")
testdir (c129, "READONLY subranges of integer")
testdir (c130, "object writers")
testdir (c131, "nested open array constructors")
testdir (c132, "generic list")
testdir (c133, "procedure and method constants")
testdir (c134, "range checks on INC and DEC")
testdir (c135, "misc. variable initializations")
testdir (c136, "initialized packed field of REF")
testdir (c137, "<*TRACE*> pragma")

test:: FRC
	@echo $(PF) ctests done


test:: FRC
	@echo $(PF) etests done
