Changeset a0dcd2e


Ignore:
Timestamp:
Jun 20, 2016, 3:03:18 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
21eb693
Parents:
9724df0
Message:

update test programs, half done

Location:
src/tests
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • src/tests/Cast.c

    r9724df0 ra0dcd2e  
    99        (int)f;
    1010        (void(*)())f;
    11         ([long, long double, *[]()])([f, f, f]);
     11//      ([long, long double, *[]()])([f, f, f]);
    1212}
    1313
  • src/tests/CommentMisc.c

    r9724df0 ra0dcd2e  
    1 /* single line */
    2 // single line
    3 
    4 // single line containing */
    5 // single line containing /*
    6 // single line containing /* */
    7 
    8 /* 1st */ int i;
    9 int i; /* 2nd */
    10 /* 1st */ int i; /* 2nd */
    11 /* 1st */ /* 2nd */
    12 
    13 /* 1st
    14    2nd */ int i;
    15 
    16 /*
    17 */
    18 
    19 /*
    20 
    21 */
    22 
    23 /*
    24   1st
    25 */
    26 
    27 /*
    28   1st
    29   2nd
    30 */
    31 
    32 // ignore preprocessor directives
    33 
    34 #line 2
    35  #
    36  #include <fred>
    37         #define mary abc
    38 
    391// alternative ANSI99 brackets
    402
  • src/tests/Constant0-1.c

    r9724df0 ra0dcd2e  
    1 //Constant test declaration
    2 // Cforall extension
     1// Constant test declaration
    32
    43// value
     
    65int 0;
    76const int 0;
    8 static const int 0;
    97int 1;
    108const int 1;
    11 static const int 1;
    12 int 0, 1;
    13 const int 0, 1;
     9struct { int i; } 0;
     10const struct { int i; } 1;
     11
     12#ifdef DUPS
     13
     14int 0;
     15const int 0;
     16int 1;
     17const int 1;
    1418int (0), (1);
    1519int ((0)), ((1));
    16 static const int 0, 1;
     20const int 0, 1;
     21const int (0), (1);
    1722struct { int i; } 0;
    1823const struct { int i; } 1;
    19 static const struct { int i; } 1;
     24
     25#endif // DUPS
     26
     27#ifndef NEWDECL
    2028
    2129// pointer
     30
     31int *0, *1;
     32int * const (0), * const 1;
     33struct { int i; } *0;
     34const struct { int i; } *0;
     35int (*(* const x)), **0;
     36
     37#ifdef DUPS
    2238
    2339int *0, *1;
     
    2844int (* const 0), (* const 1);
    2945int ((* const 0)), ((* const 1));
     46int (*(* const x)), *(*0);
     47int (*(* const x)), (*(*0));
    3048struct { int i; } *0;
     49const struct { int i; } *0;
     50int (*(* const x)), **0;
     51
     52#endif // DUPS
     53
     54#else
    3155
    3256// Cforall style
     
    3458* int x, 0;
    3559const * int x, 0;
    36 static const * int x, 0;
    3760* struct { int i; } 0;
    3861const * struct { int i; } 0;
    39 static const * struct { int i; } 0;
    40 static * int x, 0;
    41 static const * int x, 0;
    4262const * * int x, 0;
    4363
     64#ifdef DUPS
     65
     66* int x, 0;
     67const * int x, 0;
     68
     69#endif // DUPS
     70
     71#endif // NEWDECL
     72
    4473int main() {
     74#ifndef NEWDECL
    4575    int 1, * 0;
     76#else
    4677    * int x, 0;
     78#endif // NEWDECL
    4779}
  • src/tests/Context.c

    r9724df0 ra0dcd2e  
    1 //cforall context declaration
    2 context has_q( otype T ) {
     1// trait declaration
     2trait has_q( otype T ) {
    33        T q( T );
    44};
    55
    66forall( otype z | has_q( z ) ) void f() {
    7         context has_r( otype T, otype U ) {
     7        trait has_r( otype T, otype U ) {
    88                T r( T, T (T,U) );
    99        };
  • src/tests/Exception.c

    r9724df0 ra0dcd2e  
    1010    try {
    1111        x/4;
    12     } catch( int) {
     12    } catch( int ) {
    1313    } catch( int x ) {
    1414    } catch( struct { int i; } ) {
  • src/tests/Expression.c

    r9724df0 ra0dcd2e  
    1 int fred() {
    2     struct s { int i; } *p;
    3     int i;
     1int main() {
     2    struct s { int i; } x, *p = &x;
     3    int i = 3;
    44
    5     // order of evaluation (GCC is different)
    6 /*
    7     i = sizeof( (int) {3} );
    8     i = sizeof (int) {3};
    9 */
    105    // operators
    116
     
    4237    i||i;
    4338    p->i;
    44     i+=i;
    45     i-=i;
    4639    i*=i;
    4740    i/=i;
    4841    i%=i;
     42    i+=i;
     43    i-=i;
    4944    i&=i;
    5045    i|=i;
     
    5449
    5550    i?i:i;
    56 
    57     // cast
    58 /*
    59     double d;
    60     int *ip;
    61     (int *) i;
    62     (* int) i;
    63     ([char, int *])[d, d];
    64     [i,ip,ip] = ([int, * int, int *])[1,(void *)2,(void *)3];
    65     [i,ip,ip] = ([int, * int, int *])([1,(void *)2,(void *)3]);
    66 */
    67 }
    68 
    69 //Dummy main
    70 int main(int argc, char const *argv[])
    71 {
    72         return 0;
    73 }
     51} // main
  • src/tests/Forall.c

    r9724df0 ra0dcd2e  
    4646}
    4747
    48 context sumable( otype T ) {
     48trait sumable( otype T ) {
    4949        const T 0;
    5050        T ?+?(T, T);
  • src/tests/Makefile.am

    r9724df0 ra0dcd2e  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon Jan 25 22:31:42 2016
    14 ## Update Count     : 25
     13## Last Modified On : Mon Jun 20 14:30:52 2016
     14## Update Count     : 33
    1515###############################################################################
    1616
     
    2323vector_test_SOURCES = vector/vector_int.c vector/array.c vector/vector_test.c
    2424avl_test_SOURCES = avltree/avl_test.c avltree/avl0.c avltree/avl1.c avltree/avl2.c avltree/avl3.c avltree/avl4.c avltree/avl-private.c
     25
     26Constant0-1DP : Constant0-1.c
     27        ${CC} ${CFLAGS} -DDUPS ${<} -o ${@}
     28
     29Constant0-1ND : Constant0-1.c
     30        ${CC} ${CFLAGS} -DNEWDECL ${<} -o ${@}
     31
     32Constant0-1NDDP : Constant0-1.c
     33        ${CC} ${CFLAGS} -DNEWDECL -DDUPS ${<} -o ${@}
  • src/tests/Makefile.in

    r9724df0 ra0dcd2e  
    621621
    622622
     623Constant0-1DP : Constant0-1.c
     624        ${CC} ${CFLAGS} -DDUPS ${<} -o ${@}
     625
     626Constant0-1ND : Constant0-1.c
     627        ${CC} ${CFLAGS} -DNEWDECL ${<} -o ${@}
     628
     629Constant0-1NDDP : Constant0-1.c
     630        ${CC} ${CFLAGS} -DNEWDECL -DDUPS ${<} -o ${@}
     631
    623632# Tell versions [3.59,3.63) of GNU make to not export all variables.
    624633# Otherwise a system limit (for SysV at least) may be exceeded.
Note: See TracChangeset for help on using the changeset viewer.