Changeset 506d4f0 for tests


Ignore:
Timestamp:
Oct 1, 2020, 8:17:34 AM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
17b6fc9, ebec8ed
Parents:
e96e439
Message:

updated zombie programs but still not ready for prime time

Location:
tests/zombies
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • tests/zombies/Rank2.c

    re96e439 r506d4f0  
    1 int ?=?( int *, int );
    2 forall(dtype DT) DT * ?=?( DT **, DT * );
     1int ?=?( int &, int );
     2forall(dtype DT) DT * ?=?( DT *&, DT * );
    33
    44void a() {
     
    1111        void h( int *null );
    1212        forall( otype T ) T id( T );
    13         forall( dtype T ) T *0;
    14         int 0;
     13//      forall( dtype T ) T *0;
     14//      int 0;
    1515        h( id( id( id( 0 ) ) ) );
    1616}
  • tests/zombies/Tuple.c

    re96e439 r506d4f0  
    4646        [ 3, 5 ];
    4747        [ a, b ] = 3;
    48 //      [ a, b ] = [ 4.6 ];
     48        [ a, b ] = [ 4.6 ];
    4949        [ a, b ] = 4.6;
    5050        [ a, b ] = [ c, d ] = [ 3, 5 ];
     
    5959        [ a, b ] = t1 = [ c, d ];
    6060        [ a, b ] = t1 = t2 = [ c, d ];
    61 //      t1 = [ 3, 4 ] = [ 3, 4 ] = t1 = [ 3, 4 ];
     61        t1 = [ 3, 4 ] = [ 3, 4 ] = t1 = [ 3, 4 ];
    6262
    6363        s.[ f1, i.[ f2, f3 ], f4 ] = [ 11, 12, 13, 3.14159 ];
     
    6565//      [ a, , b, ] = h( 3, 3, 0, "abc" );                      /* ignore some results */
    6666        sp->[ f4, f1 ] = sp->[ f1, f4 ];
    67         printf( "expecting 3, 17, 23, 4; got %d, %d, %d, %d\n", s.[ f4, i.[ f3, f2 ], f1 ] );
     67        printf( "expecting 3, 17, 23, 4; got %g, %d, %d, %d\n", s.[ f4, i.[ f3, f2 ], f1 ] );
    6868        rc = 0;
    6969}
  • tests/zombies/abstype.c

    re96e439 r506d4f0  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jun 14 14:27:48 2016
    13 // Update Count     : 9
     12// Last Modified On : Wed Sep 30 13:55:47 2020
     13// Update Count     : 10
    1414//
    1515
     
    2121}
    2222
    23 forall( otype T ) lvalue T *?( T * );
     23forall( otype T ) T *?( T * );
    2424int ?++( int * );
    2525int ?=?( int *, int );
  • tests/zombies/constructors.c

    re96e439 r506d4f0  
    1 int fred() {
     1#include <fstream.hfa>
     2#include <stdlib.hfa>
     3
     4int main() {
    25    // initialize basic structure
    36    struct S {
    47        int i, j, k;
    58    };
    6     void ?{}( S *s ) { s->i = 1, s->k = 2; }            // default constructor
    7     void ?{}( S *s, int i, int k ) { s->i = i, s->k = k; } // 2 parameter constructor
    8     void ?{}( S *s, S c ) { *s = c; }                   // copy constructor
    9     void ^?{}( S *s ) { s->i = 0, s->k = 0; }           // default destructor
    10     void ^?{}( S *s, int i ) { s->i = i, s->k = i; }    // 1 parameter destructor
     9    void ?{}( S & s ) { s.i = 1, s.k = 2; }             // default constructor
     10    void ?{}( S & s, int i, int k ) { s.i = i, s.k = k; } // 2 parameter constructor
     11    void ?{}( S & s, S c ) { /* s @= c */ s.[i,j,k] = c.[i,j,k]; } // copy constructor
     12    void ^?{}( S & s ) { s.i = 0, s.k = 0; }            // default destructor
     13    void ^?{}( S & s, int i ) { s.i = i, s.k = i; }     // 1 parameter destructor
    1114    {
    12         S s1;                   // default constructor
    13         S s2 = { 3, 7 };        // 2 parameter constructor
    14         S s3 @= { .k:3, .i:7 }; // 2 parameter C initialization
    15         ?{}( &s3, 2, 5 );       // explicit 2 parameter constructor
    16         ^?{}( &s1 );            // explicit call to default destructor
     15        S s1;                                           // default constructor
     16        S s2 = { 3, 7 };                                // 2 parameter constructor
     17        S s3 @= { .k:3, .i:7 };                         // 2 parameter C initialization
     18        ?{}( s3, 2, 5 );                                // explicit 2 parameter constructor
     19        ^?{}( s1 );                                     // explicit call to default destructor
    1720    } // implicit call to default destructor for s2, explicit call s1, no call for s3
    18     S s4 @= {};                 // no default construction
    19     (&s4){ 2, 5 };              // explicit 2 parameter constructor
    20     ^s4{ 3 };                   // explicit call to 1 parameter destructor
     21    S s4 @= {};                                         // no default construction
     22    (s4){ 2, 5 };                                       // explicit 2 parameter constructor
     23    ^s4{ 3 };                                           // explicit call to 1 parameter destructor
    2124
    2225    // initialize pointer to a basic structure
    2326
    24     void ?{}( S **s ) { *s = malloc(); (*s)->i = 1, (*s)->k = 2; } // default constructor
    25     void ?{}( S **s, int i, int k ) { *s = malloc(); (*s)->i = i, (*s)->k = k; } // 2 parameter constructor
    26     void ^?{}( S **s ) { (*s)->i = 0, (*s)->k = 0; free( *s ); *s = 0; } // default destructor
     27    void ?{}( S *& s ) { s = malloc(); s->i = 1, (*s).k = 2; } // default constructor
     28    void ?{}( S *& s, int i, int k ) { s = malloc(); (*s).i = i, (*s).k = k; } // 2 parameter constructor
     29    void ^?{}( S *& s ) { (*s).i = 0, (*s).k = 0; free( s ); &s = 0p; } // default destructor
    2730    {
    28         S *ps1;                 // default constructor
    29         S *ps2 = { 3, 7 };      // 2 parameter constructor
    30         S *ps3 @= 0;            // C initialization
    31         S *ps4 @= {};           // no default construction
     31        S * ps1;                                        // default constructor
     32        S * ps2 = { 3, 7 };                             // 2 parameter constructor
     33        sout | ps1 | ps2;
     34
     35        S * ps3 @= 0p;                                  // C initialization
     36        S * ps4 @= { 3 };                               // no default construction
     37        sout | ps3 | ps4;
     38
     39        ?{}( ps3, 2, 5 );                               // explicit 2 parameter constructor
     40        (ps4){ 2, 5 };                                  // explicit 2 parameter constructor
     41        sout | ps3 | ps4;
     42
     43        ^?{}( ps3 );                                    // explicit call to default destructor
     44        ^ps4{};                                         // explicit call to default destructor
     45        sout | ps3 | ps4;
    3246    } // implicit call to default destructor for ps2 and ps1, checks ordering of explicit destructor calls
    33 
    34     ?{}( &ps3, 2, 5 );          // explicit 2 parameter constructor
    35     (&ps4){ 2, 5 };             // explicit 2 parameter constructor
    36    
    37     ^?{}( &ps3 );               // explicit call to default destructor
    38     ^ps4{};                     // explicit call to default destructor
    3947
    4048    // initialize complex structure
     
    4452    };
    4553
    46     void ?{}( T *t ) {}                                 // default constructor => implicitly call constructor for field s
    47     void ?{}( T *t, int i, int k ) { (&t->s){ i, k }; } // 2 parameter constructor => explicitly call constructor for field s
    48     void ?{}( T *t, S c ) { (&t->s){ c }; }             // 1 parameter constructor => explicitly call copy constructor for field s
    49     void ^?{}( T *s, int i ) {}                         // destructor => implicitly call destructor for field s
     54    void ?{}( T & t ) {}        // default constructor => implicitly call constructor for field s
     55    void ?{}( T & t, int i, int k ) { (t.s){ i, k }; } // 2 parameter constructor => explicitly call constructor for field s
     56    void ?{}( T & t, S c ) { (t.s){ c }; }// 1 parameter constructor => explicitly call copy constructor for field s
     57    void ^?{}( T & s ) {}       // destructor => implicitly call destructor for field s
     58    void ^?{}( T & s, int i ) {}// destructor => implicitly call destructor for field s
    5059    {
    51         S s;                    // default constructor
    52         T t1;                   // default constructor
    53         T t2 = { s };           // 1 parameter constructor
    54         ^?{}( &t1 );            // explicit call to default destructor => implicit call to t1.s's destructor
     60        S s;                                            // default constructor
     61        T t1;                                           // default constructor
     62        T t2 = { s };                                   // 1 parameter constructor
     63        ^?{}( t1, 3 );                                  // explicit call to default destructor => implicit call to t1.s's destructor
     64        T t3;                                           // default constructor
     65        T t4 @= { { 1, 3 } };                           // C initialization
     66        (t4){ 2, 5 };                                   // explicit 2 parameter constructor
    5567    } // implicit call to default destructor for t2 and implicit call for s;
    56     T t3;                       // default constructor
    57     T t4 @= { { 1, 3 } };       // C initialization
    58     (&t4){ 2, 5 };              // explicit 2 parameter constructor
    5968
    6069    T *pt = malloc(){ 3, 4 };   // common usage
  • tests/zombies/includes.c

    re96e439 r506d4f0  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Nov 15 23:06:24 2017
    13 // Update Count     : 597
     12// Last Modified On : Wed Sep 30 13:59:18 2020
     13// Update Count     : 598
    1414//
    1515
     
    2424#if 1
    2525#define _GNU_SOURCE
    26 #include <a.out.h>
    27 #include <aio.h>
    28 #include <aliases.h>
    29 #include <alloca.h>
    30 #include <ansidecl.h>
    31 #include <ar.h>
    32 #include <argp.h>
    33 #include <argz.h>
    34 #include <assert.h>
    35 //#include <bfd.h>
    36 // #include <bfdlink.h>                         // keyword with
    37 #include <byteswap.h>
    38 #include <bzlib.h>
    39 #include <cblas.h>
    40 #include <cblas_f77.h>
    41 #include <complex.h>
    42 #include <com_err.h>
    43 #include <cpio.h>
    44 #include <crypt.h>
    45 #include <ctype.h>
    46 #include <curses.h>
    47 #include <dialog.h>
    48 #include <dirent.h>
    49 #include <dis-asm.h>
    50 #include <dlfcn.h>
    51 #include <dlg_colors.h>
    52 #include <dlg_config.h>
    53 #include <dlg_keys.h>
    54 #include <elf.h>
    55 #include <endian.h>
    56 #include <envz.h>
    57 #include <err.h>
    58 #include <errno.h>
    59 #include <error.h>
    60 #include <eti.h>
    61 #include <evdns.h>
    62 #include <event.h>
     26// #include <a.out.h>
     27// #include <aio.h>
     28// #include <aliases.h>
     29// #include <alloca.h>
     30// #include <ansidecl.h>
     31// #include <ar.h>
     32// #include <argp.h>
     33// #include <argz.h>
     34// #include <assert.h>
     35// #include <bfd.h>
     36// #include <bfdlink.h>                                                                 // keyword with
     37// #include <byteswap.h>
     38// #include <bzlib.h>
     39// #include <cblas.h>
     40// #include <cblas_f77.h>
     41// #include <complex.h>
     42// #include <com_err.h>
     43// #include <cpio.h>
     44
     45// #include <crypt.h>
     46// #include <ctype.h>
     47// #include <curses.h>
     48// #include <dialog.h>
     49// #include <dirent.h>
     50// #include <dis-asm.h>
     51// #include <dlfcn.h>
     52// #include <dlg_colors.h>
     53// #include <dlg_config.h>
     54// #include <dlg_keys.h>
     55// #include <elf.h>
     56// #include <endian.h>
     57// #include <envz.h>
     58// #include <err.h>
     59// #include <errno.h>
     60// #include <error.h>
     61// #include <eti.h>
     62// #include <evdns.h>
     63// #include <event.h>
    6364
    6465// #include <evhttp.h>
    6566// #include <sys/queue.h>
    66 // #include <evrpc.h>                                   // evrpc.h depends on sys/queue.h
     67// #include <evrpc.h>                                                                           // evrpc.h depends on sys/queue.h
    6768// #include <evutil.h>
    6869// #include <execinfo.h>
     
    8081// #include <fts.h>
    8182// #include <ftw.h>
     83
    8284// #include <gconv.h>
    8385// #include <getopt.h>
     
    8991// #include <gshadow.h>
    9092// #include <gssapi.h>
    91 // #include <hwloc.h>                                   // keyword thread (setjmp)
     93#include <hwloc.h>                                                                              // keyword thread (setjmp)
    9294// #include <iconv.h>
    9395// #include <idna.h>
Note: See TracChangeset for help on using the changeset viewer.