Changeset 7215000


Ignore:
Timestamp:
Apr 16, 2020, 1:25:53 PM (18 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
b5276fc
Parents:
41af19c
Message:

Added flag to disable non-deteministic parts of the output when testing

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/CompilationState.cc

    r41af19c r7215000  
    2727        nopreludep = false,
    2828        genproto = false,
     29        deterministic_output = false,
    2930        nomainp = false,
    3031        parsep = false,
  • src/CompilationState.h

    r41af19c r7215000  
    2828        nopreludep,
    2929        genproto,
     30        deterministic_output,
    3031        nomainp,
    3132        parsep,
  • src/ResolvExpr/TypeEnvironment.cc

    r41af19c r7215000  
    2020#include <utility>                     // for pair, move
    2121
     22#include "CompilationState.h"          // for deterministic_output
    2223#include "Common/utility.h"            // for maybeClone
    2324#include "SynTree/Type.h"              // for Type, FunctionType, Type::Fora...
     
    106107
    107108        void EqvClass::print( std::ostream &os, Indenter indent ) const {
    108                 os << "( ";
    109                 std::copy( vars.begin(), vars.end(), std::ostream_iterator< std::string >( os, " " ) );
    110                 os << ")";
     109                if( !deterministic_output ) {
     110                        os << "( ";
     111                        std::copy( vars.begin(), vars.end(), std::ostream_iterator< std::string >( os, " " ) );
     112                        os << ")";
     113                }
    111114                if ( type ) {
    112115                        os << " -> ";
     
    235238                // check safely bindable
    236239                if ( r.type && occursIn( r.type, s.vars.begin(), s.vars.end(), *this ) ) return false;
    237                
     240
    238241                // merge classes in
    239242                r.vars.insert( s.vars.begin(), s.vars.end() );
  • src/main.cc

    r41af19c r7215000  
    443443
    444444
    445 static const char optstring[] = ":c:ghlLmNnpP:S:twW:D:";
     445static const char optstring[] = ":c:ghlLmNnpdP:S:twW:D:";
    446446
    447447enum { PreludeDir = 128 };
     
    456456        { "no-prelude", no_argument, nullptr, 'n' },
    457457        { "prototypes", no_argument, nullptr, 'p' },
     458        { "deterministic-out", no_argument, nullptr, 'd' },
    458459        { "print", required_argument, nullptr, 'P' },
    459460        { "prelude-dir", required_argument, nullptr, PreludeDir },
     
    476477        "do not read prelude",                                // -n
    477478        "generate prototypes for prelude functions",            // -p
     479        "don't print output that isn't deterministic",        // -d
    478480        "print",                                              // -P
    479481        "<directory> prelude directory for debug/nodebug",      // no flag
     
    580582                        genproto = true;
    581583                        break;
     584                  case 'd':                                     // don't print non-deterministic output
     585                    deterministic_output = true;
     586                        break;
    582587                  case 'P':                                                                             // print options
    583588                        for ( int i = 0;; i += 1 ) {
  • tests/Makefile.am

    r41af19c r7215000  
    4141        -quiet @CFA_FLAGS@ \
    4242        -DIN_DIR="${abs_srcdir}/.in/"
     43
     44AM_CFAFLAGS = -XCFA --deterministic-out
    4345
    4446# get the desired cfa to test
  • tests/Makefile.in

    r41af19c r7215000  
    408408        -DIN_DIR="${abs_srcdir}/.in/"
    409409
     410AM_CFAFLAGS = -XCFA --deterministic-out
    410411
    411412# get the desired cfa to test
  • tests/errors/.expect/completeType.txt

    r41af19c r7215000  
    2727    void
    2828  )
    29   Environment:( _85_4_DT ) -> instance of struct A with body 0 (no widening)
     29  Environment: -> instance of struct A with body 0 (no widening)
    3030
    3131
     
    5050    void
    5151  )
    52   Environment:( _85_4_DT ) -> instance of struct B with body 1 (no widening)
     52  Environment: -> instance of struct B with body 1 (no widening)
    5353
    5454
     
    127127          void
    128128        )
    129         Environment:( _104_0_T ) -> instance of type T (not function type) (no widening)
     129        Environment: -> instance of type T (not function type) (no widening)
    130130
    131131      Could not satisfy assertion:
Note: See TracChangeset for help on using the changeset viewer.