Changes in / [28762a1:c77fd8b]


Ignore:
Files:
2 added
3 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • src/tests/.expect/io.txt

    r28762a1 rc77fd8b  
    44123
    55
    6 x (1 x [2 x {3 x =4 x $5 x £6 x ¥7 x ¡8 x ¿9 x «10
    7 1, x 2. x 3; x 4! x 5? x 6% x 7¢ x 8» x 9) x 10] x 11} x
    8 x`1`x'2'x"3"x:4:x 5 x   6       x
    9 7
    10 x
    11 8
    12 x
    13 9
    14 x
    15 10
    16 x
    17 x ( 1 ) x 2 , x 3 :x: 4
    186A
    1971 2 3 4 5 6 7 8
     
    3018abc, $xyz
    3119
    32 1, 2, 3, 4
    33 1, $2, $3 ", $"
    34 1 2 3 " "
    35  1 2 3
    36 12 3
    37 123
    38 1 23
    39 1 2 3
    40 1 2 3 4 " "
    41 1, 2, 3, 4 ", "
    42 1, 2, 3, 4
     20v(27 v[27 v{27 $27 =27 £27 ¥27 ¡27 ¿27 «27
     2125, 25. 25: 25; 25! 25? 25% 25¢ 25» 25) 25] 25}
     2225'27 25`27 25"27 25 27 25
     2327 25
     2427 25
     2527 25   27 25
     2627
    43273, 4, a, 7.2
    44283, 4, a, 7.2
    45293 4 a 7.2
    46  3 4 a 7.234a7.23 4 a 7.2
     30 3 4 a 7.234a7.2 3 4 a 7.2
    47313-4-a-7.2^3^4-3-4-a-7.2
  • src/tests/Makefile.am

    r28762a1 rc77fd8b  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Thu Jun  8 07:41:43 2017
    14 ## Update Count     : 44
     13## Last Modified On : Thu May 25 14:39:15 2017
     14## Update Count     : 43
    1515###############################################################################
    1616
     
    2020
    2121if BUILD_CONCURRENCY
    22 concurrent = yes
    23 quick_test += coroutine thread monitor
    24 concurrent_test = coroutine thread monitor multi-monitor sched-int-barge sched-int-block sched-int-disjoint sched-int-wait sched-ext sched-ext-multi preempt
     22concurrent=yes
     23quick_test+= coroutine thread monitor
     24concurrent_test=coroutine thread monitor multi-monitor sched-int-barge sched-int-block sched-int-disjoint sched-int-wait sched-ext sched-ext-multi preempt
    2525else
    2626concurrent=no
     
    5757        @+python test.py --debug=${debug} --concurrent=${concurrent} ${concurrent_test}
    5858
    59 .dummy : .dummy.c @CFA_BINDIR@/@CFA_NAME@
     59.dummy : .dummy.c
    6060        ${CC} ${BUILD_FLAGS} -XCFA -n ${<} -o ${@}                              #don't use CFLAGS, this rule is not a real test
    6161
    62 
    63 % : %.c @CFA_BINDIR@/@CFA_NAME@
    64         ${CC} ${CFLAGS} ${<} -o ${@}
    65 
    66 dtor-early-exit-ERR1: dtor-early-exit.c @CFA_BINDIR@/@CFA_NAME@
     62dtor-early-exit-ERR1: dtor-early-exit.c
    6763        ${CC} ${CFLAGS} -DERR1 ${<} -o ${@}
    6864
    69 dtor-early-exit-ERR2: dtor-early-exit.c @CFA_BINDIR@/@CFA_NAME@
     65dtor-early-exit-ERR2: dtor-early-exit.c
    7066        ${CC} ${CFLAGS} -DERR2 ${<} -o ${@}
    7167
    72 declarationSpecifier: declarationSpecifier.c @CFA_BINDIR@/@CFA_NAME@
     68declarationSpecifier: declarationSpecifier.c
    7369        ${CC} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    7470
    75 gccExtensions : gccExtensions.c @CFA_BINDIR@/@CFA_NAME@
     71gccExtensions : gccExtensions.c
    7672        ${CC} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    7773
    78 extension : extension.c @CFA_BINDIR@/@CFA_NAME@
     74extension : extension.c
    7975        ${CC} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    8076
    81 attributes : attributes.c @CFA_BINDIR@/@CFA_NAME@
     77attributes : attributes.c
    8278        ${CC} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    8379
    84 KRfunctions : KRfunctions.c @CFA_BINDIR@/@CFA_NAME@
     80KRfunctions : KRfunctions.c
    8581        ${CC} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    8682
    87 gmp : gmp.c @CFA_BINDIR@/@CFA_NAME@
     83gmp : gmp.c
    8884        ${CC} ${CFLAGS} -lgmp ${<} -o ${@}
    8985
    90 memberCtors-ERR1: memberCtors.c @CFA_BINDIR@/@CFA_NAME@
     86memberCtors-ERR1: memberCtors.c
    9187        ${CC} ${CFLAGS} -DERR1 ${<} -o ${@}
    9288
    93 completeTypeError : completeTypeError.c @CFA_BINDIR@/@CFA_NAME@
     89completeTypeError : completeTypeError.c
    9490        ${CC} ${CFLAGS} -DERR1 ${<} -o ${@}
  • src/tests/Makefile.in

    r28762a1 rc77fd8b  
    661661        @+python test.py --debug=${debug} --concurrent=${concurrent} ${concurrent_test}
    662662
    663 .dummy : .dummy.c @CFA_BINDIR@/@CFA_NAME@
     663.dummy : .dummy.c
    664664        ${CC} ${BUILD_FLAGS} -XCFA -n ${<} -o ${@}                              #don't use CFLAGS, this rule is not a real test
    665665
    666 % : %.c @CFA_BINDIR@/@CFA_NAME@
    667         ${CC} ${CFLAGS} ${<} -o ${@}
    668 
    669 dtor-early-exit-ERR1: dtor-early-exit.c @CFA_BINDIR@/@CFA_NAME@
     666dtor-early-exit-ERR1: dtor-early-exit.c
    670667        ${CC} ${CFLAGS} -DERR1 ${<} -o ${@}
    671668
    672 dtor-early-exit-ERR2: dtor-early-exit.c @CFA_BINDIR@/@CFA_NAME@
     669dtor-early-exit-ERR2: dtor-early-exit.c
    673670        ${CC} ${CFLAGS} -DERR2 ${<} -o ${@}
    674671
    675 declarationSpecifier: declarationSpecifier.c @CFA_BINDIR@/@CFA_NAME@
     672declarationSpecifier: declarationSpecifier.c
    676673        ${CC} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    677674
    678 gccExtensions : gccExtensions.c @CFA_BINDIR@/@CFA_NAME@
     675gccExtensions : gccExtensions.c
    679676        ${CC} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    680677
    681 extension : extension.c @CFA_BINDIR@/@CFA_NAME@
     678extension : extension.c
    682679        ${CC} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    683680
    684 attributes : attributes.c @CFA_BINDIR@/@CFA_NAME@
     681attributes : attributes.c
    685682        ${CC} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    686683
    687 KRfunctions : KRfunctions.c @CFA_BINDIR@/@CFA_NAME@
     684KRfunctions : KRfunctions.c
    688685        ${CC} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@}
    689686
    690 gmp : gmp.c @CFA_BINDIR@/@CFA_NAME@
     687gmp : gmp.c
    691688        ${CC} ${CFLAGS} -lgmp ${<} -o ${@}
    692689
    693 memberCtors-ERR1: memberCtors.c @CFA_BINDIR@/@CFA_NAME@
     690memberCtors-ERR1: memberCtors.c
    694691        ${CC} ${CFLAGS} -DERR1 ${<} -o ${@}
    695692
    696 completeTypeError : completeTypeError.c @CFA_BINDIR@/@CFA_NAME@
     693completeTypeError : completeTypeError.c
    697694        ${CC} ${CFLAGS} -DERR1 ${<} -o ${@}
    698695
  • src/tests/coroutine.c

    r28762a1 rc77fd8b  
    1 //
    2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
    3 //
    4 // The contents of this file are covered under the licence agreement in the
    5 // file "LICENCE" distributed with Cforall.
    6 //
    7 // fibonacci.c --
    8 //
    9 // Author           : Thierry Delisle
    10 // Created On       : Thu Jun  8 07:29:37 2017
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun  8 07:37:12 2017
    13 // Update Count     : 5
    14 //
    15 
    161#include <fstream>
    172#include <coroutine>
    183
    194coroutine Fibonacci {
    20         int fn;                                         // used for communication
     5      int fn; // used for communication
    216};
    227
    23 void ?{}( Fibonacci * this ) {
    24         this->fn = 0;
     8void ?{}(Fibonacci* this) {
     9      this->fn = 0;
    2510}
    2611
    27 void main( Fibonacci * this ) {
    28         int fn1, fn2;                                   // retained between resumes
    29         this->fn = 0;                                   // case 0
    30         fn1 = this->fn;
    31         suspend();                                              // return to last resume
     12void main(Fibonacci* this) {
     13      int fn1, fn2;             // retained between resumes
     14      this->fn = 0;
     15      fn1 = this->fn;
     16      suspend();                // return to last resume
    3217
    33         this->fn = 1;                                   // case 1
    34         fn2 = fn1;
    35         fn1 = this->fn;
    36         suspend();                                              // return to last resume
     18      this->fn = 1;
     19      fn2 = fn1;
     20      fn1 = this->fn;
     21      suspend();                // return to last resume
    3722
    38         for ( ;; ) {                                    // general case
    39                 this->fn = fn1 + fn2;
    40                 fn2 = fn1;
    41                 fn1 = this->fn;
    42                 suspend();                                      // return to last resume
    43         } // for
     23      for ( ;; ) {
     24            this->fn = fn1 + fn2;
     25            fn2 = fn1;
     26            fn1 = this->fn;
     27            suspend(); // return to last resume
     28      }
    4429}
    4530
    46 int next( Fibonacci * this ) {
    47         resume( this );                                 // transfer to last suspend
    48         return this->fn;
     31int next(Fibonacci* this) {
     32      resume(this); // transfer to last suspend
     33      return this->fn;
    4934}
    5035
    5136int main() {
    52         Fibonacci f1, f2;
    53         for ( int i = 1; i <= 10; i += 1 ) {
    54                 sout | next( &f1 ) | ' ' | next( &f2 ) | endl;
    55         } // for
     37      Fibonacci f1, f2;
     38      for ( int i = 1; i <= 10; i += 1 ) {
     39            sout | next(&f1) | ' ' | next(&f2) | endl;
     40      }
     41
     42      return 0;
    5643}
    57 
    58 // Local Variables: //
    59 // tab-width: 4 //
    60 // compile-command: "cfa fibonacci.c" //
    61 // End: //
  • src/tests/io.c

    r28762a1 rc77fd8b  
    1010// Created On       : Wed Mar  2 16:56:02 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun  8 09:52:10 2017
    13 // Update Count     : 51
     12// Last Modified On : Tue Mar 21 22:36:06 2017
     13// Update Count     : 48
    1414//
    1515
     
    1717
    1818int main() {
    19         char c;                                                                                         // basic types
     19        char c;                                                                                                         // basic types
    2020        short int si;
    2121        unsigned short int usi;
     
    3232        double _Complex dc;
    3333        long double _Complex ldc;
    34         enum { size = 10 };
    35         char s1[size], s2[size];
     34        char s1[10], s2[10];
    3635
    3736        int x = 3, y = 5, z = 7;
     
    4241        sout | endl;
    4342
     43        ifstream in;                                                                                            // create / open file
     44        open( &in, "io.data", "r" );
     45
     46        &in | &c                                                                                                        // character
     47                | &si | &usi | &i | &ui | &li | &uli | &lli | &ulli             // integral
     48                | &f | &d | &ld                                                                                 // floating point
     49                | &fc | &dc | &ldc                                                                              // floating-point complex
     50                | cstr( s1 ) | cstr( s2, 10 );                                                  // C string, length unchecked and checked
     51
     52        sout | c | ' ' | endl                                                                           // character
     53                 | si | usi | i | ui | li | uli | lli | ulli | endl             // integral
     54                 | f | d | ld | endl                                                                    // floating point
     55                 | fc | dc | ldc | endl;                                                                // complex
     56        sout | endl;
     57        sout | f | "" | d | "" | ld | endl                                                      // floating point without separator
     58                 | sepDisable | fc | dc | ldc | sepEnable | endl                // complex without separator
     59                 | sepOn | s1 | sepOff | s2 | endl                                              // local separator removal
     60                 | s1 | "" | s2 | endl;                                                                 // C string without separator
     61        sout | endl;
     62
     63        sepSet( sout, ", $" );                                                                          // change separator, maximum of 15 characters
     64        sout | f | d | ld | endl
     65                 | fc | dc | ldc | endl
     66                 | s1 | s2 | endl;
     67        sout | endl;
     68        sepSet( sout, " " );
     69
    4470        sout
    4571                // opening delimiters
    46                 | "x (" | 1
    47                 | "x [" | 2
    48                 | "x {" | 3
    49                 | "x =" | 4
    50                 | "x $" | 5
    51                 | "x £" | 6
    52                 | "x ¥" | 7
    53                 | "x ¡" | 8
    54                 | "x ¿" | 9
    55                 | "x «" | 10
     72                | "v(" | 27
     73                | "v[" | 27
     74                | "v{" | 27
     75                | "$" | 27
     76                | "=" | 27
     77                | "£" | 27
     78                | "¥" | 27
     79                | "¡" | 27
     80                | "¿" | 27
     81                | "«" | 27
     82                | endl
     83                // closing delimiters
     84                | 25 | ","
     85                | 25 | "."
     86                | 25 | ":"
     87                | 25 | ";"
     88                | 25 | "!"
     89                | 25 | "?"
     90                | 25 | "%"
     91                | 25 | "¢"
     92                | 25 | "»"
     93                | 25 | ")"
     94                | 25 | "]"
     95                | 25 | "}"
     96                | endl
     97                // opening-closing delimiters
     98                | 25 | "'" | 27
     99                | 25 | "`" | 27
     100                | 25 | "\"" | 27
     101                | 25 | " " | 27
     102                | 25 | "\f" | 27
     103                | 25 | "\n" | 27
     104                | 25 | "\r" | 27
     105                | 25 | "\t" | 27
     106                | 25 | "\v" | 27
    56107                | endl;
    57         sout
    58                 // closing delimiters
    59                 | 1 | ", x"
    60                 | 2 | ". x"
    61                 | 3 | "; x"
    62                 | 4 | "! x"
    63                 | 5 | "? x"
    64                 | 6 | "% x"
    65                 | 7 | "¢ x"
    66                 | 8 | "» x"
    67                 | 9 | ") x"
    68                 | 10 | "] x"
    69                 | 11 | "} x"
    70                 | endl;
    71         sout
    72                 // opening-closing delimiters
    73                 | "x`" | 1 | "`x'" | 2
    74                 | "'x\"" | 3 | "\"x:" | 4
    75                 | ":x " | 5 | " x\t" | 6
    76                 | "\tx\f" | 7 | "\fx\v" | 8
    77                 | "\vx\n" | 9 | "\nx\r" | 10
    78                 | "\rx" |
    79                 endl;
    80         sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4 | endl;
    81108
    82         ifstream in;                                                                            // create / open file
    83         open( &in, "io.data", "r" );
    84 
    85         &in | &c                                                                                        // character
    86                 | &si | &usi | &i | &ui | &li | &uli | &lli | &ulli     // integral
    87                 | &f | &d | &ld                                                                 // floating point
    88                 | &fc | &dc | &ldc                                                              // floating-point complex
    89                 | cstr( s1 ) | cstr( s2, size );                                // C string, length unchecked and checked
    90 
    91         sout | c | ' ' | endl                                                           // character
    92                 | si | usi | i | ui | li | uli | lli | ulli | endl // integral
    93                 | f | d | ld | endl                                                             // floating point
    94                 | fc | dc | ldc | endl;                                                 // complex
    95         sout | endl;
    96         sout | f | "" | d | "" | ld | endl                                      // floating point without separator
    97                 | sepDisable | fc | dc | ldc | sepEnable | endl // complex without separator
    98                 | sepOn | s1 | sepOff | s2 | endl                               // local separator removal
    99                 | s1 | "" | s2 | endl;                                                  // C string without separator
    100         sout | endl;
    101 
    102         sepSet( sout, ", $" );                                                          // change separator, maximum of 15 characters
    103         sout | f | d | ld | endl
    104                 | fc | dc | ldc | endl
    105                 | s1 | s2 | endl;
    106         sout | endl;
    107 
    108         [int, int] t1 = [1, 2], t2 = [3, 4];
    109         sout | t1 | t2 | endl;                                                          // print tuple
    110 
    111         sepSet( sout, " " );
    112         sepSet( sout, ", $" );                                                          // set separator from " " to ", $"
    113         sout | 1 | 2 | 3 | " \"" | sepGet( sout ) | "\"" | endl;
    114         sepSet( sout, " " );                                                            // reset separator to " "
    115         sout | 1 | 2 | 3 | " \"" | sepGet( sout ) | "\"" | endl;
    116 
    117         sout | sepOn | 1 | 2 | 3 | sepOn | endl;                        // separator at start of line
    118         sout | 1 | sepOff | 2 | 3 | endl;                                       // locally turn off implicit separator
    119 
    120         sout | sepDisable | 1 | 2 | 3 | endl;                           // globally turn off implicit separation
    121         sout | 1 | sepOn | 2 | 3 | endl;                                        // locally turn on implicit separator
    122         sout | sepEnable | 1 | 2 | 3 | endl;                            // globally turn on implicit separation
    123 
    124         sepSetTuple( sout, " " );                                                       // set tuple separator from ", " to " "
    125         sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\"" | endl;
    126         sepSetTuple( sout, ", " );                                                      // reset tuple separator to ", "
    127         sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\"" | endl;
    128 
    129         sout | t1 | t2 | endl;                                                          // print tuple
    130 
    131         [int, int, const char *, double] t3 = { 3, 4, "a", 7.2 };
     109        [int, int, const char *, double] t = { 3, 4, "a", 7.2 };
    132110        sout | [ 3, 4, "a", 7.2 ] | endl;
    133         sout | t3 | endl;
     111        sout | t | endl;
    134112        sepSetTuple( sout, " " );
    135         sout | t3 | endl;
    136         sout | sepOn | t3 | sepDisable | t3 | sepEnable | t3 | endl;
     113        sout | t | endl;
     114        sout | sepOn | t | sepDisable | t | sepEnable | t | endl;
    137115        sepSet( sout, "^" );
    138116        sepSetTuple( sout, "-" );
    139         sout | t3 | 3 | 4 | t3 | endl;
     117        sout | t | 3 | 4 | t | endl;
    140118}
    141119
Note: See TracChangeset for help on using the changeset viewer.