Changeset 6cfe8bb


Ignore:
Timestamp:
Aug 14, 2017, 4:39:02 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
5a824c2
Parents:
8217e8f
Message:

Fix alloc test for references

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/alloc.c

    r8217e8f r6cfe8bb  
    144144        enum { Alignment = 128 };
    145145
    146         stp = (memalign( Alignment, sizeof( *stp ) ) ){ 42, 42.5 }; // C memalign
     146        stp = &(*(Struct*)memalign( Alignment, sizeof( *stp ) ) ){ 42, 42.5 }; // C memalign
    147147        assert( (uintptr_t)stp % Alignment == 0 );
    148148        printf( "C   memalign %d %g\n", stp->x, stp->y );
    149149        free( stp );
    150150
    151         stp = (memalign( Alignment )){ 42, 42.5 };          // CFA memalign
     151        stp = &(*memalign( Alignment )){ 42, 42.5 };          // CFA memalign
    152152        assert( (uintptr_t)stp % Alignment == 0 );
    153153        printf( "CFA memalign %d %g\n", stp->x, stp->y );
     
    166166        free( stp );
    167167
    168         stp = (aligned_alloc( Alignment )){ 42, 42.5 };     // CFA aligned_alloc
     168        stp = &(*aligned_alloc( Alignment )){ 42, 42.5 };     // CFA aligned_alloc
    169169        assert( (uintptr_t)stp % Alignment == 0 );
    170170        printf( "CFA aligned_alloc %d %g\n", stp->x, stp->y );
    171171        free( stp );
    172172
    173         stp = (align_alloc( Alignment )){ 42, 42.5 };       // CFA align_alloc
     173        stp = &(*align_alloc( Alignment )){ 42, 42.5 };       // CFA align_alloc
    174174        assert( (uintptr_t)stp % Alignment == 0 );
    175175        printf( "CFA align_alloc %d %g\n", stp->x, stp->y );
Note: See TracChangeset for help on using the changeset viewer.