Changeset c3a2007 for tests


Ignore:
Timestamp:
Oct 28, 2019, 4:28:37 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
8364209
Parents:
c921712 (diff), 9bdb8b7 (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:
11 edited

Legend:

Unmodified
Added
Removed
  • tests/.expect/alloc-ERROR.txt

    rc921712 rc3a2007  
    1 alloc.cfa:265:1 error: No reasonable alternatives for expression Applying untyped:
     1alloc.cfa:311:1 error: No reasonable alternatives for expression Applying untyped:
    22  Name: ?=?
    33...to:
     
    1919
    2020
    21 alloc.cfa:266:1 error: No reasonable alternatives for expression Applying untyped:
     21alloc.cfa:312:1 error: No reasonable alternatives for expression Applying untyped:
    2222  Name: ?=?
    2323...to:
     
    3939
    4040
    41 alloc.cfa:267:1 error: No reasonable alternatives for expression Applying untyped:
     41alloc.cfa:313:1 error: No reasonable alternatives for expression Applying untyped:
    4242  Name: ?=?
    4343...to:
     
    5050
    5151
    52 alloc.cfa:268:1 error: No reasonable alternatives for expression Applying untyped:
     52alloc.cfa:314:1 error: No reasonable alternatives for expression Applying untyped:
    5353  Name: ?=?
    5454...to:
  • tests/.expect/alloc.txt

    rc921712 rc3a2007  
    22CFA malloc 0xdeadbeef
    33CFA alloc 0xdeadbeef
    4 CFA alloc, fill ffffffff
     4CFA array alloc, fill 0xde
     5CFA alloc, fill dededede
     6CFA alloc, fill 3
    57
    68C   array calloc, fill 0
     
    1012CFA array alloc, no fill
    11130xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef
    12 CFA array alloc, fill 0xff
    13 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
     14CFA array alloc, fill 0xde
     150xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede
     16CFA array alloc, fill 0xef
     170xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef
     18CFA array alloc, fill from array
     190xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef,
    1420
    15 C   realloc
    16 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef
     21C realloc
     220xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef
    1723CFA realloc
    18 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101
     240xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101
    1925
    20 CFA resize alloc
     26CFA resize array alloc
    21270xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef
    2228CFA resize array alloc
     
    25310xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef
    2632CFA resize array alloc, fill
    27 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
     330xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede
    2834CFA resize array alloc, fill
    29 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
     350xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef
    3036CFA resize array alloc, fill
    31 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
     370xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede
    3238
    3339C   memalign 42 42.5
     
    3541CFA posix_memalign 42 42.5
    3642CFA posix_memalign 42 42.5
    37 CFA aligned_alloc 42 42.5
    38 CFA align_alloc 42 42.5
    39 CFA align_alloc fill 0xffffffff -nan
     43CFA alloc_align 42 42.5
     44CFA alloc_align 42 42.5
     45CFA alloc_align fill 0xdededede -0x1.ededededededep+494
     46CFA alloc_align fill 42 42.5
     47CFA alloc_align 42 42.5
    4048
    41 CFA array align_alloc
     49CFA array alloc_align
    425042 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5,
    43 CFA array align_alloc, fill
    44 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan,
     51CFA array alloc_align, fill
     520xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494,
     53CFA array alloc_align, fill
     5442 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5,
     55CFA array alloc_align, fill array
     5642 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5,
     57CFA realloc array alloc_align
     5842 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5,
    4559
    46 CFA memset 0xffffffff -nan
    47 CFA memcpy 0xffffffff -nan
     60CFA memset 0xdededede -0x1.ededededededep+494
     61CFA memcpy 0xdededede -0x1.ededededededep+494
    4862
    4963CFA array memset
    50 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan,
     640xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494,
    5165CFA array memcpy
    52 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan,
     660xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494,
    5367
    5468CFA new initialize
  • tests/.expect/attributes.x64.txt

    rc921712 rc3a2007  
    784784signed int _X4apd7Fi_Fi_i_Fi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object23)(__attribute__ ((unused)) signed int __anonymous_object24), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object25)(__attribute__ ((unused)) signed int __anonymous_object26));
    785785struct Vad {
    786     __attribute__ ((unused)) signed int __anonymous_object27:4;
    787     __attribute__ ((unused)) signed int __anonymous_object28:4;
    788     __attribute__ ((unused,unused)) signed int __anonymous_object29:6;
     786    __attribute__ ((unused)) signed int :4;
     787    __attribute__ ((unused)) signed int :4;
     788    __attribute__ ((unused,unused)) signed int :6;
    789789};
    790790static inline void _X12_constructorFv_S3Vad_autogen___1(struct Vad *_X4_dstS3Vad_1);
  • tests/.expect/attributes.x86.txt

    rc921712 rc3a2007  
    784784signed int _X4apd7Fi_Fi_i_Fi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object23)(__attribute__ ((unused)) signed int __anonymous_object24), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object25)(__attribute__ ((unused)) signed int __anonymous_object26));
    785785struct Vad {
    786     __attribute__ ((unused)) signed int __anonymous_object27:4;
    787     __attribute__ ((unused)) signed int __anonymous_object28:4;
    788     __attribute__ ((unused,unused)) signed int __anonymous_object29:6;
     786    __attribute__ ((unused)) signed int :4;
     787    __attribute__ ((unused)) signed int :4;
     788    __attribute__ ((unused,unused)) signed int :6;
    789789};
    790790static inline void _X12_constructorFv_S3Vad_autogen___1(struct Vad *_X4_dstS3Vad_1);
  • tests/Makefile.am

    rc921712 rc3a2007  
    2424archiveerrors=
    2525
    26 INSTALL_FLAGS=-in-tree
    2726DEBUG_FLAGS=-debug -O0
    2827
     
    4342        -DIN_DIR="${abs_srcdir}/.in/"
    4443
     44# get the desired cfa to test
     45TARGET_CFA = $(if $(filter $(installed),yes), @CFACC_INSTALL@, @CFACC@)
     46
    4547# adjust CC to current flags
    46 CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) -dist-tree -in-tree,@CFACC@ ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS})
     48CC = $(if $(ifeq $(DISTCC_CFA_PATH),yes),distcc $(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
    4749CFACC = $(CC)
    4850
     
    5153
    5254# adjusted CC but without the actual distcc call
    53 CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) -dist-tree -in-tree,@CFACC@ ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS})
     55CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
    5456
    5557PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
  • tests/Makefile.in

    rc921712 rc3a2007  
    214214
    215215# adjust CC to current flags
    216 CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) -dist-tree -in-tree,@CFACC@ ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS})
     216CC = $(if $(ifeq $(DISTCC_CFA_PATH),yes),distcc $(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
    217217CCAS = @CCAS@
    218218CCASDEPMODE = @CCASDEPMODE@
     
    220220CCDEPMODE = @CCDEPMODE@
    221221CFACC = $(CC)
     222CFACC_INSTALL = @CFACC_INSTALL@
    222223CFACPP = @CFACPP@
    223224CFA_BACKEND_CC = @CFA_BACKEND_CC@
     
    381382installed = no
    382383archiveerrors =
    383 INSTALL_FLAGS = -in-tree
    384384DEBUG_FLAGS = -debug -O0
    385385quick_test = avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes
     
    398398
    399399
     400# get the desired cfa to test
     401TARGET_CFA = $(if $(filter $(installed),yes), @CFACC_INSTALL@, @CFACC@)
     402
    400403# get local binary for depedencies
    401404CFACCBIN = @CFACC@
    402405
    403406# adjusted CC but without the actual distcc call
    404 CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) -dist-tree -in-tree,@CFACC@ ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS})
     407CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
    405408PRETTY_PATH = mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
    406409avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa
  • tests/alloc.cfa

    rc921712 rc3a2007  
    1010// Created On       : Wed Feb  3 07:56:22 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Nov  6 17:50:52 2018
    13 // Update Count     : 339
     12// Last Modified On : Sun Oct 20 21:45:21 2019
     13// Update Count     : 391
    1414//
    1515
     
    1919#include <stdlib.h>                                                                             // posix_memalign
    2020#include <fstream.hfa>
    21 #include <stdlib.hfa>                                                                           // access C malloc, realloc
     21#include <stdlib.hfa>                                                                   // access C malloc, realloc
    2222
    2323int * foo( int * p, int c ) { return p; }
     
    2727int main( void ) {
    2828        size_t dim = 10;
    29         char fill = '\xff';
    30         int * p;
     29        char fill = '\xde';
     30        int * p, * p1;
    3131
    3232        // allocation, non-array types
    33 
    34         // int & r = malloc();
    35         // r = 0xdeadbeef;
    36         // printf( "C   malloc %#x\n", r );
    37         // free( &r );
    3833
    3934        p = (int *)malloc( sizeof(*p) );                                        // C malloc, type unsafe
     
    5247        free( p );
    5348
    54         p = alloc( fill );                                  // CFA alloc, fill
     49        p = alloc_set( fill );                                                          // CFA alloc, fill
     50        printf( "CFA array alloc, fill %#hhx\n", fill );
    5551        printf( "CFA alloc, fill %08x\n", *p );
     52        free( p );
     53
     54        p = alloc_set( 3 );                                                                     // CFA alloc, fill
     55        printf( "CFA alloc, fill %d\n", *p );
    5656        free( p );
    5757
     
    7979        free( p );
    8080
    81         p = alloc( 2 * dim, fill );                         // CFA array alloc, fill
     81        p = alloc_set( 2 * dim, fill );                                         // CFA array alloc, fill
    8282        printf( "CFA array alloc, fill %#hhx\n", fill );
    8383        for ( i; 2 * dim ) { printf( "%#x ", p[i] ); }
    8484        printf( "\n" );
    85         // do not free
     85        free( p );
     86
     87        p = alloc_set( 2 * dim, 0xdeadbeef );                           // CFA array alloc, fill
     88        printf( "CFA array alloc, fill %#hhx\n", 0xdeadbeef );
     89        for ( i; 2 * dim ) { printf( "%#x ", p[i] ); }
     90        printf( "\n" );
     91        // do not free
     92
     93        p1 = alloc_set( 2 * dim, p );                                           // CFA array alloc, fill
     94        printf( "CFA array alloc, fill from array\n" );
     95        for ( i; 2 * dim ) { printf( "%#x %#x, ", p[i], p1[i] ); }
     96        free( p1 );
     97        printf( "\n" );
    8698
    8799
     
    90102
    91103        p = (int *)realloc( p, dim * sizeof(*p) );                      // C realloc
    92         for ( i; dim ) { p[i] = 0xdeadbeef; }
    93         printf( "C   realloc\n" );
    94         for ( i; dim ) { printf( "%#x ", p[i] ); }
    95         printf( "\n" );
     104        printf( "C realloc\n" );
     105        for ( i; dim ) { printf( "%#x ", p[i] ); }
     106        printf( "\n" );
     107        // do not free
    96108
    97109        p = realloc( p, 2 * dim * sizeof(*p) );             // CFA realloc
     
    108120        p = alloc( p, dim );                                // CFA resize array alloc
    109121        for ( i; dim ) { p[i] = 0xdeadbeef; }
    110         printf( "CFA resize alloc\n" );
    111         for ( i; dim ) { printf( "%#x ", p[i] ); }
    112         printf( "\n" );
     122        printf( "CFA resize array alloc\n" );
     123        for ( i; dim ) { printf( "%#x ", p[i] ); }
     124        printf( "\n" );
     125        // do not free
    113126
    114127        p = alloc( p, 2 * dim );                            // CFA resize array alloc
     
    117130        for ( i; 2 * dim ) { printf( "%#x ", p[i] ); }
    118131        printf( "\n" );
    119 
    120         p = alloc( p, dim );                                // CFA array alloc
     132        // do not free
     133
     134        p = alloc( p, dim );                                // CFA resize array alloc
    121135        printf( "CFA resize array alloc\n" );
    122136        for ( i; dim ) { printf( "%#x ", p[i] ); }
    123137        printf( "\n" );
    124 
    125         free( p );
    126         p = 0;
    127 
    128         p = alloc( p, dim, fill );                          // CFA array alloc, fill
     138        // do not free
     139
     140        p = alloc_set( p, 3 * dim, fill );                                      // CFA resize array alloc, fill
    129141        printf( "CFA resize array alloc, fill\n" );
    130         for ( i; dim ) { printf( "%#x ", p[i] ); }
    131         printf( "\n" );
    132 
    133         p = alloc( p, 2 * dim, fill );                      // CFA array alloc, fill
     142        for ( i; 3 * dim ) { printf( "%#x ", p[i] ); }
     143        printf( "\n" );
     144        // do not free
     145
     146        p = alloc_set( p, dim, fill );                                          // CFA resize array alloc, fill
    134147        printf( "CFA resize array alloc, fill\n" );
    135         for ( i; 2 * dim ) { printf( "%#x ", p[i] ); }
    136         printf( "\n" );
    137 
    138         p = alloc( p, dim, fill );                          // CFA array alloc, fill
     148        for ( i; dim ) { printf( "%#x ", p[i] ); }
     149        printf( "\n" );
     150        // do not free
     151
     152        p = alloc_set( p, 3 * dim, fill );                                      // CFA resize array alloc, fill
    139153        printf( "CFA resize array alloc, fill\n" );
    140         for ( i; dim ) { printf( "%#x ", p[i] );; }
     154        for ( i; 3 * dim ) { printf( "%#x ", p[i] );; }
    141155        printf( "\n" );
    142156        free( p );
     
    172186        free( stp );
    173187
    174         stp = &(*aligned_alloc( Alignment )){ 42, 42.5 };     // CFA aligned_alloc
    175         assert( (uintptr_t)stp % Alignment == 0 );
    176         printf( "CFA aligned_alloc %d %g\n", stp->x, stp->y );
    177         free( stp );
    178 
    179         stp = &(*align_alloc( Alignment )){ 42, 42.5 };       // CFA align_alloc
    180         assert( (uintptr_t)stp % Alignment == 0 );
    181         printf( "CFA align_alloc %d %g\n", stp->x, stp->y );
    182         free( stp );
    183 
    184         stp = align_alloc( Alignment, fill );               // CFA memalign, fill
    185         assert( (uintptr_t)stp % Alignment == 0 );
    186         printf( "CFA align_alloc fill %#x %a\n", stp->x, stp->y );
     188        stp = &(*alloc_align( Alignment)){ 42, 42.5 };          // CFA alloc_align
     189        assert( (uintptr_t)stp % Alignment == 0 );
     190        printf( "CFA alloc_align %d %g\n", stp->x, stp->y );
     191        free( stp );
     192
     193        stp = &(*alloc_align( Alignment )){ 42, 42.5 };         // CFA alloc_align
     194        assert( (uintptr_t)stp % Alignment == 0 );
     195        printf( "CFA alloc_align %d %g\n", stp->x, stp->y );
     196        free( stp );
     197
     198        stp = alloc_align_set( Alignment, fill );                       // CFA memalign, fill
     199        assert( (uintptr_t)stp % Alignment == 0 );
     200        printf( "CFA alloc_align fill %#x %a\n", stp->x, stp->y );
     201        free( stp );
     202
     203        stp = alloc_align_set( Alignment, (Struct){ 42, 42.5 } ); // CFA memalign, fill
     204        assert( (uintptr_t)stp % Alignment == 0 );
     205        printf( "CFA alloc_align fill %d %g\n", stp->x, stp->y );
     206        // do not free
     207
     208        stp = &(*alloc_align( stp, 4096 )){ 42, 42.5 };         // CFA realign
     209        assert( (uintptr_t)stp % 4096 == 0 );
     210        printf( "CFA alloc_align %d %g\n", stp->x, stp->y );
    187211        free( stp );
    188212
     
    191215        printf( "\n" );
    192216
    193         stp = align_alloc( Alignment, dim );                // CFA array memalign
     217        stp = alloc_align( Alignment, dim );                // CFA array memalign
    194218        assert( (uintptr_t)stp % Alignment == 0 );
    195219        for ( i; dim ) { stp[i] = (Struct){ 42, 42.5 }; }
    196         printf( "CFA array align_alloc\n" );
     220        printf( "CFA array alloc_align\n" );
    197221        for ( i; dim ) { printf( "%d %g, ", stp[i].x, stp[i].y ); }
    198222        printf( "\n" );
    199223        free( stp );
    200224
    201         stp = align_alloc( Alignment, dim, fill );          // CFA array memalign, fill
    202         assert( (uintptr_t)stp % Alignment == 0 );
    203         printf( "CFA array align_alloc, fill\n" );
     225        stp = alloc_align_set( Alignment, dim, fill );          // CFA array memalign, fill
     226        assert( (uintptr_t)stp % Alignment == 0 );
     227        printf( "CFA array alloc_align, fill\n" );
    204228        for ( i; dim ) { printf( "%#x %a, ", stp[i].x, stp[i].y ); }
     229        printf( "\n" );
     230        free( stp );
     231
     232        stp = alloc_align_set( Alignment, dim, (Struct){ 42, 42.5 } ); // CFA array memalign, fill
     233        assert( (uintptr_t)stp % Alignment == 0 );
     234        printf( "CFA array alloc_align, fill\n" );
     235        for ( i; dim ) { printf( "%d %g, ", stp[i].x, stp[i].y ); }
     236        printf( "\n" );
     237        // do not free
     238
     239        stp1 = alloc_align_set( Alignment, dim, stp );          // CFA array memalign, fill
     240        assert( (uintptr_t)stp % Alignment == 0 );
     241        printf( "CFA array alloc_align, fill array\n" );
     242        for ( i; dim ) { printf( "%d %g, ", stp1[i].x, stp1[i].y ); }
     243        printf( "\n" );
     244        free( stp1 );
     245
     246        stp = alloc_align( stp, 4096, dim );                            // CFA aligned realloc array
     247        assert( (uintptr_t)stp % 4096 == 0 );
     248        for ( i; dim ) { stp[i] = (Struct){ 42, 42.5 }; }
     249        printf( "CFA realloc array alloc_align\n" );
     250        for ( i; dim ) { printf( "%d %g, ", stp[i].x, stp[i].y ); }
    205251        printf( "\n" );
    206252        free( stp );
  • tests/concurrent/examples/quickSort.cfa

    rc921712 rc3a2007  
    1111// Created On       : Wed Dec  6 12:15:52 2017
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Fri Jun 21 08:27:45 2019
    14 // Update Count     : 172
     13// Last Modified On : Thu Oct 10 13:58:18 2019
     14// Update Count     : 176
    1515//
    1616
     
    6666                        if ( depth > 0 ) {
    6767                                depth -= 1;
    68                                 Quicksort rqs = { values, low, right, depth }; // concurrently sort upper half
    69                                 //Quicksort lqs( values, left, high, depth ); // concurrently sort lower half
    70                                 sort( values, left, high, depth );              // concurrently sort lower half
     68                                Quicksort lqs = { values, low, right, depth }; // concurrently sort lower half
     69                                Quicksort rqs = { values, left, high, depth }; // concurrently sort upper half
     70                                // Quicksort lqs = { values, low, right, depth }; // concurrently sort lower half
     71                                // sort( values, left, high, depth );           // concurrently sort upper half
    7172                        } else {
    7273                                sort( values, low, right, 0 );                  // sequentially sort lower half
     
    162163                processor processors[ (1 << depth) - 1 ] __attribute__(( unused )); // create 2^depth-1 kernel threads
    163164
    164                 int * values = alloc( size );                           // values to be sorted, too large to put on stack
    165                 for ( counter; size ) {                                         // generate unsorted numbers
     165                int * values = alloc( size );                                   // values to be sorted, too large to put on stack
     166                for ( counter; size ) {                                                 // generate unsorted numbers
    166167                        values[counter] = size - counter;                       // descending values
     168                } // for
     169                for ( int i = 0; i < 200; i +=1 ) {                             // random shuffle a few values
     170                        swap( values[rand() % size], values[rand() % size] );
    167171                } // for
    168172                {
     
    178182} // main
    179183
     184// for depth in 0 1 2 3 4 5 ; do echo "sort 500000000 values with ${depth} depth" ; time -f "%Uu %Ss %E %Mkb" a.out -t 500000000 ${depth} ; done
     185
    180186// Local Variables: //
    181187// tab-width: 4 //
  • tests/labelledExit.cfa

    rc921712 rc3a2007  
    1010// Created On       : Wed Aug 10 07:29:39 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Nov  6 17:57:42 2018
    13 // Update Count     : 4
     12// Last Modified On : Fri Oct 25 17:41:51 2019
     13// Update Count     : 7
    1414//
    1515
     
    136136        }
    137137
     138        // all nested control options, labelled exits
     139
     140  Comp: {
     141          Try: try {
     142                  For: for ( ;; ) {
     143                          While: while ( true ) {
     144                                  Do: do {
     145                                          If: if ( true ) {
     146                                                  Switch2: switch ( 3 ) {
     147                                                          case 3:
     148                                                                break Try;
     149                                                                break Comp;
     150                                                                break For;              continue For;
     151                                                                break While;    continue While;
     152                                                                break Do;               continue Do;
     153                                                                break If;
     154                                                                break Switch2;
     155                                                        } // switch
     156                                                } // if
     157                                        } while ( true );
     158                                } // while
     159                        } // for
     160                } finally {} // always executed
     161        } // compound
     162
    138163        // computed goto
    139164        // {
  • tests/pybin/settings.py

    rc921712 rc3a2007  
    9696                        distribute = False
    9797
    98                 self.string = "installed" if value else "in-tree"
    99                 self.flags  = """INSTALL_FLAGS=%s""" % ("" if value else "-in-tree")
     98                self.string = "installed" if value else "in tree"
     99                self.flags  = """installed=%s""" % ("yes" if value else "no")
    100100
    101101class Timeouts:
  • tests/pybin/tools.py

    rc921712 rc3a2007  
    343343        # make a directory for this test
    344344        # mkdir makes the parent directory only so add a dummy
    345         mkdir(os.path.join(dst, "dir"))
     345        mkdir(os.path.join(dst, name ))
    346346
    347347        # moves the files
Note: See TracChangeset for help on using the changeset viewer.