Changeset 7fe2498


Ignore:
Timestamp:
Mar 7, 2017, 8:29:28 AM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
a7c90d4
Parents:
2988eeb
Message:

add sout prints and adjust char print values

Location:
src/tests
Files:
2 edited

Legend:

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

    r2988eeb r7fe2498  
     1u=5 v=6 x=10 y=11 z=[100, 200]
    12u=5 v=6 x=10 y=11 z=[100, 200]
    23u=11 v=10 x=11 y=10 z=[11, 10]
     4u=11 v=10 x=11 y=10 z=[11, 10]
     5u=10 v=11 z=[10, 11]
    36u=10 v=11 z=[10, 11]
    47u=123 v=456 z=[111, 222]
    5 d=-2153.12 i=-2153 c=-105 t=[-2153, -2153.12, -2153]
    6 d=-2153.12 i=-2153 c=-105 t=[-2153, -2153.12, -2153]
     8u=123 v=456 z=[111, 222]
     9d=94.12 i=94 c=^ t=[94, 94.12, 94]
     10d=94.12 i=94 c=^ t=[94, 94.12, 94]
     11d=-94.12 i=-94 c=¢ t=[-94, -94.12, -94]
     12d=-94.12 i=-94 c=¢ t=[-94, -94.12, -94]
  • src/tests/tupleAssign.c

    r2988eeb r7fe2498  
    99// Author           : Rob Schluntz
    1010// Created On       : Tue Nov 15 17:24:32 2016
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Tue Nov 15 17:27:28 2016
    13 // Update Count     : 3
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Mar  6 21:23:58 2017
     13// Update Count     : 34
    1414//
     15
     16#include <fstream>
    1517
    1618int main() {
     
    2123
    2224                // swap x, y and store the new [x, y] in [u, v] and in z;
    23                 printf("u=%d v=%d x=%d y=%d z=[%d, %d]\n", u, v, x, y, z);
     25                printf( "u=%d v=%d x=%d y=%d z=[%d, %d]\n", u, v, x, y, z );
     26                sout | "u=" | u | "v=" | v | "x=" | x | "y=" | y | "z=[" | z | "]" | endl;
    2427                z = [u, v] = [x, y] = [y, x];
    25                 printf("u=%d v=%d x=%d y=%d z=[%d, %d]\n", u, v, x, y, z);
     28                printf( "u=%d v=%d x=%d y=%d z=[%d, %d]\n", u, v, x, y, z );
     29                sout | "u=" | u | "v=" | v | "x=" | x | "y=" | y | "z=[" | z | "]" | endl;
    2630
    2731                // shuffle elements -- v = z.0, z.0 = z.1, z.1 = u, u = v
    2832                [v, z, u] = [z, u, v];
    29                 printf("u=%d v=%d z=[%d, %d]\n", u, v, z);
     33                printf( "u=%d v=%d z=[%d, %d]\n", u, v, z );
     34                sout | "u=" | u | "v=" | v | "z=[" | z | "]" | endl;
    3035
    3136                // multiple assignment with tuple expression on right
    3237                z = [111, 222];
    3338                [u, v] = [123, 456];
    34                 printf("u=%d v=%d z=[%d, %d]\n", u, v, z);
     39                printf( "u=%d v=%d z=[%d, %d]\n", u, v, z );
     40                sout | "u=" | u | "v=" | v | "z=[" | z | "]" | endl;
    3541        }
    36 
    3742        {
    3843                // test mass assignment
     
    4853                // no conversion from X to integral types, so this serves as a santiy
    4954                // check that as long as this compiles, ?=?(_, x) is not generated.
    50                 [t, x, d, i, c, x] = (double)-2153.12;
    51                 printf("d=%lg i=%d c=%d t=[%d, %lg, %d]\n", d, i, (int)c, t);
    52                 [x, c, i, d, x, t] = (double)-2153.12;
    53                 printf("d=%lg i=%d c=%d t=[%d, %lg, %d]\n", d, i, (int)c, t);
     55                [t, x, d, i, c, x] = (double)94.12;
     56                printf( "d=%lg i=%d c=%c t=[%d, %lg, %d]\n", d, i, (int)c, t );
     57                sout | "d=" | d | "i=" | i | "c=" | c | ' ' | "t=[" | t | "]" | endl;
     58                [x, c, i, d, x, t] = (double)-94.12;
     59                printf( "d=%lg i=%d c=%c t=[%d, %lg, %d]\n", d, i, c, t );
     60                sout | "d=" | d | "i=" | i | "c=" | c | ' ' | "t=[" | t | "]" | endl;
    5461        }
    5562}
Note: See TracChangeset for help on using the changeset viewer.