Ignore:
Timestamp:
Dec 12, 2018, 9:16:12 AM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
5ebb1368
Parents:
3d99498
Message:

add auto newline to sout, change endl to nl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/fallthrough.cfa

    r3d99498 r200fcb3  
    1010// Created On       : Wed Mar 14 10:06:25 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Nov  8 09:09:09 2018
    13 // Update Count     : 16
     12// Last Modified On : Tue Dec  4 21:36:14 2018
     13// Update Count     : 17
    1414//
    1515
     
    1919        choose ( choice ) {
    2020                case 1:
    21                         sout | "case 1" | endl;
     21                        sout | "case 1";
    2222                        fallthru;
    2323                case 2:
    24                         sout | "case 2" | endl;
     24                        sout | "case 2";
    2525                        fallthru;
    26                         sout | "did not fallthru" | endl;
     26                        sout | "did not fallthru";
    2727                        if ( 7 ) fallthru common2;
    2828                        fallthru common1;
    2929                case 3:
    30                         sout | "case 3" | endl;
     30                        sout | "case 3";
    3131                        fallthru default;
    3232                        fallthru common1;
    3333                common1:
    34                         sout | "common1" | endl;
     34                        sout | "common1";
    3535                // break
    3636                case 4:
    37                         sout | "case 4" | endl;
     37                        sout | "case 4";
    3838                        fallthru common2;
    3939                case 5:
    40                         sout | "case 5" | endl;
     40                        sout | "case 5";
    4141                        fallthru common2;
    4242                        fallthru default;
    4343                case 6:
    44                         sout | "case 6" | endl;
     44                        sout | "case 6";
    4545                        fallthru common2;
    4646                common2:
    47                         sout | "common2" | endl;
     47                        sout | "common2";
    4848                // break
    4949                default:
    50                         sout | "default" | endl;
     50                        sout | "default";
    5151                        fallthru;
    5252        }
    5353
    54         sout | endl;
     54        sout | nl;
    5555
    5656        switch ( choice ) {
    5757          case 1:
    58                 sout | "case 1" | endl;
     58                sout | "case 1";
    5959                switch ( choice ) {
    6060                  case 1:
    61                         sout | "case 1" | endl;
     61                        sout | "case 1";
    6262                        for ( int i = 0; i < 4; i += 1 ) {
    6363                                printf("%d\n", i);
     
    6767                break;
    6868          case 5:
    69                 sout | "case 5" | endl;
     69                sout | "case 5";
    7070                if ( choice == 5 ) {
    7171                        if ( choice != 5 ) {
    72                                 sout | "error" | endl;
     72                                sout | "error";
    7373                        } else {
    74                                 sout | "check" | endl;
     74                                sout | "check";
    7575                                fallthru common;
    7676                        } // if
     
    117117int main() {
    118118        test( 1 );
    119         sout | endl;
     119        sout | nl;
    120120        test( 5 );
    121121}
Note: See TracChangeset for help on using the changeset viewer.