Changeset 200fcb3 for tests/gmp.cfa


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/gmp.cfa

    r3d99498 r200fcb3  
    1010// Created On       : Tue Apr 19 08:55:51 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Nov  6 17:54:34 2018
    13 // Update Count     : 557
     12// Last Modified On : Tue Dec  4 21:37:29 2018
     13// Update Count     : 558
    1414//
    1515
     
    1919
    2020int main( void ) {
    21         sout | "constructors" | endl;
     21        sout | "constructors";
    2222        short int si = 3;
    2323        Int x = { "50000000000000000000" }, y = { si }, z = x + y;
    24         sout | x | y | z | endl;
    25         sout | "x:" | x | "y:" | y | "z:" | z | endl;
     24        sout | x | y | z;
     25        sout | "x:" | x | "y:" | y | "z:" | z;
    2626
    27         sout | "conversions" | endl;
     27        sout | "conversions";
    2828        y = 'a';
    29         sout | "y:" | y | endl;
     29        sout | "y:" | y;
    3030        y = "12345678901234567890123456789";
    31         sout | "y:" | y | endl;
     31        sout | "y:" | y;
    3232        y = 100`mp + 100`mp;
    33         sout | "y:" | y | endl;
     33        sout | "y:" | y;
    3434        y = -200u`mp + -200u`mp;
    35         sout | "y:" | y | endl;
     35        sout | "y:" | y;
    3636        y = "12345678901234567890123456789"`mp + "12345678901234567890123456789"`mp;
    37         sout | "y:" | y | endl;
     37        sout | "y:" | y;
    3838        y = si;
    39         sout | "y:" | y | endl;
     39        sout | "y:" | y;
    4040        y = -3;
    41         sout | "y:" | y | endl;
     41        sout | "y:" | y;
    4242        y += 7;
    43         sout | "y:" | y | endl;
     43        sout | "y:" | y;
    4444        y -= 1;
    45         sout | "y:" | y | endl;
     45        sout | "y:" | y;
    4646        int b;
    4747        b = y;
    4848        si = y;
    49         sout | "y:" | y | "b:" | b | "si:" | si | endl;
     49        sout | "y:" | y | "b:" | b | "si:" | si;
    5050
    51         sout | "comparison" | endl;
    52         sout | x == x | endl;
    53         sout | x != x | endl;
    54         sout | x < x | endl;
    55         sout | x <= x | endl;
    56         sout | x > x | endl;
    57         sout | x >= x | endl;
     51        sout | "comparison";
     52        sout | x == x;
     53        sout | x != x;
     54        sout | x < x;
     55        sout | x <= x;
     56        sout | x > x;
     57        sout | x >= x;
    5858
    59         sout | "arithmetic" | endl;
     59        sout | "arithmetic";
    6060        z = x + y + z;
    61         sout | "z:" | z | endl;
     61        sout | "z:" | z;
    6262        z = z = x;
    63         sout | "z:" | z | endl;
     63        sout | "z:" | z;
    6464        z = x - y - z;
    65         sout | "z:" | z | endl;
     65        sout | "z:" | z;
    6666        z = x * y * z;
    67         sout | "z:" | z | endl;
     67        sout | "z:" | z;
    6868        z = x * 3;
    69         sout | "z:" | z | endl;
     69        sout | "z:" | z;
    7070        z = 3 * x;
    71         sout | "z:" | z | endl;
     71        sout | "z:" | z;
    7272        z = x / 3;
    73         sout | "z:" | z | endl;
    74         sout | div( x, 3 ) | x / 3 | "," | x % 3 | endl;
     73        sout | "z:" | z;
     74        sout | div( x, 3 ) | x / 3 | "," | x % 3;
    7575        [ x, y ] = div( x, 3 );
    76         sout | "x:" | x | "y:" | y | endl;
     76        sout | "x:" | x | "y:" | y;
    7777
    78         sout | endl;
     78        sout;
    7979
    8080        sin | x | y | z;
    81         sout | x | y | z | endl;
     81        sout | x | y | z;
    8282
    83         sout | endl;
     83        sout;
    8484
    85         sout | "Fibonacci Numbers" | endl;
     85        sout | "Fibonacci Numbers";
    8686        Int fn, fn1, fn2;
    8787        fn = (Int){0}; fn1 = fn;                                                        // 1st case
    88         sout | (int)0 | fn | endl;
     88        sout | (int)0 | fn;
    8989        fn = 1; fn2 = fn1; fn1 = fn;                                            // 2nd case
    90         sout | 1 | fn | endl;
     90        sout | 1 | fn;
    9191        for ( i; 2u ~= 200 ) {
    9292                fn = fn1 + fn2; fn2 = fn1; fn1 = fn;                    // general case
    93                 sout | i | fn | endl;
     93                sout | i | fn;
    9494        } // for
    9595
    96         sout | endl;
     96        sout;
    9797
    98         sout | "Factorial Numbers" | endl;
     98        sout | "Factorial Numbers";
    9999        Int fact = 1;                                                                           // 1st case
    100         sout | (int)0 | fact | endl;
     100        sout | (int)0 | fact;
    101101        for ( i; 1u ~= 40u ) {
    102102                fact *= i;                                                                              // general case
    103                 sout | i | fact | endl;
     103                sout | i | fact;
    104104        } // for
    105105} // main
Note: See TracChangeset for help on using the changeset viewer.