Changeset 5f210c0 for tests/ctrl-flow


Ignore:
Timestamp:
Aug 4, 2024, 9:49:25 PM (5 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
7db4fcd4
Parents:
7ab24fef
Message:

Change enum pos to signed int to avoid underflow; operator on enum will not have range check (but succ and pred still have range check

Location:
tests/ctrl-flow
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/ctrl-flow/.expect/loopctrl.txt

    r7ab24fef r5f210c0  
    1191190 -2 -4 -6 -8
    1201200 1 2 3 4 5 6 7 8 9
     121A B C
     122A B C D
     123D B
    121124A B C D
    122125D C B A
  • tests/ctrl-flow/loopctrl.cfa

    r7ab24fef r5f210c0  
    8383
    8484        enum(int) E { A, B, C, D };
    85 //      for ( E e; A ~= C ) { sout | e; } sout | nl;
    86 //      for ( e; A ~= D ) { sout | e; } sout | nl;
    87 //      for ( e; A -~= D ~ 2 ) { sout | e; } sout | nl;
     85        for ( E e; A ~= C ) { sout | e; } sout | nl;
     86        for ( e; A ~= D ) { sout | e; } sout | nl;
     87        for ( e; A -~= D ~ 2 ) { sout | e; } sout | nl;
    8888        for ( e; E ) { sout | e; } sout | nl;
    8989        for ( e; -~= E ) { sout | e; } sout | nl;
Note: See TracChangeset for help on using the changeset viewer.