Changeset 9ec8c5f


Ignore:
Timestamp:
Jul 5, 2020, 5:24:13 PM (16 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
2ed3371, 381132b
Parents:
2c60c644
Message:

add additional int128 tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/manipulatorsOutput3.cfa

    r2c60c644 r9ec8c5f  
    1313    sout | sign(x);
    1414    sout | nl;
    15 #if 1
     15
    1616    sout | bin(x);
    1717    sout | upcase(bin(x));
     
    124124    sout | nl;
    125125
    126    
     126
     127    // extras
     128    sout | "extras";
    127129    sout | bin(divisor);
    128130    sout | upcase(bin(divisor));
     
    140142    sout | left(sign(wd(0,40, divisor))) | 'X';
    141143    printf( "%-+1.40dX\n", 123456789 );
    142 #endif // 0
     144
     145    int128 i128;
     146    unsigned int128 ui128;
     147
     148    i128 = -10;
     149    for ( 25 ) {
     150        sout | left( sign( wd( 20, i128 ) ) ) | left( wd( 20, hex( i128 ) ) ) | left( wd( 20, oct( i128 ) ) );
     151        sout | left( wd( 20, bin( i128 ) ) );
     152        i128 += 1;
     153    }
     154    sout | nl;
     155
     156    i128 = 0x7fffffffffffffff;
     157    i128 <<= 64;
     158    i128 += 0xfffffffffffffffa;
     159
     160    for ( 20 ) {
     161        sout | i128;
     162        sout | left( sign( wd( 45, i128 ) ) ) | left( wd( 45, hex( i128 ) ) ) | left( wd( 45, oct( i128 ) ) );
     163        sout | left( wd( 45, bin( i128 ) ) );
     164        i128 += 1;
     165    }
     166    sout | nl;
     167
     168    ui128 = 0x7fffffffffffffff;
     169    ui128 <<= 64;
     170    ui128 += 0xfffffffffffffffa;
     171   
     172    for ( 20 ) {
     173        sout | ui128;
     174        ui128 += 1;
     175    }
     176    sout | nl;
     177
     178    ui128 = 0xffffffffffffffff;
     179    ui128 <<= 64;
     180    ui128 += 0xfffffffffffffffa;
     181   
     182    for ( 20 ) {
     183        sout | ui128;
     184        ui128 += 1;
     185    }
    143186}
Note: See TracChangeset for help on using the changeset viewer.