Changeset 447b0d2b for tests/malloc.cfa


Ignore:
Timestamp:
Sep 3, 2020, 12:07:15 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
9617533
Parents:
4bc27c0 (diff), 73f1b1c (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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/malloc.cfa

    r4bc27c0 r447b0d2b  
    252252
    253253        ip = (int *) (void *) malloc( size );
     254        ip = (int *) (void *) resize( (void *) ip, libAlign, size / 2 );
     255        test_base(ip, size / 2, libAlign);
     256        test_use(ip);
     257        free(ip);
     258
     259        ip = (int *) (void *) aligned_alloc( align, size );
     260        ip = (int *) (void *) resize( (void *) ip, align, size / 2 );
     261        test_base(ip, size / 2, align);
     262        test_use(ip);
     263        free(ip);
     264
     265        ip = (int *) (void *) malloc( size );
    254266        ip = (int *) (void *) resize( (void *) ip, align, size / 4 );
    255267        test_base(ip, size / 4, align);
     
    270282        ip = (int *) (void *) resize( 0p, align, size );
    271283        test_base(ip, size, align);
     284        test_use(ip);
     285        free(ip);
     286
     287        ip = (int *) (void *) calloc( dim, elemSize );
     288        ip = (int *) (void *) realloc( (void *) ip, libAlign, size / 2 );
     289        test_base(ip, size / 2, libAlign);
     290        test_fill(ip, 0, size / 2, '\0');
     291        test_use(ip);
     292        free(ip);
     293
     294        ip = (int *) (void *) cmemalign( align, dim, elemSize );
     295        ip = (int *) (void *) realloc( (void *) ip, align, size / 2 );
     296        test_base(ip, size / 2, align);
     297        test_fill(ip, 0, size / 2, '\0');
    272298        test_use(ip);
    273299        free(ip);
     
    437463        else printf("failed CFA malloc tests : %d/%d\n\n", tests_failed, tests_total);
    438464
    439         // testing CFA malloc
     465        // testing CFA malloc with aligned struct
    440466
    441467        elemSize = sizeof(T1);
     
    518544        free(tp);
    519545
    520 /*
    521546        tp = realloc( (T1*)0p, size  );
    522         est_base(tp, size , tAlign );
    523         est_use(tp);
     547        test_base(tp, size , tAlign );
     548        test_use(tp);
    524549        free(tp);
    525550
    526551        tp = realloc( (T1*)0p, size );
    527         est_base(tp, size, tAlign );
    528         est_use(tp);
    529         free(tp);
    530 */
     552        test_base(tp, size, tAlign );
     553        test_use(tp);
     554        free(tp);
    531555
    532556        tp = memalign( align );
Note: See TracChangeset for help on using the changeset viewer.