Changeset 63bde81 for tests


Ignore:
Timestamp:
Jul 19, 2021, 4:03:19 PM (4 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
f9b68d6
Parents:
12a1013 (diff), fcaa1e4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tests/.expect/polymorphism.txt

    r12a1013 r63bde81  
    11123 456 456
    225 5
     3=== checkPlan9offsets
     4static:
     5  offset of inner double: 8
     6  offset of inner float:  16
     7dynamic:
     8  offset of inner double: 8
     9  offset of inner float:  16
  • tests/polymorphism.cfa

    r12a1013 r63bde81  
    5454        b.i = s.i;
    5555        return b.j;
     56}
     57
     58void checkPlan9offsets() {
     59
     60        forall( T )
     61        struct thing {
     62                T q;                // variable-sized padding
     63                inline double;
     64                inline float;
     65        };
     66
     67        #define SHOW_OFFSETS \
     68                double & x_inner_double = x; \
     69                float  & x_inner_float  = x; \
     70                printf("  offset of inner double: %ld\n", ((char *) & x_inner_double) - ((char *) & x) ); \
     71                printf("  offset of inner float:  %ld\n", ((char *) & x_inner_float ) - ((char *) & x) );
     72
     73        void showStatic( thing(int) & x ) {
     74                printf("static:\n");
     75                SHOW_OFFSETS
     76        }
     77
     78        forall( T )
     79        void showDynamic( thing(T) & x ) {
     80                printf("dynamic:\n");
     81                SHOW_OFFSETS
     82        }
     83
     84        #undef SHOW_OFFSETS
     85
     86        printf("=== checkPlan9offsets\n");
     87        thing(int) x;
     88        showStatic(x);
     89        showDynamic(x);
    5690}
    5791
     
    114148                assertf(ret == u.f2, "union operation fails in polymorphic context.");
    115149        }
     150
     151        checkPlan9offsets();
    116152}
    117153
  • tests/unified_locking/mutex_test.hfa

    r12a1013 r63bde81  
    88struct MutexObj {
    99        LOCK l;
    10         $thread * id;
     10        thread$ * id;
    1111        uint32_t sum;
    1212};
     
    2222
    2323uint32_t cs() {
    24         $thread * me = active_thread();
     24        thread$ * me = active_thread();
    2525        uint32_t value;
    2626        lock(mo.l);
Note: See TracChangeset for help on using the changeset viewer.