Changeset 401e61f for src/tests


Ignore:
Timestamp:
Jun 5, 2018, 10:16:46 AM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
2248dc7, dafdbe7
Parents:
6e3eaa57
Message:

add if control to while loop

Location:
src/tests
Files:
2 moved

Legend:

Unmodified
Added
Removed
  • src/tests/.expect/ifwhileCtl.txt

    r6e3eaa57 r401e61f  
    33x == y correct
    44s.i < 4 correct
     5x != 0 correct
     6x == y correct
     7s.i < 4 correct
  • src/tests/ifwhileCtl.c

    r6e3eaa57 r401e61f  
    1010// Created On       : Sat Aug 26 10:13:11 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun  2 09:55:02 2018
    13 // Update Count     : 15
     12// Last Modified On : Mon Jun  4 22:46:48 2018
     13// Update Count     : 19
    1414//
    1515
     
    4242
    4343        if ( struct S { int i; } s = { 3 }; s.i < 4 ) {
     44                S s1;
    4445                sout | "s.i < 4 correct" | endl;
    4546        } else {
     47                S s1;
    4648                sout | "s.i >= 4 incorrect" | endl;
    4749        } // if
     50
     51        while ( int x = 1 ) {
     52                sout | "x != 0 correct" | endl;
     53                break;
     54        } // while
     55
     56        while ( int x = 4, y = 0 ) {
     57                sout | "x != 0 && y != 0 incorrect" | endl;
     58        } // while
     59
     60        while ( int x = 5, y = f( x ); x == y ) {
     61                sout | "x == y correct" | endl;
     62                break;
     63        } // while
     64
     65        while ( struct S { int i; } s = { 3 }; s.i < 4 ) {
     66                S s1;
     67                sout | "s.i < 4 correct" | endl;
     68                break;
     69        } // while
    4870} // main
    4971
Note: See TracChangeset for help on using the changeset viewer.