Changeset cde3891 for tests


Ignore:
Timestamp:
Jan 23, 2019, 4:52:16 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
a200795
Parents:
9b086ca (diff), 1d832f4 (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' into cleanup-dtors

Location:
tests
Files:
15 added
16 deleted
25 edited
125 moved

Legend:

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

    r9b086ca rcde3891  
    1 alloc.c:265:1 error: No reasonable alternatives for expression Applying untyped:
     1alloc.cfa:265:1 error: No reasonable alternatives for expression Applying untyped:
    22  Name: ?=?
    3 ...to: 
     3...to:
    44  Name: p
    5   Applying untyped: 
     5  Applying untyped:
    66    Name: realloc
    7   ...to: 
     7  ...to:
    88    Name: stp
    9     Applying untyped: 
     9    Applying untyped:
    1010      Name: ?*?
    11     ...to: 
     11    ...to:
    1212      Name: dim
    13       Sizeof Expression on: Applying untyped: 
     13      Sizeof Expression on: Applying untyped:
    1414          Name: *?
    15         ...to: 
     15        ...to:
    1616          Name: stp
    1717
     
    1919
    2020
    21 alloc.c:266:1 error: No reasonable alternatives for expression Applying untyped:
     21alloc.cfa:266:1 error: No reasonable alternatives for expression Applying untyped:
    2222  Name: ?=?
    23 ...to: 
     23...to:
    2424  Name: p
    25   Applying untyped: 
     25  Applying untyped:
    2626    Name: alloc
    27   ...to: 
     27  ...to:
    2828    Name: stp
    29     Applying untyped: 
     29    Applying untyped:
    3030      Name: ?*?
    31     ...to: 
     31    ...to:
    3232      Name: dim
    33       Sizeof Expression on: Applying untyped: 
     33      Sizeof Expression on: Applying untyped:
    3434          Name: *?
    35         ...to: 
     35        ...to:
    3636          Name: stp
    3737
     
    3939
    4040
    41 alloc.c:267:1 error: No reasonable alternatives for expression Applying untyped:
     41alloc.cfa:267:1 error: No reasonable alternatives for expression Applying untyped:
    4242  Name: ?=?
    43 ...to: 
     43...to:
    4444  Name: p
    45   Applying untyped: 
     45  Applying untyped:
    4646    Name: memset
    47   ...to: 
     47  ...to:
    4848    Name: stp
    4949    constant expression (10 10: signed int)
    5050
    5151
    52 alloc.c:268:1 error: No reasonable alternatives for expression Applying untyped:
     52alloc.cfa:268:1 error: No reasonable alternatives for expression Applying untyped:
    5353  Name: ?=?
    54 ...to: 
     54...to:
    5555  Name: p
    56   Applying untyped: 
     56  Applying untyped:
    5757    Name: memcpy
    58   ...to: 
     58  ...to:
    5959    Address of:
    6060      Name: st1
  • tests/.expect/castError.txt

    r9b086ca rcde3891  
    1 castError.c:7:1 error: Cannot choose between 3 alternatives for expression
     1castError.cfa:7:1 error: Cannot choose between 3 alternatives for expression
    22Cast of:
    33  Name: f
    44... to:
    5   charAlternatives are:
    6 Cost ( 1, 0, 0, 0 ): Cast of:
     5  char Alternatives are:
     6Cost ( 1, 0, 0, 0, 0, 0 ): Cast of:
    77     Variable Expression: f: function
    88       accepting unspecified arguments
    9      ... returning nothing 
     9     ... returning nothing
    1010
    1111   ... to:
     
    1414   char
    1515 )
    16  Environment: 
     16 Environment:
    1717
    18 Cost ( 1, 0, 0, 0 ): Cast of:
     18Cost ( 1, 0, 0, 0, 0, 0 ): Cast of:
    1919     Variable Expression: f: double
    2020   ... to:
     
    2323   char
    2424 )
    25  Environment: 
     25 Environment:
    2626
    27 Cost ( 1, 0, 0, 0 ): Cast of:
     27Cost ( 1, 0, 0, 0, 0, 0 ): Cast of:
    2828     Variable Expression: f: signed int
    2929   ... to:
     
    3232   char
    3333 )
    34  Environment: 
     34 Environment:
    3535
    3636
  • tests/.expect/completeTypeError.txt

    r9b086ca rcde3891  
    1 completeTypeError.c:33:1 error: No reasonable alternatives for expression Applying untyped:
     1completeTypeError.cfa:33:1 error: No reasonable alternatives for expression Applying untyped:
    22  Name: *?
    3 ...to: 
     3...to:
    44  Name: v
    55
    6 completeTypeError.c:34:1 error: No reasonable alternatives for expression Applying untyped:
     6completeTypeError.cfa:34:1 error: No reasonable alternatives for expression Applying untyped:
    77  Name: *?
    8 ...to: 
     8...to:
    99  Name: y
    1010
    11 completeTypeError.c:35:1 error: No reasonable alternatives for expression Applying untyped:
     11completeTypeError.cfa:35:1 error: No reasonable alternatives for expression Applying untyped:
    1212  Name: foo
    13 ...to: 
     13...to:
    1414  Name: v
    1515
    16 completeTypeError.c:36:1 error: No reasonable alternatives for expression Applying untyped:
     16completeTypeError.cfa:36:1 error: No reasonable alternatives for expression Applying untyped:
    1717  Name: baz
    18 ...to: 
     18...to:
    1919  Name: v
    2020
    21 completeTypeError.c:37:1 error: No reasonable alternatives for expression Applying untyped:
     21completeTypeError.cfa:37:1 error: No reasonable alternatives for expression Applying untyped:
    2222  Name: quux
    23 ...to: 
     23...to:
    2424  Name: v
    2525
    26 completeTypeError.c:58:1 error: No reasonable alternatives for expression Applying untyped:
     26completeTypeError.cfa:58:1 error: No reasonable alternatives for expression Applying untyped:
    2727  Name: baz
    28 ...to: 
     28...to:
    2929  Name: y
    3030
    31 completeTypeError.c:59:1 error: No reasonable alternatives for expression Applying untyped:
     31completeTypeError.cfa:59:1 error: No reasonable alternatives for expression Applying untyped:
    3232  Name: quux
    33 ...to: 
     33...to:
    3434  Name: y
    3535
    36 completeTypeError.c:60:1 error: No reasonable alternatives for expression Applying untyped:
     36completeTypeError.cfa:60:1 error: No reasonable alternatives for expression Applying untyped:
    3737  Name: *?
    38 ...to: 
     38...to:
    3939  Name: y
    4040
    41 completeTypeError.c:72:1 error: No reasonable alternatives for expression Applying untyped:
     41completeTypeError.cfa:72:1 error: No resolvable alternatives for expression Applying untyped:
    4242  Name: baz
    43 ...to: 
     43...to:
    4444  Name: z
    4545
     46Alternatives with failing assertions are:
     47Cost ( 0, 1, 0, 1, -5, 0 ): Application of
     48     Variable Expression: baz: forall
     49       T: sized object type
     50       ... with assertions
     51         ?=?: pointer to function
     52         ... with parameters
     53           reference to instance of type T (not function type)
     54           instance of type T (not function type)
     55         ... returning
     56           _retval__operator_assign: instance of type T (not function type)
     57           ... with attributes:
     58             Attribute with name: unused
     59
     60
     61         ?{}: pointer to function
     62         ... with parameters
     63           reference to instance of type T (not function type)
     64         ... returning nothing
     65
     66         ?{}: pointer to function
     67         ... with parameters
     68           reference to instance of type T (not function type)
     69           instance of type T (not function type)
     70         ... returning nothing
     71
     72         ^?{}: pointer to function
     73         ... with parameters
     74           reference to instance of type T (not function type)
     75         ... returning nothing
     76
     77
     78       function
     79     ... with parameters
     80       pointer to instance of type T (not function type)
     81     ... returning nothing
     82
     83   ... to arguments
     84     Variable Expression: z: pointer to instance of type T (not function type)
     85
     86 (types:
     87   void
     88 )
     89 Environment:( _73_0_T ) -> instance of type T (not function type) (no widening)
     90
     91
     92
  • tests/.expect/declarationErrors.txt

    r9b086ca rcde3891  
    1 declarationErrors.c:16:1 error: duplicate static in declaration of x1: static const volatile short int
     1declarationErrors.cfa:16:1 error: duplicate static in declaration of x1: static const volatile short int
    22
    3 declarationErrors.c:17:1 error: conflicting extern & static in declaration of x2: extern const volatile short int
     3declarationErrors.cfa:17:1 error: conflicting extern & static in declaration of x2: extern const volatile short int
    44
    5 declarationErrors.c:18:1 error: conflicting extern & auto, conflicting extern & static, conflicting extern & static, duplicate extern in declaration of x3: extern const volatile short int
     5declarationErrors.cfa:18:1 error: conflicting extern & auto, conflicting extern & static, conflicting extern & static, duplicate extern in declaration of x3: extern const volatile short int
    66
    7 declarationErrors.c:19:1 error: duplicate static in declaration of x4: static const volatile instance of const volatile struct __anonymous0
    8   with members 
     7declarationErrors.cfa:19:1 error: duplicate static in declaration of x4: static const volatile instance of const volatile struct __anonymous0
     8  with members
    99    i: int
    10    with body 
     10   with body
    1111
    1212
    13 declarationErrors.c:20:1 error: duplicate const, duplicate static, duplicate volatile in declaration of x5: static const volatile instance of const volatile struct __anonymous1
    14   with members 
     13declarationErrors.cfa:20:1 error: duplicate const, duplicate static, duplicate volatile in declaration of x5: static const volatile instance of const volatile struct __anonymous1
     14  with members
    1515    i: int
    16    with body 
     16   with body
    1717
    1818
    19 declarationErrors.c:22:1 error: duplicate static in declaration of x6: static const volatile Int
     19declarationErrors.cfa:22:1 error: duplicate static in declaration of x6: static const volatile Int
    2020
    21 declarationErrors.c:24:1 error: duplicate const in declaration of f01: static inline function
    22   with no parameters 
     21declarationErrors.cfa:24:1 error: duplicate const in declaration of f01: static inline function
     22  with no parameters
    2323  returning const volatile int
    2424
    2525
    26 declarationErrors.c:25:1 error: duplicate volatile in declaration of f02: static inline function
    27   with no parameters 
     26declarationErrors.cfa:25:1 error: duplicate volatile in declaration of f02: static inline function
     27  with no parameters
    2828  returning const volatile int
    2929
    3030
    31 declarationErrors.c:26:1 error: duplicate const in declaration of f03: static inline function
    32   with no parameters 
     31declarationErrors.cfa:26:1 error: duplicate const in declaration of f03: static inline function
     32  with no parameters
    3333  returning const volatile int
    3434
    3535
    36 declarationErrors.c:27:1 error: duplicate volatile in declaration of f04: static inline function
    37   with no parameters 
     36declarationErrors.cfa:27:1 error: duplicate volatile in declaration of f04: static inline function
     37  with no parameters
    3838  returning const volatile int
    3939
    4040
    41 declarationErrors.c:28:1 error: duplicate const in declaration of f05: static inline function
    42   with no parameters 
     41declarationErrors.cfa:28:1 error: duplicate const in declaration of f05: static inline function
     42  with no parameters
    4343  returning const volatile int
    4444
    4545
    46 declarationErrors.c:29:1 error: duplicate volatile in declaration of f06: static inline function
    47   with no parameters 
     46declarationErrors.cfa:29:1 error: duplicate volatile in declaration of f06: static inline function
     47  with no parameters
    4848  returning const volatile int
    4949
    5050
    51 declarationErrors.c:30:1 error: duplicate const in declaration of f07: static inline function
    52   with no parameters 
     51declarationErrors.cfa:30:1 error: duplicate const in declaration of f07: static inline function
     52  with no parameters
    5353  returning const volatile int
    5454
    5555
    56 declarationErrors.c:31:1 error: duplicate const, duplicate volatile in declaration of f08: static inline function
    57   with no parameters 
     56declarationErrors.cfa:31:1 error: duplicate const, duplicate volatile in declaration of f08: static inline function
     57  with no parameters
    5858  returning const volatile int
    5959
    6060
    61 declarationErrors.c:33:1 error: duplicate const, duplicate volatile in declaration of f09: static inline function
    62   with no parameters 
     61declarationErrors.cfa:33:1 error: duplicate const, duplicate volatile in declaration of f09: static inline function
     62  with no parameters
    6363  returning const volatile int
    6464
    6565
    66 declarationErrors.c:34:1 error: duplicate const, duplicate _Atomic, duplicate _Atomic, duplicate const, duplicate restrict, duplicate volatile in declaration of f09: static inline function
    67   with no parameters 
     66declarationErrors.cfa:34:1 error: duplicate const, duplicate _Atomic, duplicate _Atomic, duplicate const, duplicate restrict, duplicate volatile in declaration of f09: static inline function
     67  with no parameters
    6868  returning const restrict volatile _Atomic int
    6969
  • tests/.expect/nested-types-ERR1.txt

    r9b086ca rcde3891  
    1 nested-types.c:70:1 error: Use of undefined type T
     1nested-types.cfa:70:1 error: Use of undefined type T
  • tests/.expect/nested-types-ERR2.txt

    r9b086ca rcde3891  
    1 nested-types.c:73:1 error: Use of undefined global type Z
    2 nested-types.c:74:1 error: Qualified type requires an aggregate on the left, but has: signed int
    3 nested-types.c:75:1 error: Undefined type in qualified type: Qualified Type:
    4   instance of struct S with body 1 
    5   instance of type Z (not function type) 
     1nested-types.cfa:73:1 error: Use of undefined global type Z
     2nested-types.cfa:74:1 error: Qualified type requires an aggregate on the left, but has: signed int
     3nested-types.cfa:75:1 error: Undefined type in qualified type: Qualified Type:
     4  instance of struct S with body 1
     5  instance of type Z (not function type)
    66
  • tests/.expect/scopeErrors.txt

    r9b086ca rcde3891  
    1 scopeErrors.c:2:1 error: duplicate object definition for thisIsAnError: signed int
    2 scopeErrors.c:20:1 error: duplicate function definition for butThisIsAnError: function
     1scopeErrors.cfa:2:1 error: duplicate object definition for thisIsAnError: signed int
     2scopeErrors.cfa:20:1 error: duplicate function definition for butThisIsAnError: function
    33... with parameters
    44  double
    5 ... returning 
     5... returning
    66  _retval_butThisIsAnError: double
    7   ... with attributes: 
     7  ... with attributes:
    88    Attribute with name: unused
    99
    10 ... with body 
     10... with body
    1111  CompoundStmt
    1212
  • tests/.expect/typedefRedef-ERR1.txt

    r9b086ca rcde3891  
    1 typedefRedef.c:4:1 error: Cannot redefine typedef: Foo
    2 typedefRedef.c:60:1 error: Cannot redefine typedef: ARR
     1typedefRedef.cfa:4:1 error: Cannot redefine typedef: Foo
     2typedefRedef.cfa:60:1 error: Cannot redefine typedef: ARR
  • tests/KRfunctions.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // KRfunctions.c --
     7// KRfunctions.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Thu Feb 16 15:23:17 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Aug 20 07:34:17 2017
    13 // Update Count     : 7
     12// Last Modified On : Tue Nov  6 17:50:34 2018
     13// Update Count     : 9
    1414//
    1515
     
    4949// Local Variables: //
    5050// tab-width: 4 //
    51 // compile-command: "cfa KRfunctions.c" //
     51// compile-command: "cfa KRfunctions.cfa" //
    5252// End: //
  • tests/Makefile.am

    r9b086ca rcde3891  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Wed Jun  6 16:42:20 2018
    14 ## Update Count     : 49
     13## Last Modified On : Tue Nov 20 11:18:51 2018
     14## Update Count     : 68
    1515###############################################################################
    1616
    1717AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
     18ACLOCAL_AMFLAGS  = -I automake
     19
     20include $(top_srcdir)/src/cfa.make
    1821
    1922debug=yes
     
    2326
    2427concurrent=
     28timeouts=
    2529
    2630TEST_PY = python ${builddir}/test.py
     
    3539
    3640AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS}
    37 
    3841CC = @CFACC@
    3942
     
    4144
    4245.PHONY: list .validate
    43 .INTERMEDIATE: .validate .validate.c
    44 EXTRA_PROGRAMS = fstream_test avl_test # build but do not install
     46.INTERMEDIATE: .validate .validate.cfa
     47EXTRA_PROGRAMS = avl_test .dummy_hack # build but do not install
    4548
    46 fstream_test_SOURCES = fstream_test.c
    47 
    48 avl_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
     49avl_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
     50# automake doesn't know we still need C rules so pretend like we have a C program
     51_dummy_hack_SOURCES = .dummy_hack.c
    4952
    5053#----------------------------------------------------------------------------------------------------------------
    5154all-local :
    52         @+${TEST_PY} --debug=${debug}  --install=${installed} ${concurrent} ${quick_test}
     55        @+${TEST_PY} --debug=${debug}  --install=${installed} ${concurrent} ${timeouts} ${quick_test}
    5356
    5457all-tests :
    55         @+${TEST_PY} --all --debug=${debug}  --install=${installed} ${concurrent}               # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     58        @+${TEST_PY} --debug=${debug}  --install=${installed} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
    5659
    5760clean-local :
     
    6164        @+${TEST_PY} --list ${concurrent}
    6265
    63 .validate: .validate.c
    64         $(COMPILE) .validate.c -fsyntax-only -Wall -Wextra -Werror
     66.validate: .validate.cfa
     67        $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror
    6568
    66 .validate.c:
     69.validate.cfa:
     70        @echo "int main() { return 0; }" > ${@}
     71
     72# automake doesn't know we still need C rules so pretend like we have a C program
     73.dummy_hack.c:
    6774        @echo "int main() { return 0; }" > ${@}
    6875
     
    7178
    7279#----------------------------------------------------------------------------------------------------------------
     80
    7381# implicit rule so not all test require a rule
    74 % : %.c $(CC)
    75         $(PRETTY_PATH) $(COMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     82% : %.cfa $(CFACC)
     83        $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    7684
    77 declarationSpecifier: declarationSpecifier.c $(CC)
    78         $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     85declarationSpecifier: declarationSpecifier.cfa $(CFACC)
     86        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    7987
    80 gccExtensions : gccExtensions.c $(CC)
    81         $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     88gccExtensions : gccExtensions.cfa $(CFACC)
     89        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    8290
    83 extension : extension.c $(CC)
    84         $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     91extension : extension.cfa $(CFACC)
     92        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    8593
    86 attributes : attributes.c $(CC)
    87         $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     94attributes : attributes.cfa $(CFACC)
     95        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    8896
    89 functions: functions.c $(CC)
    90         $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     97functions: functions.cfa $(CFACC)
     98        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    9199
    92 KRfunctions : KRfunctions.c $(CC)
    93         $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     100KRfunctions : KRfunctions.cfa $(CFACC)
     101        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    94102
    95 sched-ext-parse : sched-ext-parse.c $(CC)
    96         $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     103sched-ext-parse : sched-ext-parse.c $(CFACC)
     104        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    97105
    98 gmp : gmp.c $(CC)
    99         $(PRETTY_PATH) $(COMPILE) -lgmp $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     106gmp : gmp.cfa $(CFACC)
     107        $(PRETTY_PATH) $(CFACOMPILE) -lgmp $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    100108
    101109#builtins
    102 builtins/sync: builtins/sync.c $(CC)
    103         $(PRETTY_PATH) $(COMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
     110builtins/sync: builtins/sync.cfa $(CFACC)
     111        $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
    104112
    105113#------------------------------------------------------------------------------
     114
    106115#To make errors path independent we need to cd into the correct directories
    107 completeTypeError : completeTypeError.c $(CC)
    108         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     116completeTypeError : completeTypeError.cfa $(CFACC)
     117        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    109118
    110 typedefRedef-ERR1: typedefRedef.c $(CC)
    111         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     119typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
     120        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    112121
    113 alloc-ERROR: alloc.c $(CC)
    114         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     122alloc-ERROR: alloc.cfa $(CFACC)
     123        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    115124
    116 fallthrough-ERROR: fallthrough.c $(CC)
    117         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     125fallthrough-ERROR: fallthrough.cfa $(CFACC)
     126        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    118127
    119 nested-types-ERR1: nested-types.c $(CC)
    120         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     128nested-types-ERR1: nested-types.cfa $(CFACC)
     129        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    121130
    122 nested-types-ERR2: nested-types.c $(CC)
    123         $(PRETTY_PATH) $(COMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     131nested-types-ERR2: nested-types.cfa $(CFACC)
     132        $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    124133
    125134# Constructor/destructor tests
    126 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.c $(CC)
    127         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     135raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
     136        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    128137
    129 raii/dtor-early-exit-ERR2: raii/dtor-early-exit.c $(CC)
    130         $(PRETTY_PATH) $(COMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     138raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
     139        $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    131140
    132 raii/memberCtors-ERR1: raii/memberCtors.c $(CC)
    133         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     141raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
     142        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    134143
    135 raii/ctor-autogen-ERR1: raii/ctor-autogen.c $(CC)
    136         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     144raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
     145        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    137146
    138147# Warnings
    139 warnings/self-assignment: warnings/self-assignment.c $(CC)
    140         $(PRETTY_PATH) $(COMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
     148warnings/self-assignment: warnings/self-assignment.cfa $(CFACC)
     149        $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
  • tests/Makefile.in

    r9b086ca rcde3891  
    9191build_triplet = @build@
    9292host_triplet = @host@
    93 EXTRA_PROGRAMS = fstream_test$(EXEEXT) avl_test$(EXEEXT)
     93EXTRA_PROGRAMS = avl_test$(EXEEXT) .dummy_hack$(EXEEXT)
    9494subdir = tests
    9595ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    96 am__aclocal_m4_deps = $(top_srcdir)/automake/cfa.m4 \
    97         $(top_srcdir)/configure.ac
     96am__aclocal_m4_deps = $(top_srcdir)/automake/libtool.m4 \
     97        $(top_srcdir)/automake/ltoptions.m4 \
     98        $(top_srcdir)/automake/ltsugar.m4 \
     99        $(top_srcdir)/automake/ltversion.m4 \
     100        $(top_srcdir)/automake/lt~obsolete.m4 \
     101        $(top_srcdir)/automake/cfa.m4 $(top_srcdir)/configure.ac
    98102am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    99103        $(ACLOCAL_M4)
     
    103107CONFIG_CLEAN_FILES = config.py
    104108CONFIG_CLEAN_VPATH_FILES = test.py
     109am__dummy_hack_OBJECTS = .dummy_hack.$(OBJEXT)
     110_dummy_hack_OBJECTS = $(am__dummy_hack_OBJECTS)
     111_dummy_hack_LDADD = $(LDADD)
     112AM_V_lt = $(am__v_lt_@AM_V@)
     113am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
     114am__v_lt_0 = --silent
     115am__v_lt_1 =
    105116am__dirstamp = $(am__leading_dot)dirstamp
    106117am_avl_test_OBJECTS = avltree/avl_test.$(OBJEXT) \
     
    110121avl_test_OBJECTS = $(am_avl_test_OBJECTS)
    111122avl_test_LDADD = $(LDADD)
    112 am_fstream_test_OBJECTS = fstream_test.$(OBJEXT)
    113 fstream_test_OBJECTS = $(am_fstream_test_OBJECTS)
    114 fstream_test_LDADD = $(LDADD)
    115123AM_V_P = $(am__v_P_@AM_V@)
    116124am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
     
    131139COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
    132140        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
     141LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
     142        $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
     143        $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
     144        $(AM_CFLAGS) $(CFLAGS)
    133145AM_V_CC = $(am__v_CC_@AM_V@)
    134146am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
     
    136148am__v_CC_1 =
    137149CCLD = $(CC)
    138 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
     150LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
     151        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
     152        $(AM_LDFLAGS) $(LDFLAGS) -o $@
    139153AM_V_CCLD = $(am__v_CCLD_@AM_V@)
    140154am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
    141155am__v_CCLD_0 = @echo "  CCLD    " $@;
    142156am__v_CCLD_1 =
    143 SOURCES = $(avl_test_SOURCES) $(fstream_test_SOURCES)
    144 DIST_SOURCES = $(avl_test_SOURCES) $(fstream_test_SOURCES)
     157SOURCES = $(_dummy_hack_SOURCES) $(avl_test_SOURCES)
     158DIST_SOURCES = $(_dummy_hack_SOURCES) $(avl_test_SOURCES)
    145159am__can_run_installinfo = \
    146160  case $$AM_UPDATE_INFO_DIR in \
     
    168182CTAGS = ctags
    169183am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.py.in \
    170         $(srcdir)/test.py $(top_srcdir)/automake/depcomp
     184        $(srcdir)/test.py $(top_srcdir)/automake/depcomp \
     185        $(top_srcdir)/src/cfa.make
    171186DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    172187ACLOCAL = @ACLOCAL@
     
    174189AMTAR = @AMTAR@
    175190AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
     191AR = @AR@
    176192AUTOCONF = @AUTOCONF@
    177193AUTOHEADER = @AUTOHEADER@
    178194AUTOMAKE = @AUTOMAKE@
    179195AWK = @AWK@
    180 BACKEND_CC = @BACKEND_CC@
    181196BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@
    182197CC = @CFACC@
     
    198213CPPFLAGS = @CPPFLAGS@
    199214CXX = @CXX@
     215CXXCPP = @CXXCPP@
    200216CXXDEPMODE = @CXXDEPMODE@
    201217CXXFLAGS = @CXXFLAGS@
     
    203219DEFS = @DEFS@
    204220DEPDIR = @DEPDIR@
     221DLLTOOL = @DLLTOOL@
    205222DRIVER_DIR = @DRIVER_DIR@
     223DSYMUTIL = @DSYMUTIL@
     224DUMPBIN = @DUMPBIN@
    206225ECHO_C = @ECHO_C@
    207226ECHO_N = @ECHO_N@
     
    209228EGREP = @EGREP@
    210229EXEEXT = @EXEEXT@
     230FGREP = @FGREP@
    211231GREP = @GREP@
    212232HOST_FLAGS = @HOST_FLAGS@
     
    216236INSTALL_SCRIPT = @INSTALL_SCRIPT@
    217237INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
     238LD = @LD@
    218239LDFLAGS = @LDFLAGS@
    219240LEX = @LEX@
     
    224245LIBOBJS = @LIBOBJS@
    225246LIBS = @LIBS@
     247LIBTOOL = @LIBTOOL@
     248LIPO = @LIPO@
     249LN_S = @LN_S@
    226250LTLIBOBJS = @LTLIBOBJS@
     251LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
    227252MAKEINFO = @MAKEINFO@
     253MANIFEST_TOOL = @MANIFEST_TOOL@
    228254MKDIR_P = @MKDIR_P@
     255NM = @NM@
     256NMEDIT = @NMEDIT@
     257OBJDUMP = @OBJDUMP@
    229258OBJEXT = @OBJEXT@
     259OTOOL = @OTOOL@
     260OTOOL64 = @OTOOL64@
    230261PACKAGE = @PACKAGE@
    231262PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
     
    237268PATH_SEPARATOR = @PATH_SEPARATOR@
    238269RANLIB = @RANLIB@
     270SED = @SED@
    239271SET_MAKE = @SET_MAKE@
    240272SHELL = @SHELL@
     
    248280abs_top_builddir = @abs_top_builddir@
    249281abs_top_srcdir = @abs_top_srcdir@
     282ac_ct_AR = @ac_ct_AR@
    250283ac_ct_CC = @ac_ct_CC@
    251284ac_ct_CXX = @ac_ct_CXX@
     285ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
    252286am__include = @am__include@
    253287am__leading_dot = @am__leading_dot@
     
    297331top_srcdir = @top_srcdir@
    298332AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
     333ACLOCAL_AMFLAGS = -I automake
     334CFACOMPILE = $(CFACC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(CFAFLAGS) $(AM_CFLAGS) $(CFLAGS)
     335LTCFACOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
     336        $(LIBTOOLFLAGS) --mode=compile $(CFACC) $(DEFS) \
     337        $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(CFAFLAGS) \
     338        $(AM_CFLAGS) $(CFLAGS)
     339
     340AM_V_CFA = $(am__v_CFA_@AM_V@)
     341am__v_CFA_ = $(am__v_CFA_@AM_DEFAULT_V@)
     342am__v_CFA_0 = @echo "  CFA     " $@;
     343am__v_CFA_1 =
     344AM_V_JAVAC = $(am__v_JAVAC_@AM_V@)
     345am__v_JAVAC_ = $(am__v_JAVAC_@AM_DEFAULT_V@)
     346am__v_JAVAC_0 = @echo "  JAVAC   " $@;
     347am__v_JAVAC_1 =
     348AM_V_GOC = $(am__v_GOC_@AM_V@)
     349am__v_GOC_ = $(am__v_GOC_@AM_DEFAULT_V@)
     350am__v_GOC_0 = @echo "  GOC     " $@;
     351am__v_GOC_1 =
     352UPPCC = u++
     353UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS)
     354AM_V_UPP = $(am__v_UPP_@AM_V@)
     355am__v_UPP_ = $(am__v_UPP_@AM_DEFAULT_V@)
     356am__v_UPP_0 = @echo "  UPP     " $@;
     357am__v_UPP_1 =
    299358debug = yes
    300359installed = no
    301360quick_test = avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes
    302361concurrent =
     362timeouts =
    303363TEST_PY = python ${builddir}/test.py
    304364
     
    308368        ${INSTALL_FLAGS} ${ARCH_FLAGS}
    309369PRETTY_PATH = cd ${srcdir} &&
    310 fstream_test_SOURCES = fstream_test.c
    311 avl_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
     370avl_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
     371# automake doesn't know we still need C rules so pretend like we have a C program
     372_dummy_hack_SOURCES = .dummy_hack.c
    312373all: all-am
    313374
    314375.SUFFIXES:
    315 .SUFFIXES: .c .o .obj .validate
    316 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(am__configure_deps)
     376.SUFFIXES: .c .cfa .dummy_hack .lo .o .obj .validate
     377$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/src/cfa.make $(am__configure_deps)
    317378        @for dep in $?; do \
    318379          case '$(am__configure_deps)' in \
     
    334395            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
    335396        esac;
     397$(top_srcdir)/src/cfa.make $(am__empty):
    336398
    337399$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
     
    345407config.py: $(top_builddir)/config.status $(srcdir)/config.py.in
    346408        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
     409
     410.dummy_hack$(EXEEXT): $(_dummy_hack_OBJECTS) $(_dummy_hack_DEPENDENCIES) $(EXTRA__dummy_hack_DEPENDENCIES)
     411        @rm -f .dummy_hack$(EXEEXT)
     412        $(AM_V_CCLD)$(LINK) $(_dummy_hack_OBJECTS) $(_dummy_hack_LDADD) $(LIBS)
    347413avltree/$(am__dirstamp):
    348414        @$(MKDIR_P) avltree
     
    370436        $(AM_V_CCLD)$(LINK) $(avl_test_OBJECTS) $(avl_test_LDADD) $(LIBS)
    371437
    372 fstream_test$(EXEEXT): $(fstream_test_OBJECTS) $(fstream_test_DEPENDENCIES) $(EXTRA_fstream_test_DEPENDENCIES)
    373         @rm -f fstream_test$(EXEEXT)
    374         $(AM_V_CCLD)$(LINK) $(fstream_test_OBJECTS) $(fstream_test_LDADD) $(LIBS)
    375 
    376438mostlyclean-compile:
    377439        -rm -f *.$(OBJEXT)
     
    381443        -rm -f *.tab.c
    382444
    383 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstream_test.Po@am__quote@
    384 @AMDEP_TRUE@@am__include@ @am__quote@avltree/$(DEPDIR)/avl-private.Po@am__quote@
    385 @AMDEP_TRUE@@am__include@ @am__quote@avltree/$(DEPDIR)/avl0.Po@am__quote@
    386 @AMDEP_TRUE@@am__include@ @am__quote@avltree/$(DEPDIR)/avl1.Po@am__quote@
    387 @AMDEP_TRUE@@am__include@ @am__quote@avltree/$(DEPDIR)/avl2.Po@am__quote@
    388 @AMDEP_TRUE@@am__include@ @am__quote@avltree/$(DEPDIR)/avl3.Po@am__quote@
    389 @AMDEP_TRUE@@am__include@ @am__quote@avltree/$(DEPDIR)/avl4.Po@am__quote@
    390 @AMDEP_TRUE@@am__include@ @am__quote@avltree/$(DEPDIR)/avl_test.Po@am__quote@
     445@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/.dummy_hack.Po@am__quote@
    391446
    392447.c.o:
     
    405460@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    406461@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
     462
     463.c.lo:
     464@am__fastdepCC_TRUE@    $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
     465@am__fastdepCC_TRUE@    $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
     466@am__fastdepCC_TRUE@    $(am__mv) $$depbase.Tpo $$depbase.Plo
     467@AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
     468@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     469@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
     470
     471mostlyclean-libtool:
     472        -rm -f *.lo
     473
     474clean-libtool:
     475        -rm -rf .libs _libs
    407476
    408477ID: $(am__tagged_files)
     
    526595clean: clean-am
    527596
    528 clean-am: clean-generic clean-local mostlyclean-am
     597clean-am: clean-generic clean-libtool clean-local mostlyclean-am
    529598
    530599distclean: distclean-am
    531         -rm -rf ./$(DEPDIR) avltree/$(DEPDIR)
     600        -rm -rf ./$(DEPDIR)
    532601        -rm -f Makefile
    533602distclean-am: clean-am distclean-compile distclean-generic \
     
    575644
    576645maintainer-clean: maintainer-clean-am
    577         -rm -rf ./$(DEPDIR) avltree/$(DEPDIR)
     646        -rm -rf ./$(DEPDIR)
    578647        -rm -f Makefile
    579648maintainer-clean-am: distclean-am maintainer-clean-generic
     
    581650mostlyclean: mostlyclean-am
    582651
    583 mostlyclean-am: mostlyclean-compile mostlyclean-generic
     652mostlyclean-am: mostlyclean-compile mostlyclean-generic \
     653        mostlyclean-libtool
    584654
    585655pdf: pdf-am
     
    596666
    597667.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \
    598         clean-generic clean-local cscopelist-am ctags ctags-am \
    599         distclean distclean-compile distclean-generic distclean-tags \
    600         distdir dvi dvi-am html html-am info info-am install \
    601         install-am install-data install-data-am install-dvi \
    602         install-dvi-am install-exec install-exec-am install-html \
    603         install-html-am install-info install-info-am install-man \
    604         install-pdf install-pdf-am install-ps install-ps-am \
    605         install-strip installcheck installcheck-am installdirs \
    606         maintainer-clean maintainer-clean-generic mostlyclean \
    607         mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
     668        clean-generic clean-libtool clean-local cscopelist-am ctags \
     669        ctags-am distclean distclean-compile distclean-generic \
     670        distclean-libtool distclean-tags distdir dvi dvi-am html \
     671        html-am info info-am install install-am install-data \
     672        install-data-am install-dvi install-dvi-am install-exec \
     673        install-exec-am install-html install-html-am install-info \
     674        install-info-am install-man install-pdf install-pdf-am \
     675        install-ps install-ps-am install-strip installcheck \
     676        installcheck-am installdirs maintainer-clean \
     677        maintainer-clean-generic mostlyclean mostlyclean-compile \
     678        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
    608679        tags tags-am uninstall uninstall-am
    609680
     
    611682
    612683
     684.cfa.o:
     685        $(AM_V_CFA)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
     686        $(CFACOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
     687        $(am__mv) $$depbase.Tpo $$depbase.Po
     688
     689.cfa.lo:
     690        $(AM_V_CFA)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
     691        $(LTCFACOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
     692        $(am__mv) $$depbase.Tpo $$depbase.Plo
     693
    613694.PHONY: list .validate
    614 .INTERMEDIATE: .validate .validate.c
     695.INTERMEDIATE: .validate .validate.cfa
    615696
    616697#----------------------------------------------------------------------------------------------------------------
    617698all-local :
    618         @+${TEST_PY} --debug=${debug}  --install=${installed} ${concurrent} ${quick_test}
     699        @+${TEST_PY} --debug=${debug}  --install=${installed} ${concurrent} ${timeouts} ${quick_test}
    619700
    620701all-tests :
    621         @+${TEST_PY} --all --debug=${debug}  --install=${installed} ${concurrent}               # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     702        @+${TEST_PY} --debug=${debug}  --install=${installed} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
    622703
    623704clean-local :
     
    627708        @+${TEST_PY} --list ${concurrent}
    628709
    629 .validate: .validate.c
    630         $(COMPILE) .validate.c -fsyntax-only -Wall -Wextra -Werror
    631 
    632 .validate.c:
     710.validate: .validate.cfa
     711        $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror
     712
     713.validate.cfa:
     714        @echo "int main() { return 0; }" > ${@}
     715
     716# automake doesn't know we still need C rules so pretend like we have a C program
     717.dummy_hack.c:
    633718        @echo "int main() { return 0; }" > ${@}
    634719
     
    637722
    638723#----------------------------------------------------------------------------------------------------------------
     724
    639725# implicit rule so not all test require a rule
    640 % : %.c $(CC)
    641         $(PRETTY_PATH) $(COMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    642 
    643 declarationSpecifier: declarationSpecifier.c $(CC)
    644         $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    645 
    646 gccExtensions : gccExtensions.c $(CC)
    647         $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    648 
    649 extension : extension.c $(CC)
    650         $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    651 
    652 attributes : attributes.c $(CC)
    653         $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    654 
    655 functions: functions.c $(CC)
    656         $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    657 
    658 KRfunctions : KRfunctions.c $(CC)
    659         $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    660 
    661 sched-ext-parse : sched-ext-parse.c $(CC)
    662         $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    663 
    664 gmp : gmp.c $(CC)
    665         $(PRETTY_PATH) $(COMPILE) -lgmp $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     726% : %.cfa $(CFACC)
     727        $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     728
     729declarationSpecifier: declarationSpecifier.cfa $(CFACC)
     730        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     731
     732gccExtensions : gccExtensions.cfa $(CFACC)
     733        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     734
     735extension : extension.cfa $(CFACC)
     736        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     737
     738attributes : attributes.cfa $(CFACC)
     739        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     740
     741functions: functions.cfa $(CFACC)
     742        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     743
     744KRfunctions : KRfunctions.cfa $(CFACC)
     745        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     746
     747sched-ext-parse : sched-ext-parse.c $(CFACC)
     748        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     749
     750gmp : gmp.cfa $(CFACC)
     751        $(PRETTY_PATH) $(CFACOMPILE) -lgmp $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    666752
    667753#builtins
    668 builtins/sync: builtins/sync.c $(CC)
    669         $(PRETTY_PATH) $(COMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
     754builtins/sync: builtins/sync.cfa $(CFACC)
     755        $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
    670756
    671757#------------------------------------------------------------------------------
     758
    672759#To make errors path independent we need to cd into the correct directories
    673 completeTypeError : completeTypeError.c $(CC)
    674         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    675 
    676 typedefRedef-ERR1: typedefRedef.c $(CC)
    677         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    678 
    679 alloc-ERROR: alloc.c $(CC)
    680         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    681 
    682 fallthrough-ERROR: fallthrough.c $(CC)
    683         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    684 
    685 nested-types-ERR1: nested-types.c $(CC)
    686         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    687 
    688 nested-types-ERR2: nested-types.c $(CC)
    689         $(PRETTY_PATH) $(COMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     760completeTypeError : completeTypeError.cfa $(CFACC)
     761        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     762
     763typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
     764        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     765
     766alloc-ERROR: alloc.cfa $(CFACC)
     767        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     768
     769fallthrough-ERROR: fallthrough.cfa $(CFACC)
     770        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     771
     772nested-types-ERR1: nested-types.cfa $(CFACC)
     773        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     774
     775nested-types-ERR2: nested-types.cfa $(CFACC)
     776        $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    690777
    691778# Constructor/destructor tests
    692 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.c $(CC)
    693         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    694 
    695 raii/dtor-early-exit-ERR2: raii/dtor-early-exit.c $(CC)
    696         $(PRETTY_PATH) $(COMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    697 
    698 raii/memberCtors-ERR1: raii/memberCtors.c $(CC)
    699         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    700 
    701 raii/ctor-autogen-ERR1: raii/ctor-autogen.c $(CC)
    702         $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     779raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
     780        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     781
     782raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
     783        $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     784
     785raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
     786        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     787
     788raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
     789        $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    703790
    704791# Warnings
    705 warnings/self-assignment: warnings/self-assignment.c $(CC)
    706         $(PRETTY_PATH) $(COMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
     792warnings/self-assignment: warnings/self-assignment.cfa $(CFACC)
     793        $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
    707794
    708795# Tell versions [3.59,3.63) of GNU make to not export all variables.
  • tests/abs.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // abs.c --
     7// abs.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Thu Jan 28 18:26:16 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb 22 22:31:03 2017
    13 // Update Count     : 52
     12// Last Modified On : Tue Dec  4 21:33:15 2018
     13// Update Count     : 55
    1414//
    1515
     
    1919int main( void ) {
    2020        signed char ch = -65;
    21         sout | "char\t\t\t"                                     | ch     | "\tabs " | abs( ch ) | endl;
    22         sout | "signed int\t\t"                         | -65    | "\tabs" | abs( -65 ) | endl;
    23         sout | "signed long int\t\t"            | -65l   | "\tabs" | abs( -65l ) | endl;
    24         sout | "signed long long int\t"         | -65ll  | "\tabs" | abs( -65ll ) | endl;
    25         sout | "float\t\t\t"                            | -65.0f | "\tabs" | abs( -65.0f ) | endl;
    26         sout | "double\t\t\t"                           | -65.0  | "\tabs" | abs( -65.0 ) | endl;
    27         sout | "long double\t\t"                        | -65.0l | "\tabs" | abs( -65.0l ) | endl;
    28         sout | "float _Complex\t\t"                     | -65.0F-2.0iF | "\tabs" | abs( -65.0F-2.0iF ) | endl;
    29         sout | "double _Complex\t\t"            | -65.0D-2.0iD | "\tabs" | abs( -65.0D-2.0iD ) | endl;
    30         sout | "long double _Complex\t"         | -65.0L-2.0iL | "\tabs" | abs( -65.0L-2.0iL ) | endl;
     21        sout | "char\t\t\t"                                     | ch     | "\tabs " | abs( ch );
     22        sout | "signed int\t\t"                         | -65    | "\tabs" | abs( -65 );
     23        sout | "signed long int\t\t"            | -65l   | "\tabs" | abs( -65l );
     24        sout | "signed long long int\t"         | -65ll  | "\tabs" | abs( -65ll );
     25        sout | "float\t\t\t"                            | -65.0f | "\tabs" | abs( -65.0f );
     26        sout | "double\t\t\t"                           | -65.0  | "\tabs" | abs( -65.0 );
     27        sout | "long double\t\t"                        | -65.0l | "\tabs" | abs( -65.0l );
     28        sout | "float _Complex\t\t"                     | -65.0F-2.0iF | "\tabs" | abs( -65.0F-2.0iF );
     29        sout | "double _Complex\t\t"            | -65.0D-2.0iD | "\tabs" | abs( -65.0D-2.0iD );
     30        sout | "long double _Complex\t"         | -65.0L-2.0iL | "\tabs" | abs( -65.0L-2.0iL );
    3131} // main
    3232
    3333// Local Variables: //
    3434// tab-width: 4 //
    35 // compile-command: "cfa abs.c" //
     35// compile-command: "cfa abs.cfa" //
    3636// End: //
  • tests/alloc.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // alloc.c --
     7// alloc.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Feb  3 07:56:22 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  9 06:21:35 2018
    13 // Update Count     : 337
     12// Last Modified On : Tue Nov  6 17:50:52 2018
     13// Update Count     : 339
    1414//
    1515
     
    272272// Local Variables: //
    273273// tab-width: 4 //
    274 // compile-command: "cfa alloc.c" //
     274// compile-command: "cfa alloc.cfa" //
    275275// End: //
  • tests/ato.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ato.c --
     7// ato.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Thu Feb  4 08:10:57 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Nov 16 18:31:56 2017
    13 // Update Count     : 89
     12// Last Modified On : Tue Dec  4 21:33:53 2018
     13// Update Count     : 92
    1414//
    1515
     
    2020        const char * sptr = "-123";
    2121        int i = ato( sptr );
    22         sout | i | sptr | endl;
     22        sout | i | sptr;
    2323        sptr = "123";
    2424        unsigned int ui = ato( sptr );
    25         sout | ui | sptr | endl;
     25        sout | ui | sptr;
    2626
    2727        sptr = "-123";
    2828        long int li = ato( sptr );
    29         sout | li | sptr | endl;
     29        sout | li | sptr;
    3030        sptr = "123";
    3131        unsigned long int uli = ato( sptr );
    32         sout | uli | sptr | endl;
     32        sout | uli | sptr;
    3333
    3434        sptr = "-123";
    3535        long long int lli = ato( sptr );
    36         sout | lli | sptr | endl;
     36        sout | lli | sptr;
    3737        sptr = "123";
    3838        unsigned long long int ulli = ato( sptr );
    39         sout | ulli | sptr | endl;
     39        sout | ulli | sptr;
    4040
    4141        sptr = "-123.456";
    4242        float f = ato( sptr );
    43         sout | f | sptr | endl;
     43        sout | f | sptr;
    4444        sptr = "-123.4567890123456";
    4545        double d = ato( sptr );
    46         sout | d | sptr | endl;
     46        sout | d | sptr;
    4747        sptr = "-123.45678901234567890123456789";
    4848        long double ld = ato( sptr );
    49         sout | ld | sptr | endl;
     49        sout | ld | sptr;
    5050
    5151        sptr = "-123.456-123.456i";
    5252        float _Complex fc = ato( sptr );
    53         sout | fc | sptr | endl;
     53        sout | fc | sptr;
    5454        sptr = "-123.4567890123456+123.4567890123456i";
    5555        double _Complex dc = ato( sptr );
    56         sout | dc | sptr | endl;
     56        sout | dc | sptr;
    5757        sptr = "123.45678901234567890123456789-123.45678901234567890123456789i";
    5858        long double _Complex ldc = ato( sptr );
    59         sout | ldc | sptr | endl;
     59        sout | ldc | sptr;
    6060        sptr = "123.45678901234-123.4567890i";
    6161        long double _Complex ldc2 = ato( sptr );
    62         sout | ldc2 | sptr | endl;
     62        sout | ldc2 | sptr;
    6363
    6464
    6565        sptr = "-123";
    6666        i = strto( sptr, 0, 10 );
    67         sout | i | sptr | endl;
     67        sout | i | sptr;
    6868        sptr = "123";
    6969        ui = strto( sptr, 0, 10 );
    70         sout | ui | sptr | endl;
     70        sout | ui | sptr;
    7171
    7272        sptr = "-123";
    7373        li = strto( sptr, 0, 10 );
    74         sout | li | sptr | endl;
     74        sout | li | sptr;
    7575        sptr = "123";
    7676        uli = strto( sptr, 0, 10 );
    77         sout | uli | sptr | endl;
     77        sout | uli | sptr;
    7878
    7979        sptr = "-123";
    8080        lli = strto( sptr, 0, 10 );
    81         sout | lli | sptr | endl;
     81        sout | lli | sptr;
    8282        sptr = "123";
    8383        ulli = strto( sptr, 0, 10 );
    84         sout | ulli | sptr | endl;
     84        sout | ulli | sptr;
    8585
    8686        sptr = "-123.456";
    8787        f = strto( sptr, 0 );
    88         sout | f | sptr | endl;
     88        sout | f | sptr;
    8989        sptr = "-123.4567890123456";
    9090        d = strto( sptr, 0 );
    91         sout | d | sptr | endl;
     91        sout | d | sptr;
    9292        sptr = "-123.45678901234567890123456789";
    9393        ld = strto( sptr, 0 );
    94         sout | ld | sptr | endl;
     94        sout | ld | sptr;
    9595
    9696        sptr = "-123.456-123.456i";
    9797        fc = strto( sptr, 0 );
    98         sout | fc | sptr | endl;
     98        sout | fc | sptr;
    9999
    100100        char * eptr = 0;
    101101        // sptr = "2fred";
    102102        // fc = strto( sptr, &eptr );
    103         // sout | fc | sptr | eptr | endl;
     103        // sout | fc | sptr | eptr;
    104104
    105105        sptr = "2  3";
    106106        fc = strto( sptr, &eptr );
    107         sout | fc | sptr | eptr | endl;
     107        sout | fc | sptr | eptr;
    108108
    109109        sptr = "-123.4567890123456+123.4567890123456i";
    110110        dc = strto( sptr, 0 );
    111         sout | dc | sptr | endl;
     111        sout | dc | sptr;
    112112        sptr = "123.45678901234567890123456789-123.45678901234567890123456789i";
    113113        ldc = strto( sptr, 0 );
    114         sout | ldc | sptr | endl;
     114        sout | ldc | sptr;
    115115        sptr = "123.45678901234-123.4567890i";
    116116        ldc2 = strto( sptr, 0 );
    117         sout | ldc2 | sptr | endl;
     117        sout | ldc2 | sptr;
    118118} // main
    119119
    120120// Local Variables: //
    121121// tab-width: 4 //
    122 // compile-command: "cfa ato.c" //
     122// compile-command: "cfa ato.cfa" //
    123123// End: //
  • tests/attributes.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // attributes.c --
     7// attributes.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Mon Feb  6 16:07:02 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 19 13:50:51 2018
    13 // Update Count     : 15
     12// Last Modified On : Tue Nov  6 17:51:12 2018
     13// Update Count     : 17
    1414//
    1515
     
    154154// Local Variables: //
    155155// tab-width: 4 //
    156 // compile-command: "cfa attributes.c" //
     156// compile-command: "cfa attributes.cfa" //
    157157// End: //
  • tests/complex.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // complex.c --
     7// complex.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed May 24 22:07:31 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May 24 22:08:01 2017
    13 // Update Count     : 1
     12// Last Modified On : Tue Dec  4 21:34:21 2018
     13// Update Count     : 4
    1414//
    1515
     
    2525    printf( "x:%g+%gi y:%g+%gi z:%g+%gi\n", creal(x), cimag(x), creal(y), cimag(y), creal(z), cimag(z) );
    2626#ifdef __CFA__
    27     sout | "x:" | x | "y:" | y | "z:" | z | endl;
     27    sout | "x:" | x | "y:" | y | "z:" | z;
    2828#endif // __CFA
    2929    x = 2.1 + 1.3i;
     
    3232    printf( "x:%g+%gi y:%g+%gi z:%g+%gi\n", creal(x), cimag(x), creal(y), cimag(y), creal(z), cimag(z) );
    3333#ifdef __CFA__
    34     sout | "x:" | x | "y:" | y | "z:" | z | endl;
     34    sout | "x:" | x | "y:" | y | "z:" | z;
    3535#endif // __CFA
    3636}
     
    3838// Local Variables: //
    3939// tab-width: 4 //
    40 // compile-command: "cfa complex.c" //
     40// compile-command: "cfa complex.cfa" //
    4141// End: //
  • tests/concurrent/coroutineYield.cfa

    r9b086ca rcde3891  
    11#include <fstream.hfa>
    2 #include <kernel.hfa>hfa>
     2#include <kernel.hfa>
    33#include <stdlib.hfa>
    44#include <thread.hfa>
     
    66
    77#define __kick_rate 150000ul
    8 #include "long_tests.h"
     8#include "long_tests.hfa"
    99
    1010#ifndef PREEMPTION_RATE
     
    2727        while(true) {
    2828                #if !defined(TEST_FOREVER)
    29                         sout | "Coroutine 1" | endl;
     29                        sout | "Coroutine 1";
    3030                #endif
    3131                yield();
    3232                #if !defined(TEST_FOREVER)
    33                         sout | "Coroutine 2" | endl;
     33                        sout | "Coroutine 2";
    3434                #endif
    3535                suspend();
     
    4242        for(int i = 0; TEST(i < N); i++) {
    4343                #if !defined(TEST_FOREVER)
    44                         sout | "Thread 1" | endl;
     44                        sout | "Thread 1";
    4545                #endif
    4646                resume(c);
    4747                #if !defined(TEST_FOREVER)
    48                         sout | "Thread 2" | endl;
     48                        sout | "Thread 2";
    4949                #endif
    5050                yield();
  • tests/concurrent/examples/boundedBufferEXT.cfa

    r9b086ca rcde3891  
    88// Created On       : Wed Apr 18 22:52:12 2018
    99// Last Modified By : Peter A. Buhr
    10 // Last Modified On : Thu Aug 16 08:17:03 2018
    11 // Update Count     : 8
     10// Last Modified On : Tue Dec 11 21:55:02 2018
     11// Update Count     : 9
    1212//
    1313
     
    115115                sum += sums[i];
    116116        } // for
    117         sout | "total:" | sum | endl;
     117        sout | "total:" | sum;
    118118}
    119119
  • tests/concurrent/examples/boundedBufferINT.cfa

    r9b086ca rcde3891  
    88// Created On       : Mon Oct 30 12:45:13 2017
    99// Last Modified By : Peter A. Buhr
    10 // Last Modified On : Thu Aug 16 08:17:58 2018
    11 // Update Count     : 83
     10// Last Modified On : Tue Dec 11 21:55:45 2018
     11// Update Count     : 84
    1212//
    1313
     
    116116                sum += sums[i];
    117117        } // for
    118         sout | "total:" | sum | endl;
     118        sout | "total:" | sum;
    119119}
    120120
  • tests/concurrent/examples/datingService.cfa

    r9b086ca rcde3891  
    88// Created On       : Mon Oct 30 12:56:20 2017
    99// Last Modified By : Peter A. Buhr
    10 // Last Modified On : Sun May 27 09:05:18 2018
    11 // Update Count     : 26
     10// Last Modified On : Tue Dec 11 21:55:34 2018
     11// Update Count     : 28
    1212//
    1313
     
    3333                signal_block( Boys[ccode] );                                    // restart boy to set phone number
    3434        } // if
     35        sout | "Girl:" | PhoneNo | "is dating Boy at" | BoyPhoneNo | "with ccode" | ccode;
    3536        return BoyPhoneNo;
    3637} // DatingService girl
     
    4445                signal_block( Girls[ccode] );                                   // restart girl to set phone number
    4546        } // if
     47        sout | " Boy:" | PhoneNo | "is dating Girl" | GirlPhoneNo | "with ccode" | ccode;
    4648        return GirlPhoneNo;
    4749} // DatingService boy
     
    5860        yield( random( 100 ) );                                                         // don't all start at the same time
    5961        unsigned int partner = girl( TheExchange, id, ccode );
    60         sout | "Girl:" | id | "is dating Boy at" | partner | "with ccode" | ccode | endl;
    6162        girlck[id] = partner;
    6263} // Girl main
     
    6970
    7071thread Boy {
    71         DatingService &TheExchange;
     72        DatingService & TheExchange;
    7273        unsigned int id, ccode;
    7374}; // Boy
     
    7677        yield( random( 100 ) );                                                         // don't all start at the same time
    7778        unsigned int partner = boy( TheExchange, id, ccode );
    78         sout | " Boy:" | id | "is dating Girl" | partner | "with ccode" | ccode | endl;
    7979        boyck[id] = partner;
    8080} // Boy main
  • tests/concurrent/examples/matrixSum.cfa

    r9b086ca rcde3891  
    66// file "LICENCE" distributed with Cforall.
    77//
    8 // matrixSum.c --
     8// matrixSum.cfa --
    99//
    1010// Author           : Peter A. Buhr
    1111// Created On       : Mon Oct  9 08:29:28 2017
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Thu Aug  9 09:17:30 2018
    14 // Update Count     : 13
     13// Last Modified On : Tue Dec 11 21:54:55 2018
     14// Update Count     : 15
    1515//
    1616
     
    5454                total += subtotals[r];                                                  // total subtotals
    5555        } // for
    56         sout | total | endl;
     56        sout | total;
    5757}
    5858
    5959// Local Variables: //
    6060// tab-width: 4 //
    61 // compile-command: "cfa matrixSum.c" //
     61// compile-command: "cfa matrixSum.cfa" //
    6262// End: //
  • tests/concurrent/examples/quickSort.cfa

    r9b086ca rcde3891  
    99// Created On       : Wed Dec  6 12:15:52 2017
    1010// Last Modified By : Peter A. Buhr
    11 // Last Modified On : Thu Aug 16 08:17:41 2018
    12 // Update Count     : 163
     11// Last Modified On : Sat Dec 22 08:44:27 2018
     12// Update Count     : 168
    1313//
    1414
     
    8888
    8989void usage( char * argv[] ) {
    90         sout | "Usage:" | argv[0] | "( -s unsorted-file [ sorted-file ] | -t size (>= 0) [ depth (>= 0) ] )" | endl;
     90        sout | "Usage:" | argv[0] | "( -s unsorted-file [ sorted-file ] | -t size (>= 0) [ depth (>= 0) ] )";
    9191        exit( EXIT_FAILURE );                                                           // TERMINATE!
    9292} // usage
     
    114114                                &sortedfile = new( (const char *)argv[2] ); // open the output file
    115115                                if ( fail( sortedfile ) ) {
    116                                         serr | "Error! Could not open sorted output file \"" | argv[2] | "\"" | endl;
     116                                        serr | "Error! Could not open sorted output file \"" | argv[2] | "\"";
    117117                                        usage( argv );
    118118                                } // if
     
    121121                                &unsortedfile = new( (const char *)argv[1] ); // open the input file
    122122                                if ( fail( unsortedfile ) ) {
    123                                         serr | "Error! Could not open unsorted input file \"" | argv[1] | "\"" | endl;
     123                                        serr | "Error! Could not open unsorted input file \"" | argv[1] | "\"";
    124124                                        usage( argv );
    125125                                } // if
     
    127127                } // if
    128128        } // if
     129        sortedfile | nlOff;                                                                     // turn off auto newline
    129130
    130131        enum { ValuesPerLine = 22 };                                            // number of values printed per line
     
    137138                        for ( int counter = 0; counter < size; counter += 1 ) { // read unsorted numbers
    138139                                unsortedfile | values[counter];
    139                                 if ( counter != 0 && counter % ValuesPerLine == 0 ) sortedfile | endl | "  ";
     140                                if ( counter != 0 && counter % ValuesPerLine == 0 ) sortedfile | nl | "  ";
    140141                                sortedfile | values[counter];
    141142                                if ( counter < size - 1 && (counter + 1) % ValuesPerLine != 0 ) sortedfile | ' ';
    142143                        } // for
    143                         sortedfile | endl;
     144                        sortedfile | nl;
    144145                        if ( size > 0 ) {                                                       // values to sort ?
    145146                                Quicksort QS = { values, size - 1, 0 }; // sort values
    146147                        } // wait until sort tasks terminate
    147148                        for ( int counter = 0; counter < size; counter += 1 ) { // print sorted list
    148                                 if ( counter != 0 && counter % ValuesPerLine == 0 ) sortedfile | endl | "  ";
     149                                if ( counter != 0 && counter % ValuesPerLine == 0 ) sortedfile | nl | "  ";
    149150                                sortedfile | values[counter];
    150151                                if ( counter < size - 1 && (counter + 1) % ValuesPerLine != 0 ) sortedfile | ' ';
    151152                        } // for
    152                         sortedfile | endl | endl;
     153                        sortedfile | nl | nl;
    153154
    154155                        delete( values );
  • tests/concurrent/monitor.cfa

    r9b086ca rcde3891  
    4040                MyThread f[4];
    4141        }
    42         sout | global.value | endl;
     42        sout | global.value;
    4343}
  • tests/concurrent/multi-monitor.cfa

    r9b086ca rcde3891  
    5252                }
    5353        }
    54         sout | global12 | global23 | global13 | endl;
     54        sout | global12 | global23 | global13;
    5555}
  • tests/concurrent/preempt.cfa

    r9b086ca rcde3891  
    1 #include <kernel.hfa>hfa>
     1#include <kernel.hfa>
    22#include <thread.hfa>
    33#include <time.hfa>
    44
    5 #include "long_tests.h"
     5#include "long_tests.hfa"
    66
    77#ifndef PREEMPTION_RATE
  • tests/concurrent/signal/block.cfa

    r9b086ca rcde3891  
    88
    99#include <fstream.hfa>
    10 #include <kernel.hfa>hfa>
     10#include <kernel.hfa>
    1111#include <monitor.hfa>
    1212#include <stdlib.hfa>
     
    1414#include <time.hfa>
    1515
    16 #include "long_tests.h"
     16#include "long_tests.hfa"
    1717
    1818#ifndef PREEMPTION_RATE
     
    5757
    5858        if(a.last_thread != a.last_signaller || b.last_thread != b.last_signaller ) {
    59                 sout | "ERROR Barging detected, expected" | a.last_signaller | b.last_signaller | "got" | a.last_thread | b.last_thread | endl;
     59                sout | "ERROR Barging detected, expected" | a.last_signaller | b.last_signaller | "got" | a.last_thread | b.last_thread;
    6060                abort();
    6161        }
     
    8585
    8686                if( ! signal_block( cond ) ) {
    87                         sout | "ERROR expected to be able to signal" | endl;
     87                        sout | "ERROR expected to be able to signal";
    8888                        abort();
    8989                }
     
    9292
    9393                if(a.last_thread != next || b.last_thread != next) {
    94                         sout | "ERROR Barging detected, expected" | next | "got" | a.last_thread | b.last_thread | endl;
     94                        sout | "ERROR Barging detected, expected" | next | "got" | a.last_thread | b.last_thread;
    9595                        abort();
    9696                }
     
    130130                Signaller s[4];
    131131                Barger b[13];
    132                 sout | "Starting waiters" | endl;
     132                sout | "Starting waiters";
    133133                {
    134134                        Waiter w[3];
    135135                }
    136                 sout | "Waiters done" | endl;
     136                sout | "Waiters done";
    137137                done = true;
    138138        }
  • tests/concurrent/signal/disjoint.cfa

    r9b086ca rcde3891  
    11#include <fstream.hfa>
    2 #include <kernel.hfa>hfa>
     2#include <kernel.hfa>
    33#include <monitor.hfa>
    44#include <thread.hfa>
    55#include <time.hfa>
    66
    7 #include "long_tests.h"
     7#include "long_tests.hfa"
    88
    99#ifndef PREEMPTION_RATE
     
    6666        wait( cond );
    6767        if( d.state != SIGNAL ) {
    68                 sout | "ERROR barging!" | endl;
     68                sout | "ERROR barging!";
    6969        }
    7070
    7171        #if !defined(TEST_FOREVER)
    7272                d.counter++;
    73                 if( (d.counter % 1000) == 0 ) sout | d.counter | endl;
     73                if( (d.counter % 1000) == 0 ) sout | d.counter;
    7474        #endif
    7575
     
    9999        bool running = TEST(data.counter < N) && data.counter > 0;
    100100        if( data.state != SIGNAL && running ) {
    101                 sout | "ERROR Eager signal" | data.state | endl;
     101                sout | "ERROR Eager signal" | data.state;
    102102        }
    103103}
     
    124124                        Waiter w[4];
    125125                }
    126                 sout | "All waiter done" | endl;
     126                sout | "All waiter done";
    127127                all_done = true;
    128128        }
  • tests/concurrent/signal/wait.cfa

    r9b086ca rcde3891  
    66
    77#include <fstream.hfa>
    8 #include <kernel.hfa>hfa>
     8#include <kernel.hfa>
    99#include <monitor.hfa>
    1010#include <stdlib.hfa>
     
    1313
    1414#define __kick_rate 12000ul
    15 #include "long_tests.h"
     15#include "long_tests.hfa"
    1616
    1717#ifndef PREEMPTION_RATE
     
    8383                                break;
    8484                        default:
    85                                 sout | "Something went wrong" | endl;
     85                                sout | "Something went wrong";
    8686                                abort();
    8787                }
     
    140140        waiter_left = 4;
    141141        processor p[2];
    142         sout | "Starting" | endl;
     142        sout | "Starting";
    143143        {
    144144                Signaler  e;
     
    150150                }
    151151        }
    152         sout | "Done" | endl;
     152        sout | "Done";
    153153}
  • tests/concurrent/thread.cfa

    r9b086ca rcde3891  
    1212void main(First& this) {
    1313        for(int i = 0; i < 10; i++) {
    14                 sout | "First : Suspend No." | i + 1 | endl;
     14                sout | "First : Suspend No." | i + 1;
    1515                yield();
    1616        }
     
    2121        P(*this.lock);
    2222        for(int i = 0; i < 10; i++) {
    23                 sout | "Second : Suspend No." | i + 1 | endl;
     23                sout | "Second : Suspend No." | i + 1;
    2424                yield();
    2525        }
     
    2929int main(int argc, char* argv[]) {
    3030        semaphore lock = { 0 };
    31         sout | "User main begin" | endl;
     31        sout | "User main begin";
    3232        {
    3333                processor p;
     
    3737                }
    3838        }
    39         sout | "User main end" | endl;
     39        sout | "User main end";
    4040}
  • tests/concurrent/waitfor/barge.cfa

    r9b086ca rcde3891  
    4848        yield(random( 10 ));
    4949        if( this.state != WAITFOR && !this.done && this.started ) {
    50                 serr | "Barging before caller detected" | endl;
     50                serr | "Barging before caller detected";
    5151        }
    5252
     
    6666                this.state = WAITFOR;
    6767                waitfor(do_call, this) {
    68                         sout | i | endl;
     68                        sout | i;
    6969                }
    7070
    7171                if( this.state != CALL ) {
    72                         serr | "Barging after caller detected" | endl;
     72                        serr | "Barging after caller detected";
    7373                }
    7474        }
     
    8383
    8484int main() {
    85         sout | "Starting" | endl;
     85        sout | "Starting";
    8686        {
    8787                barger_t bargers[17];
     
    8989                waiter_t waiters;
    9090        }
    91         sout | "Stopping" | endl;
     91        sout | "Stopping";
    9292}
  • tests/concurrent/waitfor/dtor.cfa

    r9b086ca rcde3891  
    2929        switch(state) {
    3030                case CTOR  : break;
    31                 case MAIN  : if( this.state != CTOR  ) { serr | "ERROR Expected state to be CTOR"  | endl; abort(); } this.state = state; break;
    32                 case AFTER : if( this.state != MAIN  ) { serr | "ERROR Expected state to be MAIN"  | endl; abort(); } this.state = state; break;
    33                 case END   : if( this.state != AFTER ) { serr | "ERROR Expected state to be AFTER" | endl; abort(); } this.state = state; break;
    34                 case DTOR  : if( this.state != END   ) { serr | "ERROR Expected state to be END"   | endl; abort(); } this.state = state; break;
     31                case MAIN  : if( this.state != CTOR  ) { serr | "ERROR Expected state to be CTOR" ; abort(); } this.state = state; break;
     32                case AFTER : if( this.state != MAIN  ) { serr | "ERROR Expected state to be MAIN" ; abort(); } this.state = state; break;
     33                case END   : if( this.state != AFTER ) { serr | "ERROR Expected state to be AFTER"; abort(); } this.state = state; break;
     34                case DTOR  : if( this.state != END   ) { serr | "ERROR Expected state to be END"  ; abort(); } this.state = state; break;
    3535        }
    3636}
     
    5454
    5555int main() {
    56         sout | "Starting" | endl;
     56        sout | "Starting";
    5757        processor p;
    5858        for( int i = 0; i < N; i++ ){
     
    6060                yield( random( 100 ) );
    6161        }
    62         sout | "Stopping" | endl;
     62        sout | "Stopping";
    6363}
  • tests/concurrent/waitfor/else.cfa

    r9b086ca rcde3891  
    1212void test( M & mutex m ) {
    1313        int i = 0;
    14         sout | "Starting" | endl;
     14        sout | "Starting";
    1515
    1616        when( false ) waitfor( notcalled, m );
    1717
    18         sout | "Step" | i++ | endl;
     18        sout | "Step" | i++;
    1919
    2020        waitfor( notcalled, m ); or else {
    21                 sout | "else called" | endl;
     21                sout | "else called";
    2222        }
    2323
    24         sout | "Step" | i++ | endl;
     24        sout | "Step" | i++;
    2525
    2626        when( true ) waitfor( notcalled, m ); or when( true ) else {
    27                 sout | "else called" | endl;
     27                sout | "else called";
    2828        }
    2929
    30         sout | "Step" | i++ | endl;
     30        sout | "Step" | i++;
    3131
    3232        when( false ) waitfor( notcalled, m ); or when( true ) else {
    33                 sout | "else called" | endl;
     33                sout | "else called";
    3434        }
    3535
    36         sout | "Step" | i++ | endl;
     36        sout | "Step" | i++;
    3737
    3838        when( false ) waitfor( notcalled, m ); or when( false ) else {
    39                 sout | "else called" | endl;
     39                sout | "else called";
    4040        }
    4141
    42         sout | "Done" | endl;
     42        sout | "Done";
    4343}
    4444
  • tests/concurrent/waitfor/recurse.cfa

    r9b086ca rcde3891  
    9595        rand_yield();
    9696
    97         sout | "1st" | endl;
     97        sout | "1st" | nl;
    9898
    9999        return this.counter < N ? (state_t)this.actions[idx] : (state_t)STOP;
     
    123123                        case THIRD  : while( !global.ready ) { yield(); } this.state = call3( global, this.idx ); break;
    124124                        case LAST   : while( !global.ready ) { yield(); } this.state = call4( global, this.idx ); break;
    125                         case STOP   : serr | "This should not happen" | endl;
     125                        case STOP   : serr | "This should not happen" | nl;
    126126                }
    127127        }
     
    132132int main() {
    133133        srandom( time(NULL) );
    134         sout | "Starting" | endl;
     134        sout | nlOff;                                   // turn off auto newline
     135        sout | "Starting" | nl;
    135136        {
    136137                waiter_t waiters[4] = {
     
    142143                the_threads = waiters;
    143144        }
    144         sout | "Stopping" | endl;
     145        sout | "Stopping" | nl;
    145146}
  • tests/concurrent/waitfor/simple.cfa

    r9b086ca rcde3891  
    3131
    3232void do_wait( global_t * mutex a ) {
    33         sout | "Waiting to accept" | endl;
     33        sout | "Waiting to accept";
    3434        yield( random( 10 ) );
    3535
    36         sout | "Accepting" | endl;
     36        sout | "Accepting";
    3737
    3838        __acceptable_t acceptable;
     
    4343        __waitfor_internal( 1, &acceptable );
    4444
    45         sout | "Accepted" | endl;
     45        sout | "Accepted";
    4646        yield( random( 10 ) );
    4747}
     
    5050        for( int i = 0; i < N; i++ ) {
    5151                do_wait( &globalA );
    52                 sout | i | endl;
     52                sout | i;
    5353        }
    5454
     
    7676        srandom( time( NULL ) );
    7777        printf("%p\n", &globalA);
    78         sout | "Starting" | endl;
     78        sout | "Starting";
    7979        {
    8080                Acceptor r;
     
    8282
    8383        }
    84         sout | "Done" | endl;
     84        sout | "Done";
    8585}
  • tests/concurrent/waitfor/statment.cfa

    r9b086ca rcde3891  
    8484                case 7: return call7( m );
    8585                default :
    86                         serr | "Incorrect index" | index | endl;
     86                        serr | "Incorrect index" | index;
    8787                        abort();
    8888        }
     
    102102        while( !done ) {
    103103                   waitfor( get_index, this );
    104                 or waitfor( call1, this ) { sout | "Statement" | endl; if( this.last_val != 1 ) { serr | "Incorrect index: expected" | 1 | "got" | this.last_val | endl; } }
    105                 or waitfor( call2, this ) { sout | "Statement" | endl; if( this.last_val != 2 ) { serr | "Incorrect index: expected" | 2 | "got" | this.last_val | endl; } }
    106                 or waitfor( call3, this ) { sout | "Statement" | endl; if( this.last_val != 3 ) { serr | "Incorrect index: expected" | 3 | "got" | this.last_val | endl; } }
    107                 or waitfor( call4, this ) { sout | "Statement" | endl; if( this.last_val != 4 ) { serr | "Incorrect index: expected" | 4 | "got" | this.last_val | endl; } }
    108                 or waitfor( call5, this ) { sout | "Statement" | endl; if( this.last_val != 5 ) { serr | "Incorrect index: expected" | 5 | "got" | this.last_val | endl; } }
    109                 or waitfor( call6, this ) { sout | "Statement" | endl; if( this.last_val != 6 ) { serr | "Incorrect index: expected" | 6 | "got" | this.last_val | endl; } }
    110                 or waitfor( call7, this ) { sout | "Statement" | endl; if( this.last_val != 7 ) { serr | "Incorrect index: expected" | 7 | "got" | this.last_val | endl; } }
     104                or waitfor( call1, this ) { sout | "Statement"; if( this.last_val != 1 ) { serr | "Incorrect index: expected" | 1 | "got" | this.last_val; } }
     105                or waitfor( call2, this ) { sout | "Statement"; if( this.last_val != 2 ) { serr | "Incorrect index: expected" | 2 | "got" | this.last_val; } }
     106                or waitfor( call3, this ) { sout | "Statement"; if( this.last_val != 3 ) { serr | "Incorrect index: expected" | 3 | "got" | this.last_val; } }
     107                or waitfor( call4, this ) { sout | "Statement"; if( this.last_val != 4 ) { serr | "Incorrect index: expected" | 4 | "got" | this.last_val; } }
     108                or waitfor( call5, this ) { sout | "Statement"; if( this.last_val != 5 ) { serr | "Incorrect index: expected" | 5 | "got" | this.last_val; } }
     109                or waitfor( call6, this ) { sout | "Statement"; if( this.last_val != 6 ) { serr | "Incorrect index: expected" | 6 | "got" | this.last_val; } }
     110                or waitfor( call7, this ) { sout | "Statement"; if( this.last_val != 7 ) { serr | "Incorrect index: expected" | 7 | "got" | this.last_val; } }
    111111
    112112                done = true;
     
    128128int main() {
    129129        processor p[2];
    130         sout | "Starting" | endl;
     130        sout | "Starting";
    131131        {
    132132                caller c[7];
    133133                waiter w;
    134134        }
    135         sout | "Stopping" | endl;
     135        sout | "Stopping";
    136136}
  • tests/concurrent/waitfor/when.cfa

    r9b086ca rcde3891  
    5858void arbiter( global_t & mutex this ) {
    5959        for( int i = 0; i < N; i++ ) {
    60                    when( this.last_call == 6 ) waitfor( call1, this ) { if( this.last_call != 1) { serr | "Expected last_call to be 1 got" | this.last_call | endl; } }
    61                 or when( this.last_call == 1 ) waitfor( call2, this ) { if( this.last_call != 2) { serr | "Expected last_call to be 2 got" | this.last_call | endl; } }
    62                 or when( this.last_call == 2 ) waitfor( call3, this ) { if( this.last_call != 3) { serr | "Expected last_call to be 3 got" | this.last_call | endl; } }
    63                 or when( this.last_call == 3 ) waitfor( call4, this ) { if( this.last_call != 4) { serr | "Expected last_call to be 4 got" | this.last_call | endl; } }
    64                 or when( this.last_call == 4 ) waitfor( call5, this ) { if( this.last_call != 5) { serr | "Expected last_call to be 5 got" | this.last_call | endl; } }
    65                 or when( this.last_call == 5 ) waitfor( call6, this ) { if( this.last_call != 6) { serr | "Expected last_call to be 6 got" | this.last_call | endl; } }
     60                   when( this.last_call == 6 ) waitfor( call1, this ) { if( this.last_call != 1) { serr | "Expected last_call to be 1 got" | this.last_call; } }
     61                or when( this.last_call == 1 ) waitfor( call2, this ) { if( this.last_call != 2) { serr | "Expected last_call to be 2 got" | this.last_call; } }
     62                or when( this.last_call == 2 ) waitfor( call3, this ) { if( this.last_call != 3) { serr | "Expected last_call to be 3 got" | this.last_call; } }
     63                or when( this.last_call == 3 ) waitfor( call4, this ) { if( this.last_call != 4) { serr | "Expected last_call to be 4 got" | this.last_call; } }
     64                or when( this.last_call == 4 ) waitfor( call5, this ) { if( this.last_call != 5) { serr | "Expected last_call to be 5 got" | this.last_call; } }
     65                or when( this.last_call == 5 ) waitfor( call6, this ) { if( this.last_call != 6) { serr | "Expected last_call to be 6 got" | this.last_call; } }
    6666
    67                 sout | this.last_call | endl;
     67                sout | this.last_call;
    6868        }
    6969
     
    7878int main() {
    7979        srandom( time(NULL) );
    80         sout | "Starting" | endl;
     80        sout | "Starting";
    8181        {
    8282                arbiter_t arbiter;
     
    8484
    8585        }
    86         sout | "Stopping" | endl;
     86        sout | "Stopping";
    8787}
  • tests/coroutine/.expect/fmtLines.txt

    r9b086ca rcde3891  
    1616difi  ed B  y :   Pete  r A. 
    1717 Buh  r//   Last   Mod  ifie 
    18 d On   : M  on S  ep 1  8 11 
    19 :35:  57 2  017/  / Up  date 
    20  Cou  nt       :   31/  /#in 
     18d On   : T  ue D  ec 1  1 23 
     19:31:  12 2  018/  / Up  date 
     20 Cou  nt       :   32/  /#in 
    2121clud  e <f  stre  am.h  fa># 
    2222incl  ude   <cor  outi  ne.h 
     
    3434t )   {      if   ( fm  t.g   
    3535!= 0   ||   fmt.  b !=   0 ) 
    36  sou  t |   endl  ;}vo  id m 
    37 ain(   For  mat   & fm  t )   
    38 {       fo  r (   ;; )   {                                               
    39                                   // f  or a  s ma  ny c 
    40 hara  cter  s           f  or (   fmt 
    41 .g =   0;   fmt.  g <   5; f 
    42 mt.g   +=   1 )   {             /  / gr 
    43 oups   of   5 bl  ocks                          f 
    44 or (   fmt  .b =   0;   fmt. 
    45 b <   4; f  mt.b   +=   1 )   
    46 {       //   blo  cks   of 4   cha 
    47 ract  ers                               f  or (   ;;   
    48 ) {                                                     //   for   new 
    49 line   cha  ract  ers                                     
    50 susp  end(  );                                  i  f (   
    51 fmt.  ch !  = '\  n' )   bre 
    52 ak;             //   igno  re n  ewli 
    53 ne                              }   // f  or                            so 
    54 ut |   fmt  .ch;                                                        / 
    55 / pr  int   char  acte  r                         
    56 } //   for                      s  out   | "   
    57  ";                                                             /  / pr  int   
    58 bloc  k se  para  tor           } / 
    59 / fo  r         s  out   | en  dl;       
    60                                                                   // p  rint   gro 
    61 up s  epar  ator        } /  / fo 
    62 r} /  / ma  invo  id p  rt(   
    63 Form  at &   fmt  , ch  ar c 
    64 h )   {      fmt  .ch   = ch 
    65 ;      res  ume(   fmt   );} 
    66  //   prti  nt m  ain(  ) {       
    67 Form  at f  mt;   char   ch; 
    68         for   ( ;  ; )   {              s  in | 
    69  ch;                                                                            //   rea 
    70 d on  e ch  arac  ter       if 
    71  ( e  of(   sin   ) )   brea 
    72 k;                                                      //   eof   ?            p 
    73 rt(   fmt,   ch   );    }   //   
    74 for}   //   main  // L  ocal 
    75  Var  iabl  es:   ////   tab 
    76 -wid  th:   4 //  // c  ompi 
    77 le-c  omma  nd:   "cfa   fmt 
    78 Line  s.c"   ///  / En  d: / 
    79 /
     36 sou  t |   nl;}  void   mai 
     37n( F  orma  t &   fmt   ) {       
     38for   ( ;;   ) {                                                                 
     39                //   for   as   many   cha 
     40ract  ers               for   ( f  mt.g 
     41 = 0  ; fm  t.g   < 5;   fmt 
     42.g +  = 1   ) {         //   grou 
     43ps o  f 5   bloc  ks                    for 
     44 ( f  mt.b   = 0  ; fm  t.b   
     45< 4;   fmt  .b +  = 1   ) {       
     46// b  lock  s of   4 c  hara 
     47cter  s                         for   ( ;  ; )   
     48{                                                         // f  or n  ewli 
     49ne c  hara  cter  s                                     su 
     50spen  d();                                      if   ( fm 
     51t.ch   !=   '\n'   ) b  reak 
     52;               /  / ig  nore   new  line 
     53                                  } //   for                              sout 
     54 | f  mt.c  h;                                                  //   
     55prin  t ch  arac  ter                   }   
     56// f  or                        sou  t |   "  " 
     57;                                                               //   prin  t bl 
     58ock   sepa  rato  r             }   //   
     59for             sou  t |   nl;                                   
     60                                  // p  rint   gro  up s 
     61epar  ator      } /  / fo  r} / 
     62/ ma  invo  id p  rt(   Form 
     63at &   fmt  , ch  ar c  h )   
     64{      fmt  .ch   = ch  ;     
     65 res  ume(   fmt   );}   //   
     66prti  nt m  ain(  ) {     Form 
     67at f  mt;         char   ch;    for 
     68 ( ;  ; )   {           s  in |   ch; 
     69                                                                                //   rea  d on 
     70e ch  arac  ter     if   ( e 
     71of(   sin   ) )   brea  k;               
     72                                        //   eof   ?            p  rt(   
     73fmt,   ch   );  }   //   for} 
     74 //   main  // L  ocal   Var 
     75iabl  es:   ////   tab  -wid 
     76th:   4 //  // c  ompi  le-c 
     77omma  nd:   "cfa   fmt  Line 
     78s.c"   ///  / En  d: /  /
  • tests/coroutine/.in/fmtLines.txt

    r9b086ca rcde3891  
    1010// Created On       : Sun Sep 17 21:56:15 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 18 11:35:57 2017
    13 // Update Count     : 31
     12// Last Modified On : Tue Dec 11 23:31:12 2018
     13// Update Count     : 32
    1414//
    1515
     
    2727
    2828void ^?{}( Format & fmt ) {
    29     if ( fmt.g != 0 || fmt.b != 0 ) sout | endl;
     29    if ( fmt.g != 0 || fmt.b != 0 ) sout | nl;
    3030}
    3131
     
    4242                        sout | "  ";                                                            // print block separator
    4343                } // for
    44                 sout | endl;                                                                    // print group separator
     44                sout | nl;                                                                      // print group separator
    4545        } // for
    4646} // main
  • tests/coroutine/fibonacci.cfa

    r9b086ca rcde3891  
    1010// Created On       : Thu Jun  8 07:29:37 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Aug 18 11:21:58 2018
    13 // Update Count     : 24
     12// Last Modified On : Tue Dec 11 21:57:33 2018
     13// Update Count     : 25
    1414//
    1515
     
    3939        Fibonacci f1, f2;
    4040        for ( 10 ) {                                                                            // print N Fibonacci values
    41                 sout | next( f1 ) | next( f2 ) | endl;
     41                sout | next( f1 ) | next( f2 );
    4242        } // for
    4343}
  • tests/coroutine/fibonacci_1.cfa

    r9b086ca rcde3891  
    1010// Created On       : Thu Apr 26 23:20:08 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Aug 18 11:21:02 2018
    13 // Update Count     : 13
     12// Last Modified On : Tue Dec 11 21:57:54 2018
     13// Update Count     : 14
    1414//
    1515
     
    3636        Fibonacci f1, f2;
    3737        for ( 10 ) {                                                                            // print N Fibonacci values
    38                 sout | next( f1 ) | next( f2 ) | endl;
     38                sout | next( f1 ) | next( f2 );
    3939        } // for
    4040}
  • tests/coroutine/fmtLines.cfa

    r9b086ca rcde3891  
    1010// Created On       : Sun Sep 17 21:56:15 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 16 08:20:54 2018
    13 // Update Count     : 45
     12// Last Modified On : Sat Dec 22 18:27:00 2018
     13// Update Count     : 57
    1414//
    1515
     
    2424void main( Format & fmt ) with( fmt ) {
    2525        for () {                                                                                        // for as many characters
    26                 for ( g; 5 ) {                                                                  // groups of 5 blocks
    27                         for ( b; 4 ) {                                                          // blocks of 4 characters
     26                for ( g = 0; g < 5; g += 1 ) {                                  // groups of 5 blocks
     27                        for ( b = 0; b < 4; b += 1 ) {                          // blocks of 4 characters
    2828                                for () {                                                                // for newline characters
    2929                                        suspend();
    30                                         if ( ch != '\n' ) break;                        // ignore newline
     30                                  if ( ch != '\n' ) break;                              // ignore newline
    3131                                } // for
    3232                                sout | ch;                                                              // print character
     
    3434                        sout | "  ";                                                            // print block separator
    3535                } // for
    36                 sout | endl;                                                                    // print group separator
     36                sout | nl;                                                                              // print group separator
    3737        } // for
    3838} // main
     
    4343
    4444void ^?{}( Format & fmt ) with( fmt ) {
    45         if ( g != 0 || b != 0 ) sout | endl;
     45        if ( g != 0 || b != 0 ) sout | nl;
    4646}
    4747
    4848void format( Format & fmt ) {
    4949        resume( fmt );
    50 } // prt
     50} // format
    5151
    5252int main() {
    5353        Format fmt;
     54        sout | nlOff;                                                                           // turn off auto newline
    5455
    5556  eof: for () {                                                                                 // read until end of file
  • tests/coroutine/pingpong.cfa

    r9b086ca rcde3891  
    1010// Created On       : Wed Sep 20 11:55:23 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Aug 18 11:31:11 2018
    13 // Update Count     : 28
     12// Last Modified On : Tue Dec 11 21:58:06 2018
     13// Update Count     : 29
    1414//
    1515
     
    2424
    2525void ?{}( PingPong & this, const char * name, unsigned int N, PingPong & part ) {
     26        (this.__cor){name};
    2627        this.name = name;
    2728        this.N = N;
     
    4041void main( PingPong & pingpong ) {                                              // ping's starter ::main, pong's starter ping
    4142        for ( pingpong.N ) {                                                            // N ping-pongs
    42                 sout | pingpong.name | endl;
     43                sout | pingpong.name;
    4344                cycle( *pingpong.part );
    4445        } // for
  • tests/coroutine/prodcons.cfa

    r9b086ca rcde3891  
    1010// Created On       : Mon Sep 18 12:23:39 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Aug 18 12:55:10 2018
    13 // Update Count     : 51
     12// Last Modified On : Wed Dec 12 23:04:49 2018
     13// Update Count     : 53
    1414//
    1515
     
    2424
    2525coroutine Prod {
    26         Cons * c;
     26        Cons & c;
    2727        int N, money, receipt;
    2828};
     
    3030        // 1st resume starts here
    3131        for ( i; N ) {                                                                          // N pairs of values
    32                 int p1 = random( 100 );
    33                 int p2 = random( 100 );
    34                 sout | p1 | " " | p2 | endl;
    35                 int status = delivery( *c, p1, p2 );
    36                 sout | " $" | money | endl;
    37                 sout | status | endl;
     32                int p1 = random( 100 ), p2 = random( 100 );
     33                sout | p1 | " " | p2;
     34                int status = delivery( c, p1, p2 );
     35                sout | " $" | money | nl | status;
    3836                receipt += 1;
    3937        }
    40         stop( *c );
    41         sout | "prod stops" | endl;
     38        stop( c );
     39        sout | "prod stops";
    4240}
    4341int payment( Prod & prod, int money ) {
     
    4745}
    4846void start( Prod & prod, int N, Cons &c ) {
    49         prod.N = N;
    50         prod.c = &c;
    51         prod.receipt = 0;
     47        &prod.c = &c;
     48        prod.[N, receipt] = [N, 0];
    5249        resume( prod );                                                                         // activate main
    5350}
    5451
    5552coroutine Cons {
    56         Prod * p;
     53        Prod & p;
    5754        int p1, p2, status;
    5855        bool done;
    5956};
    6057void ?{}( Cons & cons, Prod & p ) {
    61         cons.p = &p;
    62         cons.status = 0;
    63         cons.done = false;
     58        &cons.p = &p;
     59        cons.[status, done ] = [0, false];
    6460}
    6561void ^?{}( Cons & cons ) {}
     
    6864        int money = 1, receipt;
    6965        for ( ; ! done; ) {
    70                 sout | p1 | " " | p2 | endl;
    71                 sout | " $" | money | endl;
     66                sout | p1 | " " | p2 | nl | " $" | money;
    7267                status += 1;
    73                 receipt = payment( *p, money );
    74                 sout | " #" | receipt | endl;
     68                receipt = payment( p, money );
     69                sout | " #" | receipt;
    7570                money += 1;
    7671        }
    77         sout | "cons stops" | endl;
     72        sout | "cons stops";
    7873}
    7974int delivery( Cons & cons, int p1, int p2 ) {
    80         cons.p1 = p1;
    81         cons.p2 = p2;
     75        cons.[p1, p2] = [p1, p2];
    8276        resume( cons );                                                                         // main 1st time, then
    8377        return cons.status;                                                                     // cons in payment
     
    9286        srandom( /* getpid() */ 103 );                                          // fixed seed for testing
    9387        start( prod, 5, cons );
    94         sout | "main stops" | endl;
     88        sout | "main stops";
    9589}
    9690
  • tests/coroutine/runningTotal.cfa

    r9b086ca rcde3891  
    1010// Created On       : Wed Dec  6 08:05:27 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 16 08:22:29 2018
    13 // Update Count     : 3
     12// Last Modified On : Tue Dec 11 21:59:00 2018
     13// Update Count     : 4
    1414//
    1515
     
    4242        RunTotal rntl;
    4343        for ( i; 10 ) {
    44                 sout | i | add( rntl, i ) | endl;
     44                sout | i | add( rntl, i );
    4545        } // for
    4646}
  • tests/counter.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // counter.c --
     7// counter.cfa --
    88//
    99// Author           : Aaron B. Moss
    1010// Created On       : Thu Feb 22 15:27:00 2018
    11 // Last Modified By : Aaron B. Moss
    12 // Last Modified On : Thu Feb 22 15:27:00 2018
    13 // Update Count     : 1
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Tue Nov  6 17:50:23 2018
     13// Update Count     : 2
    1414//
    1515
     
    3737// Local Variables: //
    3838// tab-width: 4 //
    39 // compile-command: "cfa counter.c" //
     39// compile-command: "cfa counter.cfa" //
    4040// End: //
  • tests/declarationErrors.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // declarationErrors.c --
     7// declarationErrors.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Aug 17 08:23:43 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Sep  9 22:57:52 2016
    13 // Update Count     : 31
     12// Last Modified On : Tue Nov  6 17:52:47 2018
     13// Update Count     : 32
    1414//
    1515
     
    4242// Local Variables: //
    4343// tab-width: 4 //
    44 // compile-command: "cfa declarationErrors.c" //
     44// compile-command: "cfa declarationErrors.cfa" //
    4545// End: //
  • tests/declarationSpecifier.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // declarationSpecifier.c --
     7// declarationSpecifier.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Aug 17 08:21:04 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 17 08:24:33 2016
    13 // Update Count     : 2
     12// Last Modified On : Tue Nov  6 17:52:59 2018
     13// Update Count     : 3
    1414//
    1515
     
    9696// Local Variables: //
    9797// tab-width: 4 //
    98 // compile-command: "cfa declarationSpecifier.c" //
     98// compile-command: "cfa declarationSpecifier.cfa" //
    9999// End: //
  • tests/div.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // div.c --
     7// div.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Tue Aug  8 16:28:43 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec  7 09:06:52 2017
    13 // Update Count     : 18
     12// Last Modified On : Tue Dec  4 21:35:01 2018
     13// Update Count     : 20
    1414//
    1515
    1616#include <fstream.hfa>
    17 #include <stdlib.hfa>                                                                           // div
     17#include <stdlib.hfa>                                                                   // div
    1818
    1919struct T { int i; };
     
    2323
    2424int main( void ) {
    25         sout | "div" | div( 13, 5 ) | div( 13L, 5L ) | div( 13LL, 5LL ) | endl;
     25        sout | "div" | div( 13, 5 ) | div( 13L, 5L ) | div( 13LL, 5LL );
    2626        short s1 = 13, s2 = 5;
    27         sout | "div" | div( s1, s2 ) | endl;
     27        sout | "div" | div( s1, s2 );
    2828        T t1 = { 13 }, t2 = { 5 };
    29         sout | "div" | div( t1, t2 ) | endl;                            // polymorphic div
     29        sout | "div" | div( t1, t2 );                                           // polymorphic div
    3030} // main
    3131
    3232// Local Variables: //
    3333// tab-width: 4 //
    34 // compile-command: "cfa div.c" //
     34// compile-command: "cfa div.cfa" //
    3535// End: //
  • tests/except-0.cfa

    r9b086ca rcde3891  
    88#include <stdbool.h>
    99
    10 #include "except-mac.h"
     10#include "except-mac.hfa"
    1111TRIVIAL_EXCEPTION(yin)
    1212TRIVIAL_EXCEPTION(yang)
     
    2525void ^?{}(signal_exit * this) {
    2626        printf("Exiting: %s\n", this->area);
    27 //      sout | "Exiting:" | this->area | endl;
     27//      sout | "Exiting:" | this->area;
    2828}
    2929
  • tests/except-1.cfa

    r9b086ca rcde3891  
    55#include <stdio.h>
    66
    7 #include "except-mac.h"
     7#include "except-mac.hfa"
    88TRIVIAL_EXCEPTION(yin)
    99TRIVIAL_EXCEPTION(yang)
  • tests/except-2.cfa

    r9b086ca rcde3891  
    33
    44#include <stdlib.hfa>
    5 #include "except-mac.h"
     5#include "except-mac.hfa"
    66
    77TRIVIAL_EXCEPTION(yin)
  • tests/except-3.cfa

    r9b086ca rcde3891  
    22
    33#include <stdio.h>
    4 #include "except-mac.h"
     4#include "except-mac.hfa"
    55TRIVIAL_EXCEPTION(myth)
    66
  • tests/extension.cfa

    r9b086ca rcde3891  
    22// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    33//
    4 // extension.c --
     4// extension.cfa --
    55//
    66// Author           : Peter A. Buhr
    77// Created On       : Mon Jul  4 20:42:43 2016
    88// Last Modified By : Peter A. Buhr
    9 // Last Modified On : Mon Feb  6 15:44:39 2017
    10 // Update Count     : 46
     9// Last Modified On : Tue Nov  6 17:53:21 2018
     10// Update Count     : 47
    1111//
    1212
     
    5656// Local Variables: //
    5757// tab-width: 4 //
    58 // compile-command: "cfa extension.c" //
     58// compile-command: "cfa extension.cfa" //
    5959// End: //
  • tests/forall.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // forall.c --
     7// forall.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed May  9 08:48:15 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 12 16:19:08 2018
    13 // Update Count     : 30
     12// Last Modified On : Tue Nov  6 17:53:43 2018
     13// Update Count     : 31
    1414//
    1515
     
    219219// Local Variables: //
    220220// tab-width: 4 //
    221 // compile-command: "cfa forall.c" //
     221// compile-command: "cfa forall.cfa" //
    222222// End: //
  • tests/fstream_test.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // fstream_test.c --
     7// fstream_test.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 24 11:30:26 2017
    13 // Update Count     : 65
     12// Last Modified On : Sat Dec 22 09:47:44 2018
     13// Update Count     : 68
    1414//
    1515
     
    1818int main( void ) {
    1919        int nombre;
    20         sout | "Entrez un nombre, s'il vous plaît:" | endl;
     20        sout | "Entrez un nombre, s'il vous plaît:";
    2121        sin  | nombre;
    22         sout | "Vous avez entré" | nombre | endl;
     22        sout | "Vous avez entré" | nombre;
    2323        sout | "le nombre" | nombre | "est"
    24                  | (nombre > 0 ? "positif" : nombre == 0 ? "zéro" : "négatif") | endl;
     24                 | (nombre > 0 ? "positif" : nombre == 0 ? "zéro" : "négatif");
    2525
    26         sout | "Entrez trois nombres, s'il vous plaît: " | endl;
     26        sout | "Entrez trois nombres, s'il vous plaît:";
    2727        int i, j, k;
    2828        sin  | i | j | k;
    29         sout | "Vous avez entré" | "i:" | "" | i | "j:" | "" | j | "k:" | "" | k | endl;
     29        sout | "Vous avez entré" | "i:" | "" | i | "j:" | "" | j | "k:" | "" | k;
    3030}
    3131
    3232// Local Variables: //
    3333// tab-width: 4 //
    34 // compile-command: "cfa fstream_test.c" //
     34// compile-command: "cfa fstream_test.cfa" //
    3535// End: //
  • tests/function-operator.cfa

    r9b086ca rcde3891  
    1010// Created On       : Fri Aug 25 15:21:11 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  2 09:27:53 2018
    13 // Update Count     : 8
     12// Last Modified On : Tue Dec  4 21:37:09 2018
     13// Update Count     : 9
    1414//
    1515
     
    8383// TODO: abstract over (os, T)
    8484os_wrapper ?=?(os_wrapper & wrapper, int x) {
    85         *wrapper.out | x | endl;
     85        *wrapper.out | x;
    8686        return wrapper;
    8787}
  • tests/functions.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // functions.c --
     7// functions.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Aug 17 08:39:58 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jan 17 22:44:12 2018
    13 // Update Count     : 12
     12// Last Modified On : Tue Nov  6 17:54:09 2018
     13// Update Count     : 13
    1414//
    1515
     
    188188// Local Variables: //
    189189// tab-width: 4 //
    190 // compile-command: "cfa functions.c" //
     190// compile-command: "cfa functions.cfa" //
    191191// End: //
  • tests/gccExtensions.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // gccExtensions.c --
     7// gccExtensions.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Sun Aug 14 17:28:17 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 17 09:26:50 2016
    13 // Update Count     : 10
     12// Last Modified On : Tue Nov  6 17:54:20 2018
     13// Update Count     : 11
    1414//
    1515
     
    120120// Local Variables: //
    121121// tab-width: 4 //
    122 // compile-command: "cfa gccExtensions.c" //
     122// compile-command: "cfa gccExtensions.cfa" //
    123123// End: //
  • tests/gmp.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // gmp.c --
     7// gmp.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Tue Apr 19 08:55:51 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Aug 18 12:43:13 2018
    13 // Update Count     : 556
     12// Last Modified On : Thu Dec 20 22:41:47 2018
     13// Update Count     : 559
    1414//
    1515
     
    1919
    2020int main( void ) {
    21         sout | "constructors" | endl;
     21        sout | "constructors";
    2222        short int si = 3;
    2323        Int x = { "50000000000000000000" }, y = { si }, z = x + y;
    24         sout | x | y | z | endl;
    25         sout | "x:" | x | "y:" | y | "z:" | z | endl;
     24        sout | x | y | z;
     25        sout | "x:" | x | "y:" | y | "z:" | z;
    2626
    27         sout | "conversions" | endl;
     27        sout | "conversions";
    2828        y = 'a';
    29         sout | "y:" | y | endl;
     29        sout | "y:" | y;
    3030        y = "12345678901234567890123456789";
    31         sout | "y:" | y | endl;
     31        sout | "y:" | y;
    3232        y = 100`mp + 100`mp;
    33         sout | "y:" | y | endl;
     33        sout | "y:" | y;
    3434        y = -200u`mp + -200u`mp;
    35         sout | "y:" | y | endl;
     35        sout | "y:" | y;
    3636        y = "12345678901234567890123456789"`mp + "12345678901234567890123456789"`mp;
    37         sout | "y:" | y | endl;
     37        sout | "y:" | y;
    3838        y = si;
    39         sout | "y:" | y | endl;
     39        sout | "y:" | y;
    4040        y = -3;
    41         sout | "y:" | y | endl;
     41        sout | "y:" | y;
    4242        y += 7;
    43         sout | "y:" | y | endl;
     43        sout | "y:" | y;
    4444        y -= 1;
    45         sout | "y:" | y | endl;
     45        sout | "y:" | y;
    4646        int b;
    4747        b = y;
    4848        si = y;
    49         sout | "y:" | y | "b:" | b | "si:" | si | endl;
     49        sout | "y:" | y | "b:" | b | "si:" | si;
    5050
    51         sout | "comparison" | endl;
    52         sout | x == x | endl;
    53         sout | x != x | endl;
    54         sout | x < x | endl;
    55         sout | x <= x | endl;
    56         sout | x > x | endl;
    57         sout | x >= x | endl;
     51        sout | "comparison";
     52        sout | x == x;
     53        sout | x != x;
     54        sout | x < x;
     55        sout | x <= x;
     56        sout | x > x;
     57        sout | x >= x;
    5858
    59         sout | "arithmetic" | endl;
     59        sout | "arithmetic";
    6060        z = x + y + z;
    61         sout | "z:" | z | endl;
     61        sout | "z:" | z;
    6262        z = z = x;
    63         sout | "z:" | z | endl;
     63        sout | "z:" | z;
    6464        z = x - y - z;
    65         sout | "z:" | z | endl;
     65        sout | "z:" | z;
    6666        z = x * y * z;
    67         sout | "z:" | z | endl;
     67        sout | "z:" | z;
    6868        z = x * 3;
    69         sout | "z:" | z | endl;
     69        sout | "z:" | z;
    7070        z = 3 * x;
    71         sout | "z:" | z | endl;
     71        sout | "z:" | z;
    7272        z = x / 3;
    73         sout | "z:" | z | endl;
    74         sout | div( x, 3 ) | x / 3 | "," | x % 3 | endl;
     73        sout | "z:" | z;
     74        sout | div( x, 3 ) | x / 3 | "," | x % 3;
    7575        [ x, y ] = div( x, 3 );
    76         sout | "x:" | x | "y:" | y | endl;
     76        sout | "x:" | x | "y:" | y;
    7777
    78         sout | endl;
     78        sout | nl;
    7979
    8080        sin | x | y | z;
    81         sout | x | y | z | endl;
     81        sout | x | y | z;
    8282
    83         sout | endl;
     83        sout | nl;
    8484
    85         sout | "Fibonacci Numbers" | endl;
     85        sout | "Fibonacci Numbers";
    8686        Int fn, fn1, fn2;
    8787        fn = (Int){0}; fn1 = fn;                                                        // 1st case
    88         sout | (int)0 | fn | endl;
     88        sout | (int)0 | fn;
    8989        fn = 1; fn2 = fn1; fn1 = fn;                                            // 2nd case
    90         sout | 1 | fn | endl;
     90        sout | 1 | fn;
    9191        for ( i; 2u ~= 200 ) {
    9292                fn = fn1 + fn2; fn2 = fn1; fn1 = fn;                    // general case
    93                 sout | i | fn | endl;
     93                sout | i | fn;
    9494        } // for
    9595
    96         sout | endl;
     96        sout | nl;
    9797
    98         sout | "Factorial Numbers" | endl;
     98        sout | "Factorial Numbers";
    9999        Int fact = 1;                                                                           // 1st case
    100         sout | (int)0 | fact | endl;
     100        sout | (int)0 | fact;
    101101        for ( i; 1u ~= 40u ) {
    102102                fact *= i;                                                                              // general case
    103                 sout | i | fact | endl;
     103                sout | i | fact;
    104104        } // for
    105105} // main
     
    107107// Local Variables: //
    108108// tab-width: 4 //
    109 // compile-command: "cfa gmp.c -lgmp" //
     109// compile-command: "cfa gmp.cfa -lgmp" //
    110110// End: //
  • tests/heap.cfa

    r9b086ca rcde3891  
     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// heap.cfa --
     8//
     9// Author           : Peter A. Buhr
     10// Created On       : Tue Nov  6 17:54:56 2018
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Tue Dec 11 21:52:40 2018
     13// Update Count     : 18
     14//
     15
    116#include <thread.hfa>
    2 #include <kernel.hfa>                                                                           // processor
    3 #include <stdlib.hfa>                                                                           // *allocs
     17#include <kernel.hfa>                                                                   // processor
     18#include <stdlib.hfa>                                                                   // *allocs
    419#include <malloc.h>                                                                             // malloc_*
    520
     
    2237void main( Worker & ) {
    2338    enum { NoOfAllocs = 5000, NoOfMmaps = 10 };
    24     char *locns[NoOfAllocs];
     39    char * locns[NoOfAllocs];
    2540    int i;
    2641
    2742    // check alloc/free
    2843
    29     for ( int j = 0; j < 40; j += 1 ) {
    30                 for ( i = 0; i < NoOfAllocs; i += 1 ) {
     44    for ( j; 40 ) {
     45                for ( i; NoOfAllocs ) {
    3146                        locns[i] = alloc( i );
    32                         //sout | (void *)locns[i] | endl;
    33                         for ( int k = 0; k < i; k += 1 ) locns[i][k] = '\345';
    34                 } // for
    35                 //sout | (char *)sbrk(0) - start | " bytes" | endl;
    36 
    37                 for ( i = 0; i < NoOfAllocs; i += 1 ) {
    38                         //sout | (void *)locns[i] | endl;
    39                         for ( int k = 0; k < i; k += 1 ) if ( locns[i][k] != '\345' ) abort( "new/delete corrupt storage1" );
     47                        //sout | (void *)locns[i];
     48                        for ( k; i ) locns[i][k] = '\345';
     49                } // for
     50                //sout | (char *)sbrk(0) - start | " bytes";
     51
     52                for ( i; NoOfAllocs ) {
     53                        //sout | (void *)locns[i];
     54                        for ( k; i ) if ( locns[i][k] != '\345' ) abort( "new/delete corrupt storage1" );
    4055                        free( locns[i] );
    4156                } // for
    42                 //sout | (char *)sbrk(0) - start | " bytes" | endl;
    43 
    44                 for ( i = 0; i < NoOfAllocs; i += 1 ) {
     57                //sout | (char *)sbrk(0) - start | " bytes";
     58
     59                for ( i; NoOfAllocs ) {
    4560                        locns[i] = alloc( i );
    46                         //sout | (void *)locns[i] | endl;
    47                         for ( int k = 0; k < i; k += 1 ) locns[i][k] = '\345';
    48                 } // for
    49                 for ( i = NoOfAllocs - 1; i >=0 ; i -= 1 ) {
    50                         //sout | (void *)locns[i] | endl;
    51                         for ( int k = 0; k < i; k += 1 ) if ( locns[i][k] != '\345' ) abort( "new/delete corrupt storage2" );
     61                        //sout | (void *)locns[i];
     62                        for ( k; i ) locns[i][k] = '\345';
     63                } // for
     64                for ( i; NoOfAllocs - 1 -~= 0 ) {
     65                        //sout | (void *)locns[i];
     66                        for ( k; i ) if ( locns[i][k] != '\345' ) abort( "new/delete corrupt storage2" );
    5267                        free( locns[i] );
    5368                } // for
     
    5671    // check malloc/free (sbrk)
    5772
    58     for ( i = 0; i < NoOfAllocs; i += 1 ) {
     73    for ( i; NoOfAllocs ) {
    5974                size_t s = (i + 1) * 20;
    60                 char *area = (char *)malloc( s );
     75                char * area = (char *)malloc( s );
    6176                if ( area == 0 ) abort( "malloc/free out of memory" );
    6277                area[0] = '\345'; area[s - 1] = '\345';                 // fill first/last
     
    6580    } // for
    6681
    67     for ( i = 0; i < NoOfAllocs; i += 1 ) {
    68                 size_t s = i + 1;                               // +1 to make initialization simpler
     82    for ( i; NoOfAllocs ) {
     83                size_t s = i + 1;                                                               // +1 to make initialization simpler
    6984                locns[i] = (char *)malloc( s );
    7085                if ( locns[i] == 0 ) abort( "malloc/free out of memory" );
     
    7287                locns[i][malloc_usable_size( locns[i] ) - 1] = '\345'; // fill ultimate byte
    7388    } // for
    74     for ( i = 0; i < NoOfAllocs; i += 1 ) {
     89    for ( i; NoOfAllocs ) {
    7590                size_t s = i + 1;
    7691                if ( locns[i][0] != '\345' || locns[i][s - 1] != '\345' ||
     
    8196    // check malloc/free (mmap)
    8297
    83     for ( i = 0; i < NoOfMmaps; i += 1 ) {
    84                 size_t s = i + default_mmap_start();                            // cross over point
    85                 char *area = (char *)malloc( s );
     98    for ( i; NoOfMmaps ) {
     99                size_t s = i + default_mmap_start();                    // cross over point
     100                char * area = (char *)malloc( s );
    86101                if ( area == 0 ) abort( "malloc/free out of memory" );
    87102                area[0] = '\345'; area[s - 1] = '\345';                 // fill first/last
     
    90105    } // for
    91106
    92     for ( i = 0; i < NoOfMmaps; i += 1 ) {
    93                 size_t s = i + default_mmap_start();                            // cross over point
     107    for ( i; NoOfMmaps ) {
     108                size_t s = i + default_mmap_start();                    // cross over point
    94109                locns[i] = (char *)malloc( s );
    95110                if ( locns[i] == 0 ) abort( "malloc/free out of memory" );
     
    97112                locns[i][malloc_usable_size( locns[i] ) - 1] = '\345'; // fill ultimate byte
    98113    } // for
    99     for ( i = 0; i < NoOfMmaps; i += 1 ) {
    100                 size_t s = i + default_mmap_start();                            // cross over point
     114    for ( i; NoOfMmaps ) {
     115                size_t s = i + default_mmap_start();                    // cross over point
    101116                if ( locns[i][0] != '\345' || locns[i][s - 1] != '\345' ||
    102117                         locns[i][malloc_usable_size( locns[i] ) - 1] != '\345' ) abort( "malloc/free corrupt storage" );
     
    106121    // check calloc/free (sbrk)
    107122
    108     for ( i = 0; i < NoOfAllocs; i += 1 ) {
     123    for ( i; NoOfAllocs ) {
    109124                size_t s = (i + 1) * 20;
    110                 char *area = (char *)calloc( 5, s );
     125                char * area = (char *)calloc( 5, s );
    111126                if ( area == 0 ) abort( "calloc/free out of memory" );
    112127                if ( area[0] != '\0' || area[s - 1] != '\0' ||
     
    118133    } // for
    119134
    120     for ( i = 0; i < NoOfAllocs; i += 1 ) {
     135    for ( i; NoOfAllocs ) {
    121136                size_t s = i + 1;
    122137                locns[i] = (char *)calloc( 5, s );
     
    128143                locns[i][malloc_usable_size( locns[i] ) - 1] = '\345'; // fill ultimate byte
    129144    } // for
    130     for ( i = 0; i < NoOfAllocs; i += 1 ) {
     145    for ( i; NoOfAllocs ) {
    131146                size_t s = i + 1;
    132147                if ( locns[i][0] != '\345' || locns[i][s - 1] != '\345' ||
     
    137152    // check calloc/free (mmap)
    138153
    139     for ( i = 0; i < NoOfMmaps; i += 1 ) {
    140                 size_t s = i + default_mmap_start();                            // cross over point
    141                 char *area = (char *)calloc( 1, s );
     154    for ( i; NoOfMmaps ) {
     155                size_t s = i + default_mmap_start();                    // cross over point
     156                char * area = (char *)calloc( 1, s );
    142157                if ( area == 0 ) abort( "calloc/free out of memory" );
    143158                if ( area[0] != '\0' || area[s - 1] != '\0' ) abort( "calloc/free corrupt storage4.1" );
     
    149164    } // for
    150165
    151     for ( i = 0; i < NoOfMmaps; i += 1 ) {
    152                 size_t s = i + default_mmap_start();                            // cross over point
     166    for ( i; NoOfMmaps ) {
     167                size_t s = i + default_mmap_start();                    // cross over point
    153168                locns[i] = (char *)calloc( 1, s );
    154169                if ( locns[i] == 0 ) abort( "calloc/free out of memory" );
     
    159174                locns[i][malloc_usable_size( locns[i] ) - 1] = '\345'; // fill ultimate byte
    160175    } // for
    161     for ( i = 0; i < NoOfMmaps; i += 1 ) {
    162                 size_t s = i + default_mmap_start();                            // cross over point
     176    for ( i; NoOfMmaps ) {
     177                size_t s = i + default_mmap_start();                    // cross over point
    163178                if ( locns[i][0] != '\345' || locns[i][s - 1] != '\345' ||
    164179                         locns[i][malloc_usable_size( locns[i] ) - 1] != '\345' ) abort( "calloc/free corrupt storage6" );
     
    170185    enum { limit = 64 * 1024 };                                                 // check alignments up to here
    171186
    172     for ( size_t a = libAlign(); a <= limit; a += a ) { // generate powers of 2
    173                 //sout | alignments[a] | endl;
    174                 for ( int s = 1; s < NoOfAllocs; s += 1 ) {             // allocation of size 0 can return null
    175                         char *area = (char *)memalign( a, s );
     187        for ( a; libAlign() ~= limit ~ a ) {                            // generate powers of 2
     188                //sout | alignments[a];
     189                for ( s; 1 ~ NoOfAllocs ) {                                             // allocation of size 0 can return null
     190                        char * area = (char *)memalign( a, s );
    176191                        if ( area == 0 ) abort( "memalign/free out of memory" );
    177                         //sout | i | " " | area | endl;
     192                        //sout | i | " " | area;
    178193                        if ( (size_t)area % a != 0 || malloc_alignment( area ) != a ) { // check for initial alignment
    179194                                abort( "memalign/free bad alignment : memalign(%d,%d) = %p", (int)a, s, area );
     
    187202    // check memalign/free (mmap)
    188203
    189     for ( size_t a = libAlign(); a <= limit; a += a ) { // generate powers of 2
    190                 //sout | alignments[a] | endl;
    191                 for ( i = 1; i < NoOfMmaps; i += 1 ) {
    192                         size_t s = i + default_mmap_start();                    // cross over point
    193                         char *area = (char *)memalign( a, s );
     204        for ( a; libAlign() ~= limit ~ a ) {                            // generate powers of 2
     205                //sout | alignments[a];
     206                for ( i; 1 ~ NoOfMmaps ) {
     207                        size_t s = i + default_mmap_start();            // cross over point
     208                        char * area = (char *)memalign( a, s );
    194209                        if ( area == 0 ) abort( "memalign/free out of memory" );
    195                         //sout | i | " " | area | endl;
     210                        //sout | i | " " | area;
    196211                        if ( (size_t)area % a != 0 || malloc_alignment( area ) != a ) { // check for initial alignment
    197212                                abort( "memalign/free bad alignment : memalign(%d,%d) = %p", (int)a, (int)s, area );
     
    205220    // check calloc/realloc/free (sbrk)
    206221
    207     for ( i = 1; i < 10000; i += 12 ) {
     222    for ( i; 1 ~ 10_000 ~ 12 ) {
    208223                // initial N byte allocation
    209                 char *area = (char *)calloc( 5, i );
     224                char * area = (char *)calloc( 5, i );
    210225                if ( area == 0 ) abort( "calloc/realloc/free out of memory" );
    211226                if ( area[0] != '\0' || area[i - 1] != '\0' ||
     
    214229
    215230                // Do not start this loop index at 0 because realloc of 0 bytes frees the storage.
    216                 for ( int s = i; s < 256 * 1024; s += 26 ) {    // start at initial memory request
     231                for ( s; i ~ 256 * 1024 ~ 26 ) {                                // start at initial memory request
    217232                        area = (char *)realloc( area, s );                      // attempt to reuse storage
    218233                        if ( area == 0 ) abort( "calloc/realloc/free out of memory" );
     
    226241    // check calloc/realloc/free (mmap)
    227242
    228     for ( i = 1; i < 1000; i += 12 ) {
     243    for ( i; 1 ~ 10_000 ~ 12 ) {
    229244                // initial N byte allocation
    230                 size_t s = i + default_mmap_start();                            // cross over point
    231                 char *area = (char *)calloc( 1, s );
     245                size_t s = i + default_mmap_start();                    // cross over point
     246                char * area = (char *)calloc( 1, s );
    232247                if ( area == 0 ) abort( "calloc/realloc/free out of memory" );
    233248                if ( area[0] != '\0' || area[s - 1] != '\0' ||
     
    236251
    237252                // Do not start this loop index at 0 because realloc of 0 bytes frees the storage.
    238                 for ( int r = i; r < 256 * 1024; r += 26 ) {    // start at initial memory request
    239                         area = (char *)realloc( area, r );              // attempt to reuse storage
     253                for ( r; i ~ 256 * 1024 ~ 26 ) {                                // start at initial memory request
     254                        area = (char *)realloc( area, r );                      // attempt to reuse storage
    240255                        if ( area == 0 ) abort( "calloc/realloc/free out of memory" );
    241256                        if ( area[0] != '\0' || area[r - 1] != '\0' ||
     
    249264
    250265    size_t amount = 2;
    251     for ( size_t a = libAlign(); a <= limit; a += a ) { // generate powers of 2
     266        for ( a; libAlign() ~= limit ~ a ) {                            // generate powers of 2
    252267                // initial N byte allocation
    253                 char *area = (char *)memalign( a, amount );             // aligned N-byte allocation
     268                char * area = (char *)memalign( a, amount );    // aligned N-byte allocation
    254269                if ( area == 0 ) abort( "memalign/realloc/free out of memory" ); // no storage ?
    255                 //sout | alignments[a] | " " | area | endl;
     270                //sout | alignments[a] | " " | area;
    256271                if ( (size_t)area % a != 0 || malloc_alignment( area ) != a ) { // check for initial alignment
    257272                        abort( "memalign/realloc/free bad alignment : memalign(%d,%d) = %p", (int)a, (int)amount, area );
     
    260275
    261276                // Do not start this loop index at 0 because realloc of 0 bytes frees the storage.
    262                 for ( int s = amount; s < 256 * 1024; s += 1 ) { // start at initial memory request
     277                for ( s; amount ~ 256 * 1024 ) {                                // start at initial memory request
    263278                        if ( area[0] != '\345' || area[s - 2] != '\345' ) abort( "memalign/realloc/free corrupt storage" );
    264279                        area = (char *)realloc( area, s );                      // attempt to reuse storage
    265280                        if ( area == 0 ) abort( "memalign/realloc/free out of memory" ); // no storage ?
    266                         //sout | i | " " | area | endl;
     281                        //sout | i | " " | area;
    267282                        if ( (size_t)area % a != 0 ) {                          // check for initial alignment
    268283                                abort( "memalign/realloc/free bad alignment %p", area );
     
    275290    // check cmemalign/free
    276291
    277     for ( size_t a = libAlign(); a <= limit; a += a ) { // generate powers of 2
    278                 //sout | alignments[a] | endl;
    279                 for ( int s = 1; s < limit; s += 1 ) {                  // allocation of size 0 can return null
    280                         char *area = (char *)cmemalign( a, 1, s );
     292        for ( a; libAlign() ~= limit ~ a ) {                            // generate powers of 2
     293                //sout | alignments[a];
     294                for ( s; 1 ~ limit ) {                                                  // allocation of size 0 can return null
     295                        char * area = (char *)cmemalign( a, 1, s );
    281296                        if ( area == 0 ) abort( "cmemalign/free out of memory" );
    282                         //sout | i | " " | area | endl;
     297                        //sout | i | " " | area;
    283298                        if ( (size_t)area % a != 0 || malloc_alignment( area ) != a ) { // check for initial alignment
    284299                                abort( "cmemalign/free bad alignment : cmemalign(%d,%d) = %p", (int)a, s, area );
     
    295310
    296311    amount = 2;
    297     for ( size_t a = libAlign() + libAlign(); a <= limit; a += a ) { // generate powers of 2
     312        for ( a; libAlign() ~= limit ~ a ) {                            // generate powers of 2
    298313                // initial N byte allocation
    299                 char *area = (char *)cmemalign( a, 1, amount ); // aligned N-byte allocation
     314                char * area = (char *)cmemalign( a, 1, amount ); // aligned N-byte allocation
    300315                if ( area == 0 ) abort( "cmemalign/realloc/free out of memory" ); // no storage ?
    301                 //sout | alignments[a] | " " | area | endl;
     316                //sout | alignments[a] | " " | area;
    302317                if ( (size_t)area % a != 0 || malloc_alignment( area ) != a ) { // check for initial alignment
    303318                        abort( "cmemalign/realloc/free bad alignment : cmemalign(%d,%d) = %p", (int)a, (int)amount, area );
     
    309324
    310325                // Do not start this loop index at 0 because realloc of 0 bytes frees the storage.
    311                 for ( int s = amount; s < 256 * 1024; s += 1 ) { // start at initial memory request
     326                for ( s; amount ~ 256 * 1024 ) {                                // start at initial memory request
    312327                        if ( area[0] != '\345' || area[s - 2] != '\345' ) abort( "cmemalign/realloc/free corrupt storage2" );
    313328                        area = (char *)realloc( area, s );                      // attempt to reuse storage
    314329                        if ( area == 0 ) abort( "cmemalign/realloc/free out of memory" ); // no storage ?
    315                         //sout | i | " " | area | endl;
     330                        //sout | i | " " | area;
    316331                        if ( (size_t)area % a != 0 || malloc_alignment( area ) != a ) { // check for initial alignment
    317332                                abort( "cmemalign/realloc/free bad alignment %p", area );
     
    324339                free( area );
    325340    } // for
    326         //sout | "worker" | thisTask() | "successful completion" | endl;
     341        //sout | "worker" | thisTask() | "successful completion";
    327342} // Worker main
    328343
     
    339354// Local Variables: //
    340355// tab-width: 4 //
    341 // compile-command: "cfa -nodebug -O2 heap.c" //
     356// compile-command: "cfa -nodebug -O2 heap.cfa" //
    342357// End: //
  • tests/identFuncDeclarator.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // identFuncDeclarator.c --
     7// identFuncDeclarator.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Aug 17 08:36:34 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jan 17 22:39:13 2018
    13 // Update Count     : 2
     12// Last Modified On : Tue Nov  6 17:56:33 2018
     13// Update Count     : 3
    1414//
    1515
     
    115115// Local Variables: //
    116116// tab-width: 4 //
    117 // compile-command: "cfa identFuncDeclarator.c" //
     117// compile-command: "cfa identFuncDeclarator.cfa" //
    118118// End: //
  • tests/identParamDeclarator.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // identParamDeclarator.c --
     7// identParamDeclarator.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Aug 17 08:37:56 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jan 17 22:36:11 2018
    13 // Update Count     : 2
     12// Last Modified On : Tue Nov  6 17:56:44 2018
     13// Update Count     : 3
    1414//
    1515
     
    163163// Local Variables: //
    164164// tab-width: 4 //
    165 // compile-command: "cfa identParamDeclarator.c" //
     165// compile-command: "cfa identParamDeclarator.cfa" //
    166166// End: //
  • tests/ifwhileCtl.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ifwhileCtl.c --
     7// ifwhileCtl.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Sat Aug 26 10:13:11 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jun  6 17:15:09 2018
    13 // Update Count     : 21
     12// Last Modified On : Tue Dec  4 21:39:18 2018
     13// Update Count     : 23
    1414//
    1515
     
    2222
    2323        if ( int x = 1 ) {
    24                 sout | "x != 0 correct" | endl;
     24                sout | "x != 0 correct";
    2525        } else {
    26                 sout | "x == 0 incorrect" | endl;
     26                sout | "x == 0 incorrect";
    2727        } // if
    2828
    2929        if ( int x = 4, y = 0 ) {
    30                 sout | "x != 0 && y != 0 incorrect" | endl;
     30                sout | "x != 0 && y != 0 incorrect";
    3131        } else if ( int x = 4, y = 1 ) {
    32                 sout | "x != 0 && y != 0 correct" | endl;
     32                sout | "x != 0 && y != 0 correct";
    3333        } else {
    34                 sout | "x == 0 || y == 0 incorrect" | endl;
     34                sout | "x == 0 || y == 0 incorrect";
    3535        } // if
    3636
    3737        if ( int x = 5, y = f( x ); x == y ) {
    38                 sout | "x == y correct" | endl;
     38                sout | "x == y correct";
    3939        } else {
    40                 sout | "x != y incorrect" | endl;
     40                sout | "x != y incorrect";
    4141        } // if
    4242
    4343        if ( struct S { int i; } s = { 3 }; s.i < 4 ) {
    4444                S s1;
    45                 sout | "s.i < 4 correct" | endl;
     45                sout | "s.i < 4 correct";
    4646        } else {
    4747                S s1;
    48                 sout | "s.i >= 4 incorrect" | endl;
     48                sout | "s.i >= 4 incorrect";
    4949        } // if
    5050
    5151        while ( int x = 1 ) {
    52                 sout | "x != 0 correct" | endl;
     52                sout | "x != 0 correct";
    5353                break;
    5454        } // while
    5555
    5656        while ( int x = 4, y = 0 ) {
    57                 sout | "x != 0 && y != 0 incorrect" | endl;
     57                sout | "x != 0 && y != 0 incorrect";
    5858        } // while
    5959
    6060        while ( int x = 5, y = f( x ); x == y ) {
    61                 sout | "x == y correct" | endl;
     61                sout | "x == y correct";
    6262                break;
    6363        } // while
     
    6565        while ( struct S { int i; } s = { 3 }; s.i < 4 ) {
    6666                S s1;
    67                 sout | "s.i < 4 correct" | endl;
     67                sout | "s.i < 4 correct";
    6868                break;
    6969        } // while
     
    7272// Local Variables: //
    7373// tab-width: 4 //
    74 // compile-command: "cfa ifwhileCtl.c" //
     74// compile-command: "cfa ifwhileCtl.cfa" //
    7575// End: //
  • tests/labelledExit.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // labelledExit.c --
     7// labelledExit.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Aug 10 07:29:39 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 16 08:55:39 2018
    13 // Update Count     : 3
     12// Last Modified On : Tue Nov  6 17:57:42 2018
     13// Update Count     : 4
    1414//
    1515
     
    159159// Local Variables: //
    160160// tab-width: 4 //
    161 // compile-command: "cfa labelledExit.c" //
     161// compile-command: "cfa labelledExit.cfa" //
    162162// End: //
  • tests/limits.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // limits.c --
     7// limits.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Tue May 10 20:44:20 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar  1 16:21:55 2018
    13 // Update Count     : 7
     12// Last Modified On : Tue Nov  6 17:57:55 2018
     13// Update Count     : 8
    1414//
    1515
     
    153153// Local Variables: //
    154154// tab-width: 4 //
    155 // compile-command: "cfa limits.c" //
     155// compile-command: "cfa limits.cfa" //
    156156// End: //
  • tests/literals.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // literals.c --
     7// literals.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Sat Sep  9 16:34:38 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jul  1 15:12:15 2018
    13 // Update Count     : 137
     12// Last Modified On : Tue Dec  4 21:44:01 2018
     13// Update Count     : 139
    1414//
    1515
     
    1818#include <fstream.hfa>
    1919
    20 void f( char v ) { sout | "char " | v | endl; }
    21 void f( signed char v ) { sout | "signed char " | v | endl; }
    22 void f( unsigned char v ) { sout | "unsigned char " | v | endl; }
    23 void f( signed short v ) { sout | "signed short int" | v | endl; }
    24 void f( unsigned short v ) { sout | "unsigned short int" | v | endl; }
    25 void f( size_t v ) { sout | "size_t" | v | endl; }
     20void f( char v ) { sout | "char " | v; }
     21void f( signed char v ) { sout | "signed char " | v; }
     22void f( unsigned char v ) { sout | "unsigned char " | v; }
     23void f( signed short v ) { sout | "signed short int" | v; }
     24void f( unsigned short v ) { sout | "unsigned short int" | v; }
     25void f( size_t v ) { sout | "size_t" | v; }
    2626#endif // __CFA__
    2727
     
    324324// Local Variables: //
    325325// tab-width: 4 //
    326 // compile-command: "cfa literals.c" //
     326// compile-command: "cfa literals.cfa" //
    327327// End: //
  • tests/math1.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // math1.c --
     7// math1.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Fri Apr 22 14:59:21 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu May 24 21:01:15 2018
    13 // Update Count     : 85
     12// Last Modified On : Wed Dec 12 16:28:49 2018
     13// Update Count     : 89
    1414//
    1515
     
    2222        long double l;
    2323
    24         sout | "fmod:" | 5.0F % -2.0F | fmod( 5.0F, -2.0F ) | 5.0D % -2.0D | fmod( 5.0D, -2.0D ) | 5.0L % -2.0L | fmod( 5.0L, -2.0L ) | endl;
    25         sout | "remainder:" | remainder( 2.0F, 3.0F ) | remainder( 2.0D, 3.0D ) | remainder( 2.0L, 3.0L ) | endl;
     24        sout | "fmod:" | 5.0F % -2.0F | fmod( 5.0F, -2.0F ) | 5.0D % -2.0D | nonl;
     25        sout | fmod( 5.0D, -2.0D ) | 5.0L % -2.0L | fmod( 5.0L, -2.0L );
     26        sout | "remainder:" | remainder( 2.0F, 3.0F ) | remainder( 2.0D, 3.0D ) | remainder( 2.0L, 3.0L );
    2627        int quot;
    2728        f = remquo( 3.6F, 0.5F, &quot );
    28         sout | "remquo:" | quot | f;
     29        sout | "remquo:" | quot | f | nonl;
    2930        d = remquo( 3.6D, 0.5F, &quot );
    30         sout | quot | d;
     31        sout | quot | d | nonl;
    3132        l = remquo( 3.6L, 0.5L, &quot );
    32         sout | quot | l | endl;
    33         sout | "div:" | div( 3.6F, 0.5F ) | div( 3.6D, 0.5D ) | div( 3.6L, 0.5L ) | endl;
    34         sout | "fma:" | fma( 3.0F, -1.0F, 1.0F ) | fma( 3.0D, -1.0D, 1.0D ) | fma( 3.0L, -1.0L, , 1.0L ) | endl;
    35         sout | "fdim:" | fdim( 1.0F, -1.0F ) | fdim( 1.0D, -1.0D ) | fdim( 1.0L, -1.0L ) | endl;
    36         sout | "nan:" | (float)nan( "" ) | (double)nan( "" ) | (long double)nan( "" ) | endl;
     33        sout | quot | l;
     34        sout | "div:" | div( 3.6F, 0.5F ) | div( 3.6D, 0.5D ) | div( 3.6L, 0.5L );
     35        sout | "fma:" | fma( 3.0F, -1.0F, 1.0F ) | fma( 3.0D, -1.0D, 1.0D ) | fma( 3.0L, -1.0L, , 1.0L );
     36        sout | "fdim:" | fdim( 1.0F, -1.0F ) | fdim( 1.0D, -1.0D ) | fdim( 1.0L, -1.0L );
     37        sout | "nan:" | (float)nan( "" ) | (double)nan( "" ) | (long double)nan( "" );
    3738
    3839        //---------------------- Exponential ----------------------
    3940
    40         sout | "exp:" | exp( 1.0F ) | exp( 1.0D ) | exp( 1.0L ) | exp( 1.0F+1.0FI ) | exp( 1.0D+1.0DI ) | exp( 1.0DL+1.0LI ) | endl;
    41         sout | "exp2:" | exp2( 1.0F ) | exp2( 1.0D ) | exp2( 1.0L ) | endl;
    42         sout | "expm1:" | expm1( 1.0F ) | expm1( 1.0D ) | expm1( 1.0L ) | endl;
    43         sout | "pow:" | pow( 1.0F, 1.0F ) | pow( 1.0D, 1.0D ) | pow( 1.0L, 1.0L ) | pow( 1.0F+1.0FI, 1.0F+1.0FI ) | pow( 1.0D+1.0DI, 1.0D+1.0DI ) | pow( 1.5DL+1.5LI, 1.5DL+1.5LI ) | endl;
     41        sout | "exp:" | exp( 1.0F ) | exp( 1.0D ) | exp( 1.0L ) | nonl;
     42        sout | exp( 1.0F+1.0FI ) | exp( 1.0D+1.0DI ) | exp( 1.0DL+1.0LI );
     43        sout | "exp2:" | exp2( 1.0F ) | exp2( 1.0D ) | exp2( 1.0L );
     44        sout | "expm1:" | expm1( 1.0F ) | expm1( 1.0D ) | expm1( 1.0L );
     45        sout | "pow:" | pow( 1.0F, 1.0F ) | pow( 1.0D, 1.0D ) | pow( 1.0L, 1.0L ) | nonl;
     46        sout | pow( 1.0F+1.0FI, 1.0F+1.0FI ) | pow( 1.0D+1.0DI, 1.0D+1.0DI ) | pow( 1.5DL+1.5LI, 1.5DL+1.5LI );
    4447
    4548        int b = 4;
    4649        unsigned int e = 2;
    4750    b \= e;
    48     sout | "\\" | b | b \ e | endl;
    49     sout | "\\" | 'a' \ 3u | 2 \ 8u | 4 \ 3u | -4 \ 3u | 4 \ -3 | -4 \ -3 | 4.0 \ 2.1 | (1.0f+2.0fi) \ (3.0f+2.0fi) | endl;
     51    sout | "\\" | b | b \ e;
     52    sout | "\\" | 'a' \ 3u | 2 \ 8u | 4 \ 3u | -4 \ 3u | nonl;
     53        sout | 4 \ -3 | -4 \ -3 | 4.0 \ 2.1 | (1.0f+2.0fi) \ (3.0f+2.0fi);
    5054} // main
    5155
    5256// Local Variables: //
    5357// tab-width: 4 //
    54 // compile-command: "cfa math1.c" //
     58// compile-command: "cfa math1.cfa" //
    5559// End: //
  • tests/math3.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // math3.c --
     7// math3.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Fri Apr 22 14:59:21 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu May 24 21:06:12 2018
    13 // Update Count     : 82
     12// Last Modified On : Wed Dec 12 16:30:41 2018
     13// Update Count     : 86
    1414//
    1515
     
    2424        //---------------------- Hyperbolic ----------------------
    2525
    26         sout | "sinh:" | sinh( 1.0F ) | sinh( 1.0D ) | sinh( 1.0L ) | sinh( 1.0F+1.0FI ) | sinh( 1.0D+1.0DI ) | sinh( 1.0DL+1.0LI ) | endl;
    27         sout | "cosh:" | cosh( 1.0F ) | cosh( 1.0D ) | cosh( 1.0L ) | cosh( 1.0F+1.0FI ) | cosh( 1.0D+1.0DI ) | cosh( 1.0DL+1.0LI ) | endl;
    28         sout | "tanh:" | tanh( 1.0F ) | tanh( 1.0D ) | tanh( 1.0L ) | tanh( 1.0F+1.0FI ) | tanh( 1.0D+1.0DI ) | tanh( 1.0DL+1.0LI ) | endl;
    29         sout | "acosh:" | acosh( 1.0F ) | acosh( 1.0D ) | acosh( 1.0L ) | acosh( 1.0F+1.0FI ) | acosh( 1.0D+1.0DI ) | acosh( 1.0DL+1.0LI ) | endl;
    30         sout | "asinh:" | asinh( 1.0F ) | asinh( 1.0D ) | asinh( 1.0L ) | asinh( 1.0F+1.0FI ) | asinh( 1.0D+1.0DI ) | asinh( 1.0DL+1.0LI ) | endl;
    31         sout | "atanh:" | atanh( 1.0F ) | atanh( 1.0D ) | atanh( 1.0L ) | atanh( 1.0F+1.0FI ) | atanh( 1.0D+1.0DI ) | atanh( 1.0DL+1.0LI ) | endl;
     26        sout | "sinh:" | sinh( 1.0F ) | sinh( 1.0D ) | sinh( 1.0L ) | nonl;
     27        sout | sinh( 1.0F+1.0FI ) | sinh( 1.0D+1.0DI ) | sinh( 1.0DL+1.0LI );
     28        sout | "cosh:" | cosh( 1.0F ) | cosh( 1.0D ) | cosh( 1.0L ) | nonl;
     29        sout | cosh( 1.0F+1.0FI ) | cosh( 1.0D+1.0DI ) | cosh( 1.0DL+1.0LI );
     30        sout | "tanh:" | tanh( 1.0F ) | tanh( 1.0D ) | tanh( 1.0L ) | nonl;
     31        sout | tanh( 1.0F+1.0FI ) | tanh( 1.0D+1.0DI ) | tanh( 1.0DL+1.0LI );
     32        sout | "acosh:" | acosh( 1.0F ) | acosh( 1.0D ) | acosh( 1.0L ) | nonl;
     33        sout | acosh( 1.0F+1.0FI ) | acosh( 1.0D+1.0DI ) | acosh( 1.0DL+1.0LI );
     34        sout | "asinh:" | asinh( 1.0F ) | asinh( 1.0D ) | asinh( 1.0L ) | nonl;
     35        sout | asinh( 1.0F+1.0FI ) | asinh( 1.0D+1.0DI ) | asinh( 1.0DL+1.0LI );
     36        sout | "atanh:" | atanh( 1.0F ) | atanh( 1.0D ) | atanh( 1.0L ) | nonl;
     37        sout | atanh( 1.0F+1.0FI ) | atanh( 1.0D+1.0DI ) | atanh( 1.0DL+1.0LI );
    3238
    3339        //---------------------- Error / Gamma ----------------------
    3440
    35         sout | "erf:" | erf( 1.0F ) | erf( 1.0D ) | erf( 1.0L ) | endl;
    36         sout | "erfc:" | erfc( 1.0F ) | erfc( 1.0D ) | erfc( 1.0L ) | endl;
    37         sout | "lgamma:" | lgamma( 4.0F ) | lgamma( 4.0D ) | lgamma( 4.0L ) | endl;
     41        sout | "erf:" | erf( 1.0F ) | erf( 1.0D ) | erf( 1.0L );
     42        sout | "erfc:" | erfc( 1.0F ) | erfc( 1.0D ) | erfc( 1.0L );
     43        sout | "lgamma:" | lgamma( 4.0F ) | lgamma( 4.0D ) | lgamma( 4.0L );
    3844        int sign;
    3945        f = lgamma( 4.0F, &sign );
    40         sout | "lgamma:" | f | sign;
     46        sout | "lgamma:" | f | sign | nonl;
    4147        d = lgamma( 4.0D, &sign );
    42         sout | d | sign;
     48        sout | d | sign | nonl;
    4349        l = lgamma( 4.0L, &sign );
    44         sout | l | sign | endl;
    45         sout | "tgamma:" | tgamma( 4.0F ) | tgamma( 4.0D ) | tgamma( 4.0L ) | endl;
     50        sout | l | sign;
     51        sout | "tgamma:" | tgamma( 4.0F ) | tgamma( 4.0D ) | tgamma( 4.0L );
    4652} // main
    4753
    4854// Local Variables: //
    4955// tab-width: 4 //
    50 // compile-command: "cfa math3.c" //
     56// compile-command: "cfa math3.cfa" //
    5157// End: //
  • tests/math4.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // math4.c --
     7// math4.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Thu May 24 20:56:54 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu May 24 20:58:06 2018
    13 // Update Count     : 2
     12// Last Modified On : Tue Dec  4 18:15:01 2018
     13// Update Count     : 4
    1414//
    1515
     
    2424        //---------------------- Nearest Integer ----------------------
    2525
    26         sout | "floor:" | floor( 1.2F ) | floor( 1.2D ) | floor( 1.2L ) | endl;
    27         sout | "ceil:" | ceil( 1.6F ) | ceil( 1.6D ) | ceil( 1.6L ) | endl;
    28         sout | "trunc:" | trunc( 3.5F ) | trunc( 3.5D ) | trunc( 3.5L ) | endl;
    29         sout | "rint:" | (float)rint( 1.5F ) | (double)rint( 1.5D ) | (long double)rint( 1.5L ) | endl;
    30         sout | "rint:" | (long int)rint( 1.5F ) | (long int)rint( 1.5D ) | (long int)rint( 1.5L ) | endl;
    31         sout | "rint:" | (long long int)rint( 1.5F ) | (long long int)rint( 1.5D ) | (long long int)rint( 1.5L ) | endl;
    32         sout | "lrint:" | lrint( 1.5F ) | lrint( 1.5D ) | lrint( 1.5L ) | endl;
    33         sout | "llrint:" | llrint( 1.5F ) | llrint( 1.5D ) | llrint( 1.5L ) | endl;
    34         sout | "nearbyint:" | nearbyint( 3.5F ) | nearbyint( 3.5D ) | nearbyint( 3.5L ) | endl;
    35         sout | "round:" | (float)round( 1.5F ) | (double)round( 1.5D ) | (long double)round( 1.5L ) | endl;
    36         sout | "round:" | (long int)round( 1.5F ) | (long int)round( 1.5D ) | (long int)round( 1.5L ) | endl;
    37         sout | "round:" | (long long int)round( 1.5F ) | (long long int)round( 1.5D ) | (long long int)round( 1.5L ) | endl;
    38         sout | "lround:" | lround( 1.5F ) | lround( 1.5D ) | lround( 1.5L ) | endl;
    39         sout | "llround:" | llround( 1.5F ) | llround( 1.5D ) | llround( 1.5L ) | endl;
     26        sout | "floor:" | floor( 1.2F ) | floor( 1.2D ) | floor( 1.2L );
     27        sout | "ceil:" | ceil( 1.6F ) | ceil( 1.6D ) | ceil( 1.6L );
     28        sout | "trunc:" | trunc( 3.5F ) | trunc( 3.5D ) | trunc( 3.5L );
     29        sout | "rint:" | (float)rint( 1.5F ) | (double)rint( 1.5D ) | (long double)rint( 1.5L );
     30        sout | "rint:" | (long int)rint( 1.5F ) | (long int)rint( 1.5D ) | (long int)rint( 1.5L );
     31        sout | "rint:" | (long long int)rint( 1.5F ) | (long long int)rint( 1.5D ) | (long long int)rint( 1.5L );
     32        sout | "lrint:" | lrint( 1.5F ) | lrint( 1.5D ) | lrint( 1.5L );
     33        sout | "llrint:" | llrint( 1.5F ) | llrint( 1.5D ) | llrint( 1.5L );
     34        sout | "nearbyint:" | nearbyint( 3.5F ) | nearbyint( 3.5D ) | nearbyint( 3.5L );
     35        sout | "round:" | (float)round( 1.5F ) | (double)round( 1.5D ) | (long double)round( 1.5L );
     36        sout | "round:" | (long int)round( 1.5F ) | (long int)round( 1.5D ) | (long int)round( 1.5L );
     37        sout | "round:" | (long long int)round( 1.5F ) | (long long int)round( 1.5D ) | (long long int)round( 1.5L );
     38        sout | "lround:" | lround( 1.5F ) | lround( 1.5D ) | lround( 1.5L );
     39        sout | "llround:" | llround( 1.5F ) | llround( 1.5D ) | llround( 1.5L );
    4040
    4141        //---------------------- Manipulation ----------------------
    4242
    43         sout | "copysign:" | copysign( 1.0F, -1.0F ) | copysign( 1.0D, -1.0D ) | copysign( 1.0L, -1.0L ) | endl;
     43        sout | "copysign:" | copysign( 1.0F, -1.0F ) | copysign( 1.0D, -1.0D ) | copysign( 1.0L, -1.0L );
    4444        int exp;
    4545        f = frexp( 4.0F, &exp );
    46         sout | "frexp:" | f | exp;
     46        sout | "frexp:" | f | exp | nonl;
    4747        d = frexp( 4.0D, &exp );
    48         sout | d | exp;
     48        sout | d | exp | nonl;
    4949        l = frexp( 4.0L, &exp );
    50         sout | l | exp | endl;
    51         sout | "ldexp:" | ldexp( 2.0F, 2 ) | ldexp( 2.0D, 2 ) | ldexp( 2.0L, 2 ) | endl;
     50        sout | l | exp;
     51        sout | "ldexp:" | ldexp( 2.0F, 2 ) | ldexp( 2.0D, 2 ) | ldexp( 2.0L, 2 );
    5252        float fi;
    5353        double di;
    5454        long double ldi;
    5555        f = modf( 2.3F, &fi );
    56         sout | "modf:" | fi | f;
     56        sout | "modf:" | fi | f | nonl;
    5757        d = modf( 2.3D, &di );
    58         sout | di | d;
     58        sout | di | d | nonl;
    5959        l = modf( 2.3L, &ldi );
    60         sout | ldi | l | endl;
    61         sout | "modf:" | modf( 2.3F ) | modf( 2.3D ) | modf( 2.3L ) | endl;
    62         sout | "nextafter:" | nextafter( 2.0F, 3.0F ) | nextafter( 2.0D, 3.0D ) | nextafter( 2.0L, 3.0L ) | endl;
    63         sout | "nexttoward:" | nexttoward( 2.0F, 3.0F ) | nexttoward( 2.0D, 3.0D ) | nexttoward( 2.0L, 3.0L ) | endl;
     60        sout | ldi | l;
     61        sout | "modf:" | modf( 2.3F ) | modf( 2.3D ) | modf( 2.3L );
     62        sout | "nextafter:" | nextafter( 2.0F, 3.0F ) | nextafter( 2.0D, 3.0D ) | nextafter( 2.0L, 3.0L );
     63        sout | "nexttoward:" | nexttoward( 2.0F, 3.0F ) | nexttoward( 2.0D, 3.0D ) | nexttoward( 2.0L, 3.0L );
    6464
    65         sout | "scalbn:" | scalbn( 2.0F, 3 ) | scalbn( 2.0D, 3 ) | scalbn( 2.0L, 3 ) | endl;
    66         sout | "scalbln:" | scalbln( 2.0F, 3L ) | scalbln( 2.0D, 3L ) | scalbln( 2.0L, 3L ) | endl;
     65        sout | "scalbn:" | scalbn( 2.0F, 3 ) | scalbn( 2.0D, 3 ) | scalbn( 2.0L, 3 );
     66        sout | "scalbln:" | scalbln( 2.0F, 3L ) | scalbln( 2.0D, 3L ) | scalbln( 2.0L, 3L );
    6767} // main
    6868
    6969// Local Variables: //
    7070// tab-width: 4 //
    71 // compile-command: "cfa math3.c" //
     71// compile-command: "cfa math3.cfa" //
    7272// End: //
  • tests/minmax.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // minmax.c --
     7// minmax.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Apr 10 17:29:09 2018
    13 // Update Count     : 50
     12// Last Modified On : Tue Dec  4 21:45:31 2018
     13// Update Count     : 52
    1414//
    1515
     
    2222        int ?>?( char op1, char op2 ) { return (int)op1 > (int)op2; }
    2323
    24         sout | "char\t\t\t"                                     | 'z' | ' ' | 'a' | "\tmin " | min( 'z', 'a' ) | endl;
    25         sout | "signed int\t\t"                         | 4 | 3 | "\tmin" | min( 4, 3 ) | endl;
    26         sout | "unsigned int\t\t"                       | 4u | 3u | "\tmin" | min( 4u, 3u ) | endl;
    27         sout | "signed long int\t\t"            | 4l | 3l | "\tmin" | min( 4l, 3l ) | endl;
    28         sout | "unsigned long int\t"            | 4ul | 3ul | "\tmin" | min( 4ul, 3ul ) | endl;
    29         sout | "signed long long int\t"         | 4ll | 3ll | "\tmin" | min( 4ll, 3ll ) | endl;
    30         sout | "unsigned long long int\t"       | 4ull | 3ull | "\tmin" | min( 4ull, 3ull ) | endl;
    31         sout | "float\t\t\t"                            | 4.0f | 3.1f | "\tmin" | min( 4.0f, 3.1f ) | endl;
    32         sout | "double\t\t\t"                           | 4.0 | 3.1 | "\tmin" | min( 4.0, 3.1 ) | endl;
    33         sout | "long double\t\t"                        | 4.0l | 3.1l | "\tmin" | min( 4.0l, 3.1l ) | endl;
     24        sout | "char\t\t\t"                                     | 'z' | ' ' | 'a' | "\tmin " | min( 'z', 'a' );
     25        sout | "signed int\t\t"                         | 4 | 3 | "\tmin" | min( 4, 3 );
     26        sout | "unsigned int\t\t"                       | 4u | 3u | "\tmin" | min( 4u, 3u );
     27        sout | "signed long int\t\t"            | 4l | 3l | "\tmin" | min( 4l, 3l );
     28        sout | "unsigned long int\t"            | 4ul | 3ul | "\tmin" | min( 4ul, 3ul );
     29        sout | "signed long long int\t"         | 4ll | 3ll | "\tmin" | min( 4ll, 3ll );
     30        sout | "unsigned long long int\t"       | 4ull | 3ull | "\tmin" | min( 4ull, 3ull );
     31        sout | "float\t\t\t"                            | 4.0f | 3.1f | "\tmin" | min( 4.0f, 3.1f );
     32        sout | "double\t\t\t"                           | 4.0 | 3.1 | "\tmin" | min( 4.0, 3.1 );
     33        sout | "long double\t\t"                        | 4.0l | 3.1l | "\tmin" | min( 4.0l, 3.1l );
    3434
    35         sout | endl;
     35        sout | nl;
    3636
    37         sout | "char\t\t\t"                                     | 'z' | ' ' | 'a' | "\tmax " | max( 'z', 'a' ) | endl;
    38         sout | "signed int\t\t"                         | 4 | 3 | "\tmax" | max( 4, 3 ) | endl;
    39         sout | "unsigned int\t\t"                       | 4u | 3u | "\tmax" | max( 4u, 3u ) | endl;
    40         sout | "signed long int\t\t"            | 4l | 3l | "\tmax" | max( 4l, 3l ) | endl;
    41         sout | "unsigned long int\t"            | 4ul | 3ul | "\tmax" | max( 4ul, 3ul ) | endl;
    42         sout | "signed long long int\t"         | 4ll | 3ll | "\tmax" | max( 4ll, 3ll ) | endl;
    43         sout | "unsigned long long int\t"       | 4ull | 3ull | "\tmax" | max( 4ull, 3ull ) | endl;
    44         sout | "float\t\t\t"                            | 4.0f | 3.1f | "\tmax" | max( 4.0f, 3.1f ) | endl;
    45         sout | "double\t\t\t"                           | 4.0 | 3.1 | "\tmax" | max( 4.0, 3.1 ) | endl;
    46         sout | "long double\t\t"                        | 4.0l | 3.1l | "\tmax" | max( 4.0l, 3.1l ) | endl;
     37        sout | "char\t\t\t"                                     | 'z' | ' ' | 'a' | "\tmax " | max( 'z', 'a' );
     38        sout | "signed int\t\t"                         | 4 | 3 | "\tmax" | max( 4, 3 );
     39        sout | "unsigned int\t\t"                       | 4u | 3u | "\tmax" | max( 4u, 3u );
     40        sout | "signed long int\t\t"            | 4l | 3l | "\tmax" | max( 4l, 3l );
     41        sout | "unsigned long int\t"            | 4ul | 3ul | "\tmax" | max( 4ul, 3ul );
     42        sout | "signed long long int\t"         | 4ll | 3ll | "\tmax" | max( 4ll, 3ll );
     43        sout | "unsigned long long int\t"       | 4ull | 3ull | "\tmax" | max( 4ull, 3ull );
     44        sout | "float\t\t\t"                            | 4.0f | 3.1f | "\tmax" | max( 4.0f, 3.1f );
     45        sout | "double\t\t\t"                           | 4.0 | 3.1 | "\tmax" | max( 4.0, 3.1 );
     46        sout | "long double\t\t"                        | 4.0l | 3.1l | "\tmax" | max( 4.0l, 3.1l );
    4747} // main
    4848
    4949// Local Variables: //
    5050// tab-width: 4 //
    51 // compile-command: "cfa minmax.c" //
     51// compile-command: "cfa minmax.cfa" //
    5252// End: //
  • tests/nested-types.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // nested-types.c --
     7// nested-types.cfa --
    88//
    99// Author           : Rob Schluntz
    1010// Created On       : Mon Jul 9 10:20:03 2018
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Mon Jul 9 10:20:03 2017
    13 // Update Count     : 1
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Tue Nov  6 17:59:40 2018
     13// Update Count     : 2
    1414//
    1515
     
    8888// Local Variables: //
    8989// tab-width: 4 //
    90 // compile-command: "cfa nested-types.c" //
     90// compile-command: "cfa nested-types.cfa" //
    9191// End: //
  • tests/numericConstants.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // numericConstants.c --
     7// numericConstants.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed May 24 22:10:36 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May 24 22:11:36 2017
    13 // Update Count     : 2
     12// Last Modified On : Tue Nov  6 17:59:53 2018
     13// Update Count     : 3
    1414//
    1515
     
    6767// Local Variables: //
    6868// tab-width: 4 //
    69 // compile-command: "cfa minmax.c" //
     69// compile-command: "cfa minmax.cfa" //
    7070// End: //
  • tests/polymorphism.cfa

    r9b086ca rcde3891  
    99// Author           : Rob Schluntz
    1010// Created On       : Tue Oct 17 12:19:48 2017
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Tue Oct 17 12:21:07 2017
    13 // Update Count     : 1
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Tue Dec 25 14:40:24 2018
     13// Update Count     : 3
    1414//
    1515
    1616#include <assert.h>
    1717#include <inttypes.h>
     18#include <fstream.hfa>
    1819
    1920forall(otype T)
     
    6162                int y = 456;
    6263                int z = f(x, y);
    63                 printf("%d %d %d\n", x, y, z);
     64                sout | x | y | z;
    6465        }
    65 
    6666        {
    6767                // explicitly specialize function
    6868                int (*f)(int) = ident;
    6969                ((int(*)(int))ident);
    70                 printf("%d %d\n", f(5), ((int(*)(int))ident)(5));
     70                sout | f(5) | ((int(*)(int))ident)(5);
    7171        }
    72 
    7372        {
    7473                // test aggregates with polymorphic members
     
    10099
    101100                void print(x_type x) {
    102                         printf("%"PRIu32"\n", x);
     101                        sout | x;
    103102                }
    104103
    105104                void print(y_type y) {
    106                         printf("%"PRIu64"\n", y);
     105                        sout | y;
    107106                }
    108107
  • tests/preempt_longrun/Makefile.am

    r9b086ca rcde3891  
    1616
    1717AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
     18ACLOCAL_AMFLAGS  = -I automake
    1819
    1920repeats=10
  • tests/preempt_longrun/Makefile.in

    r9b086ca rcde3891  
    9393subdir = tests/preempt_longrun
    9494ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    95 am__aclocal_m4_deps = $(top_srcdir)/automake/cfa.m4 \
    96         $(top_srcdir)/configure.ac
     95am__aclocal_m4_deps = $(top_srcdir)/automake/libtool.m4 \
     96        $(top_srcdir)/automake/ltoptions.m4 \
     97        $(top_srcdir)/automake/ltsugar.m4 \
     98        $(top_srcdir)/automake/ltversion.m4 \
     99        $(top_srcdir)/automake/lt~obsolete.m4 \
     100        $(top_srcdir)/automake/cfa.m4 $(top_srcdir)/configure.ac
    97101am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    98102        $(ACLOCAL_M4)
     
    333337AMTAR = @AMTAR@
    334338AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
     339AR = @AR@
    335340AUTOCONF = @AUTOCONF@
    336341AUTOHEADER = @AUTOHEADER@
    337342AUTOMAKE = @AUTOMAKE@
    338343AWK = @AWK@
    339 BACKEND_CC = @BACKEND_CC@
    340344BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@
    341345CC = @CFACC@
     
    357361CPPFLAGS = @CPPFLAGS@
    358362CXX = @CXX@
     363CXXCPP = @CXXCPP@
    359364CXXDEPMODE = @CXXDEPMODE@
    360365CXXFLAGS = @CXXFLAGS@
     
    362367DEFS = @DEFS@
    363368DEPDIR = @DEPDIR@
     369DLLTOOL = @DLLTOOL@
    364370DRIVER_DIR = @DRIVER_DIR@
     371DSYMUTIL = @DSYMUTIL@
     372DUMPBIN = @DUMPBIN@
    365373ECHO_C = @ECHO_C@
    366374ECHO_N = @ECHO_N@
     
    368376EGREP = @EGREP@
    369377EXEEXT = @EXEEXT@
     378FGREP = @FGREP@
    370379GREP = @GREP@
    371380HOST_FLAGS = @HOST_FLAGS@
     
    375384INSTALL_SCRIPT = @INSTALL_SCRIPT@
    376385INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
     386LD = @LD@
    377387LDFLAGS = @LDFLAGS@
    378388LEX = @LEX@
     
    383393LIBOBJS = @LIBOBJS@
    384394LIBS = @LIBS@
     395LIBTOOL = @LIBTOOL@
     396LIPO = @LIPO@
     397LN_S = @LN_S@
    385398LTLIBOBJS = @LTLIBOBJS@
     399LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
    386400MAKEINFO = @MAKEINFO@
     401MANIFEST_TOOL = @MANIFEST_TOOL@
    387402MKDIR_P = @MKDIR_P@
     403NM = @NM@
     404NMEDIT = @NMEDIT@
     405OBJDUMP = @OBJDUMP@
    388406OBJEXT = @OBJEXT@
     407OTOOL = @OTOOL@
     408OTOOL64 = @OTOOL64@
    389409PACKAGE = @PACKAGE@
    390410PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
     
    396416PATH_SEPARATOR = @PATH_SEPARATOR@
    397417RANLIB = @RANLIB@
     418SED = @SED@
    398419SET_MAKE = @SET_MAKE@
    399420SHELL = @SHELL@
     
    407428abs_top_builddir = @abs_top_builddir@
    408429abs_top_srcdir = @abs_top_srcdir@
     430ac_ct_AR = @ac_ct_AR@
    409431ac_ct_CC = @ac_ct_CC@
    410432ac_ct_CXX = @ac_ct_CXX@
     433ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
    411434am__include = @am__include@
    412435am__leading_dot = @am__leading_dot@
     
    456479top_srcdir = @top_srcdir@
    457480AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
     481ACLOCAL_AMFLAGS = -I automake
    458482repeats = 10
    459483max_time = 600
     
    503527        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
    504528$(am__aclocal_m4_deps):
     529
     530mostlyclean-libtool:
     531        -rm -f *.lo
     532
     533clean-libtool:
     534        -rm -rf .libs _libs
    505535tags TAGS:
    506536
     
    806836clean: clean-am
    807837
    808 clean-am: clean-generic clean-local mostlyclean-am
     838clean-am: clean-generic clean-libtool clean-local mostlyclean-am
    809839
    810840distclean: distclean-am
     
    858888mostlyclean: mostlyclean-am
    859889
    860 mostlyclean-am: mostlyclean-generic
     890mostlyclean-am: mostlyclean-generic mostlyclean-libtool
    861891
    862892pdf: pdf-am
     
    873903
    874904.PHONY: all all-am all-local check check-TESTS check-am clean \
    875         clean-generic clean-local cscopelist-am ctags-am distclean \
    876         distclean-generic distdir dvi dvi-am html html-am info info-am \
    877         install install-am install-data install-data-am install-dvi \
    878         install-dvi-am install-exec install-exec-am install-html \
    879         install-html-am install-info install-info-am install-man \
    880         install-pdf install-pdf-am install-ps install-ps-am \
    881         install-strip installcheck installcheck-am installdirs \
    882         maintainer-clean maintainer-clean-generic mostlyclean \
    883         mostlyclean-generic pdf pdf-am ps ps-am recheck tags-am \
     905        clean-generic clean-libtool clean-local cscopelist-am ctags-am \
     906        distclean distclean-generic distclean-libtool distdir dvi \
     907        dvi-am html html-am info info-am install install-am \
     908        install-data install-data-am install-dvi install-dvi-am \
     909        install-exec install-exec-am install-html install-html-am \
     910        install-info install-info-am install-man install-pdf \
     911        install-pdf-am install-ps install-ps-am install-strip \
     912        installcheck installcheck-am installdirs maintainer-clean \
     913        maintainer-clean-generic mostlyclean mostlyclean-generic \
     914        mostlyclean-libtool pdf pdf-am ps ps-am recheck tags-am \
    884915        uninstall uninstall-am
    885916
  • tests/preempt_longrun/create.c

    r9b086ca rcde3891  
    33#include <time.hfa>
    44
    5 #include "long_tests.h"
     5#include "long_tests.hfa"
    66
    77#ifndef PREEMPTION_RATE
  • tests/preempt_longrun/enter3.c

    r9b086ca rcde3891  
    55
    66#define __kick_rate 75000ul
    7 #include "long_tests.h"
     7#include "long_tests.hfa"
    88
    99#ifndef PREEMPTION_RATE
  • tests/preempt_longrun/processor.c

    r9b086ca rcde3891  
    55#include <unistd.h>
    66
    7 #include "long_tests.h"
     7#include "long_tests.hfa"
    88
    99#ifndef PREEMPTION_RATE
  • tests/preempt_longrun/yield.c

    r9b086ca rcde3891  
    44
    55#define __kick_rate 550000ul
    6 #include "long_tests.h"
     6#include "long_tests.hfa"
    77
    88#ifndef PREEMPTION_RATE
  • tests/pybin/tools.py

    r9b086ca rcde3891  
    33import __main__
    44import argparse
     5import fileinput
    56import multiprocessing
    67import os
    78import re
     9import resource
    810import signal
    911import stat
    1012import sys
    11 import fileinput
     13import time
    1214
    1315from pybin import settings
     
    7981def diff( lhs, rhs ):
    8082        # diff the output of the files
    81         diff_cmd = ("diff --ignore-all-space --text "
    82                                 "--ignore-blank-lines "
     83        diff_cmd = ("diff --text "
     84#                               "--ignore-all-space "
     85#                               "--ignore-blank-lines "
    8386                                "--old-group-format='\t\tmissing lines :\n"
    8487                                "%%<' \\\n"
     
    130133
    131134    return None
     135
     136def run(exe, output, input):
     137        ret, _ = sh("timeout %d %s > %s 2>&1" % (settings.timeout.single, exe, output), input = input)
     138        return ret
     139
    132140################################################################################
    133141#               file handling
    134142################################################################################
     143# move a file
     144def mv(source, dest):
     145        ret, _ = sh("mv %s %s" % (source, dest))
     146        return ret
     147
     148# cat one file into the other
     149def cat(source, dest):
     150        ret, _ = sh("cat %s > %s" % (source, dest))
     151        return ret
    135152
    136153# helper function to replace patterns in a file
     
    229246                signal.signal(signal.SIGINT, signal.SIG_IGN)
    230247
     248
     249# enable core dumps for all the test children
     250resource.setrlimit(resource.RLIMIT_CORE, (resource.RLIM_INFINITY, resource.RLIM_INFINITY))
     251
    231252################################################################################
    232253#               misc
     
    246267        if column:
    247268                cmd = "%s 2> /dev/null" % column
    248                 print(cmd)
    249269                proc = Popen(cmd, stdin=PIPE, stderr=None, shell=True)
    250                 proc.communicate(input=text)
     270                proc.communicate(input=text + "\n")
    251271        else:
    252272                print(text)
     273
     274
     275def coreInfo(path):
     276        cmd   = os.path.join(settings.SRCDIR, "pybin/print-core.gdb")
     277        if not os.path.isfile(cmd):
     278                return 1, "ERR Printing format for core dumps not found"
     279
     280        dname = os.path.dirname(path)
     281        core  = os.path.join(dname, "core" )
     282        if not os.path.isfile(path):
     283                return 1, "ERR Executable path is wrong"
     284
     285        if not os.path.isfile(core):
     286                return 1, "ERR No core dump"
     287
     288        return sh("gdb -n %s %s -batch -x %s" % (path, core, cmd), print2stdout=False)
     289
     290class Timed:
     291    def __enter__(self):
     292        self.start = time.time()
     293        return self
     294
     295    def __exit__(self, *args):
     296        self.end = time.time()
     297        self.duration = self.end - self.start
  • tests/quotedKeyword.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // quoted_keyword.c -- test quoted keyword usage
     7// quotedKeyword.cfa -- test quoted keyword usage
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 30 14:03:59 2016
    13 // Update Count     : 19
     12// Last Modified On : Tue Dec  4 21:45:53 2018
     13// Update Count     : 23
    1414//
    1515
     
    4141        st.`struct` = 3;
    4242        `throw` = 4;
    43         sout | `catch` + st.`otype` + st.`struct` + `throw` | endl;
     43        sout | `catch` + st.`otype` + st.`struct` + `throw`;
    4444}
    4545
    4646// Local Variables: //
    4747// tab-width: 4 //
    48 // compile-command: "cfa quoted_keyword.c" //
     48// compile-command: "cfa quotedKeyword.cfa" //
    4949// End: //
  • tests/raii/.expect/ctor-autogen-ERR1.txt

    r9b086ca rcde3891  
    1 raii/ctor-autogen.c:102:1 error: Unique best alternative includes deleted identifier in Cast of:
     1raii/ctor-autogen.cfa:102:1 error: Unique best alternative includes deleted identifier in Cast of:
    22  Application of
    33    Deleted Expression
    44      Variable Expression: ?{}: static inline function
    55      ... with parameters
    6         _dst: reference to instance of struct Managed with body 1 
     6        _dst: reference to instance of struct Managed with body 1
    77        x: signed int
    8       ... returning nothing 
     8      ... returning nothing
    99
    1010      ... deleted by: ?{}: function
    1111      ... with parameters
    12         m: reference to instance of struct Managed with body 1 
    13       ... returning nothing 
    14       ... with body 
     12        m: reference to instance of struct Managed with body 1
     13      ... returning nothing
     14      ... with body
    1515        CompoundStmt
    1616          Expression Statement:
     
    2020                intrinsic reference to signed int
    2121                intrinsic signed int
    22               ... returning 
     22              ... returning
    2323                _retval__operator_assign: signed int
    24                 ... with attributes: 
     24                ... with attributes:
    2525                  Attribute with name: unused
    2626
     
    2828            ... to arguments
    2929              Cast of:
    30                 Member Expression, with field: 
     30                Member Expression, with field:
    3131                  x: signed int
    32                 ... from aggregate: 
     32                ... from aggregate:
    3333                  Cast of:
    34                     Variable Expression: m: reference to instance of struct Managed with body 1 
     34                    Variable Expression: m: reference to instance of struct Managed with body 1
    3535                  ... to:
    36                     instance of struct Managed with body 1 
     36                    instance of struct Managed with body 1
    3737              ... to:
    3838                reference to signed int
     
    4949  ... to arguments
    5050    Cast of:
    51       Variable Expression: x: instance of struct Managed with body 1 
     51      Variable Expression: x: instance of struct Managed with body 1
    5252    ... to:
    53       reference to instance of struct Managed with body 1 
     53      reference to instance of struct Managed with body 1
    5454    constant expression (123 123: signed int)
    5555
  • tests/raii/.expect/dtor-early-exit-ERR1.txt

    r9b086ca rcde3891  
    1 raii/dtor-early-exit.c:150:1 error: jump to label 'L1' crosses initialization of y Branch (Goto)
     1raii/dtor-early-exit.cfa:150:1 error: jump to label 'L1' crosses initialization of y Branch (Goto)
    22  with target: L1
    33  with original target: L1
  • tests/raii/.expect/dtor-early-exit-ERR2.txt

    r9b086ca rcde3891  
    1 raii/dtor-early-exit.c:214:1 error: jump to label 'L2' crosses initialization of y Branch (Goto)
     1raii/dtor-early-exit.cfa:214:1 error: jump to label 'L2' crosses initialization of y Branch (Goto)
    22  with target: L2
    33  with original target: L2
  • tests/raii/.expect/memberCtors-ERR1.txt

    r9b086ca rcde3891  
    1 raii/memberCtors.c:92:1 error: in void ?{}(B &b), field a2 used before being constructed
     1raii/memberCtors.cfa:92:1 error: in void ?{}(B &b), field a2 used before being constructed
  • tests/raii/dtor-early-exit.cfa

    r9b086ca rcde3891  
    1010// Created On       : Wed Aug 17 08:26:25 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Aug 11 07:58:39 2018
    13 // Update Count     : 8
     12// Last Modified On : Fri Dec 21 08:45:19 2018
     13// Update Count     : 10
    1414//
    1515
     
    2525// don't want these called
    2626void ?{}(A & a) { assert( false ); }
    27 void ?{}(A & a, const char * name) { a.name = name; sout | "construct " | name | endl; a.x = (int*)malloc(); }
     27void ?{}(A & a, const char * name) { a.name = name; sout | "construct " | name; a.x = (int*)malloc(); }
    2828void ?{}(A & a, const char * name, int * ptr) { assert( false ); }
    2929
    3030A ?=?(A & a, A b) {  sout | "assign " | a.name | " " | b.name; return a; }
    31 void ?{}(A & a, A b) { sout | "copy construct " | b.name | endl; a.x = (int*)malloc(); }
    32 void ^?{}(A & a) { sout | "destruct " | a.name | endl; free(a.x); }
     31void ?{}(A & a, A b) { sout | "copy construct " | b.name; a.x = (int*)malloc(); }
     32void ^?{}(A & a) { sout | "destruct " | a.name; free(a.x); }
    3333
    3434// test returns
    3535void f(int i) {
    36         sout | "f i=" | i | endl;
     36        sout | "f i=" | i;
    3737        A x = { "x" };  // construct x
    3838        {
     
    5555void g() {
    5656        for (int i = 0; i < 10; i++) {
    57                 sout | "g for i=" | i | endl;
     57                sout | "g for i=" | i;
    5858                A x = { "x" };
    5959                // construct x
    6060                // destruct x
    6161        }
    62         sout | endl;
     62        sout | nl;
    6363        {
    6464                int i = 0;
    6565                while (i < 10) {
    66                         sout | "g while i=" | i | endl;
     66                        sout | "g while i=" | i;
    6767                        A x = { "x" };
    6868                        // construct x
     
    7171                }
    7272        }
    73         sout | endl;
     73        sout | nl;
    7474        for (int i = 0; i < 10; i++) {
    7575                switch(10) {
     
    7878                        case 10: {
    7979                                A y = { "y" };
    80                                 sout | "g switch i=" | i | endl;
     80                                sout | "g switch i=" | i;
    8181                                // construct y
    8282                                break; // destruct y
    8383                        }
    8484                        default: {
    85                                 sout | "g switch i=" | i | endl;
     85                                sout | "g switch i=" | i;
    8686                                A x = { "x" };
    8787                                // construct x
     
    9090                }
    9191        }
    92         sout | endl;
     92        sout | nl;
    9393        for (int k = 0; k < 2; k++) {
    94                 sout | "g for k=" | k | endl;
     94                sout | "g for k=" | k;
    9595                L1: for (int i = 0; i < 10; i++) {
    96                         sout | "g for i=" | i | endl;
     96                        sout | "g for i=" | i;
    9797
    9898                        A x = { "x" };
    9999                        if (i == 2) {
    100                                 sout | "continue L1" | endl;
     100                                sout | "continue L1";
    101101                                continue;  // destruct x
    102102                        } else if (i == 3) {
    103                                 sout | "break L1" | endl;
     103                                sout | "break L1";
    104104                                break;  // destruct x
    105105                        }
    106106
    107107                        L2: for (int j = 0; j < 10; j++) {
    108                                 sout | "g for j=" | j | endl;
     108                                sout | "g for j=" | j;
    109109                                A y = { "y" };
    110110                                if (j == 0) {
    111                                         sout | "continue L2" | endl;
     111                                        sout | "continue L2";
    112112                                        continue; // destruct y - missing because object that needs to be destructed is not a part of this block, it's a part of the for's block
    113113                                } else if (j == 1) {
    114                                         sout | "break L2" | endl;
     114                                        sout | "break L2";
    115115                                        break;  // destruct y
    116116                                } else if (i == 1) {
    117                                         sout | "continue L1" | endl;
     117                                        sout | "continue L1";
    118118                                        continue L1; // destruct x,y - note: continue takes you to destructors for block, so only generate destructor for y
    119119                                } else if (k == 1) {
    120                                         sout | "break L1" | endl;
     120                                        sout | "break L1";
    121121                                        break L1;  // destruct x,y
    122122                                }
     
    125125        }
    126126
    127         sout | endl;
     127        sout | nl;
    128128        L3: if( 3 ) {
    129129                A w = { "w" };
    130130                if( 4 ) {
    131131                        A v = { "v" };
    132                         sout | "break L3" | endl;
     132                        sout | "break L3";
    133133                        break L3;
    134134                }
     
    144144        // * if S_L-S_G is non-empty, error
    145145        // * emit destructors for all variables in S_G-S_L
    146         sout | "h" | endl;
     146        sout | "h";
    147147        {
    148148                L0: ;
     
    152152                        A y = { "y" };
    153153                        // S_L1 = { y }
    154                 L1: sout | "L1" | endl;
     154                L1: sout | "L1";
    155155                        A x = { "x" };
    156156                        // S_L2 = { y, x }
    157                 L2: sout | "L2" | endl;
     157                L2: sout | "L2";
    158158                        if (i == 0) {
    159159                                ++i;
    160                                 sout | "goto L1" | endl;
     160                                sout | "goto L1";
    161161                                // S_G = { y, x }
    162162                                goto L1;  // jump back, destruct b/c before x definition
     
    165165                        } else if (i == 1) {
    166166                                ++i;
    167                                 sout | "goto L2" | endl;
     167                                sout | "goto L2";
    168168                                // S_G = { y, x }
    169169                                goto L2;  // jump back, do not destruct
     
    172172                        } else if (i == 2) {
    173173                                ++i;
    174                                 sout | "goto L3" | endl;
     174                                sout | "goto L3";
    175175                                // S_G = { y, x }
    176176                                goto L3;  // jump ahead, do not destruct
     
    180180                                ++i;
    181181                                A z = { "z" };
    182                                 sout | "goto L3-2" | endl;
     182                                sout | "goto L3-2";
    183183                                // S_G = { z, y, x }
    184184                                goto L3;
     
    187187                        } else {
    188188                                ++i;
    189                                 sout | "goto L4" | endl;
     189                                sout | "goto L4";
    190190                                // S_G = { y, x }
    191191                                goto L4;  // jump ahead, destruct b/c left block x was defined in
     
    194194                        }
    195195                        // S_L3 = { y, x }
    196                 L3: sout | "L3" | endl;
    197                         sout | "goto L2-2" | endl;
     196                L3: sout | "L3";
     197                        sout | "goto L2-2";
    198198                        // S_G = { y, x }
    199199                        goto L2; // jump back, do not destruct
     
    202202        }
    203203        // S_L4 = {}
    204         L4: sout | "L4" | endl;
     204        L4: sout | "L4";
    205205        if (i == 4) {
    206                 sout | "goto L0" | endl;
     206                sout | "goto L0";
    207207                // S_G = {}
    208208                goto L0;
     
    240240                f(i);
    241241        }
    242         sout | endl;
     242        sout | nl;
    243243        g();
    244         sout | endl;
     244        sout | nl;
    245245        h();
    246246
  • tests/raii/globals.cfa

    r9b086ca rcde3891  
    7070
    7171int main() {
    72         sout | "static\t\tinline\t\tautogen\t\tvalue" | endl;
     72        sout | "static\t\tinline\t\tautogen\t\tvalue";
    7373
    74         sout | "no \t\tno \t\tno \t\t" | g.val.value    | endl;
    75         sout | "no \t\tno \t\tyes\t\t" | ga.val.value   | endl;
    76         sout | "no \t\tyes\t\tno \t\t" | gi.val.value   | endl;
    77         sout | "no \t\tyes\t\tyes\t\t" | gia.val.value  | endl;
    78         sout | "yes\t\tno \t\tno \t\t" | gs.val.value   | endl;
    79         sout | "yes\t\tno \t\tyes\t\t" | gsa.val.value  | endl;
    80         sout | "yes\t\tyes\t\tno \t\t" | gsi.val.value  | endl;
    81         sout | "yes\t\tyes\t\tyes\t\t" | gsia.val.value | endl;
     74        sout | "no \t\tno \t\tno \t\t" | g.val.value;
     75        sout | "no \t\tno \t\tyes\t\t" | ga.val.value;
     76        sout | "no \t\tyes\t\tno \t\t" | gi.val.value;
     77        sout | "no \t\tyes\t\tyes\t\t" | gia.val.value;
     78        sout | "yes\t\tno \t\tno \t\t" | gs.val.value;
     79        sout | "yes\t\tno \t\tyes\t\t" | gsa.val.value;
     80        sout | "yes\t\tyes\t\tno \t\t" | gsi.val.value;
     81        sout | "yes\t\tyes\t\tyes\t\t" | gsia.val.value;
    8282
    8383}
  • tests/random.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // random.c --
     7// random.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Tue Jul  5 21:29:30 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jan  2 12:19:34 2018
    13 // Update Count     : 19
     12// Last Modified On : Tue Dec  4 21:46:25 2018
     13// Update Count     : 22
    1414//
    1515
    1616#include <fstream.hfa>
    17 #include <stdlib.hfa>                                                                           // random
     17#include <stdlib.hfa>                                                                   // random
    1818#include <unistd.h>                                                                             // getpid
    1919
     
    2424        // test polymorphic calls to random and stream
    2525        char c = random();
    26         sout | c | endl;
     26        sout | c;
    2727        c = random( 'A' );
    28         sout | c | endl;
     28        sout | c;
    2929        c = random( 'A', 'Z' );
    30         sout | c | endl;
     30        sout | c;
    3131
    3232        int i = random();
    33     sout | i | endl;
     33    sout | i;
    3434        i = random( 10 );
    35     sout | i | endl;
     35    sout | i;
    3636        i = random( -10, 20 );
    37     sout | i | endl;
     37    sout | i;
    3838
    3939        unsigned int ui = random();
    40     sout | ui | endl;
     40    sout | ui;
    4141        ui = random( 10u );
    42     sout | ui | endl;
     42    sout | ui;
    4343        ui = random( 10u, 20u );
    44     sout | ui | endl;
     44    sout | ui;
    4545
    4646        long int li = random();
    47     sout | li | endl;
     47    sout | li;
    4848        li = random( 10l );
    49     sout | li | endl;
     49    sout | li;
    5050        li = random( -10l, 20l );
    51     sout | li | endl;
     51    sout | li;
    5252
    5353        unsigned long int uli = random();
    54     sout | uli | endl;
     54    sout | uli;
    5555        uli = random( 10ul );
    56     sout | uli | endl;
     56    sout | uli;
    5757        uli = random( 10ul, 20ul );
    58     sout | uli | endl;
     58    sout | uli;
    5959
    6060    float f = random();
    61     sout | f | endl;
     61    sout | f;
    6262
    6363    double d = random();
    64     sout | d | endl;
     64    sout | d;
    6565
    6666    float _Complex fc = random();
    67     sout | fc | endl;
     67    sout | fc;
    6868
    6969    double _Complex dc = random();
    70     sout | dc | endl;
     70    sout | dc;
    7171
    7272    long double _Complex ldc = random();
    73     sout | ldc | endl;
     73    sout | ldc;
    7474} // main
    7575
    7676// Local Variables: //
    7777// tab-width: 4 //
    78 // compile-command: "cfa random.c" //
     78// compile-command: "cfa random.cfa" //
    7979// End: //
  • tests/rational.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // rational.c -- test rational number package
     7// rational.cfa -- test rational number package
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Mon Mar 28 08:43:12 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Oct 10 23:25:04 2017
    13 // Update Count     : 67
     12// Last Modified On : Tue Dec  4 21:46:42 2018
     13// Update Count     : 69
    1414//
    1515
     
    2727
    2828int main() {
    29         sout | "constructor" | endl;
     29        sout | "constructor";
    3030        Rational(int) a = { 3 }, b = { 4 }, c;
    31         sout | a | b | c | endl;
     31        sout | a | b | c;
    3232
    3333        a = (Rational(int)){ 4, 8 };
    3434        b = (Rational(int)){ 5, 7 };
    35         sout | a | b | endl;
     35        sout | a | b;
    3636        a = (Rational(int)){ -2, -3 };
    3737        b = (Rational(int)){ 3, -2 };
    38         sout | a | b | endl;
     38        sout | a | b;
    3939        a = (Rational(int)){ -2, 3 };
    4040        b = (Rational(int)){ 3, 2 };
    41         sout | a | b | endl;
     41        sout | a | b;
    4242
    43         sout | "logical" | endl;
     43        sout | "logical";
    4444        a = (Rational(int)){ -2 };
    4545        b = (Rational(int)){ -3, 2 };
    46         sout | a | b | endl;
    47 //      sout | a == 1 | endl; // FIX ME
    48         sout | a != b | endl;
    49         sout | a <  b | endl;
    50         sout | a <= b | endl;
    51         sout | a >  b | endl;
    52         sout | a >= b | endl;
     46        sout | a | b;
     47//      sout | a == 1; // FIX ME
     48        sout | a != b;
     49        sout | a <  b;
     50        sout | a <= b;
     51        sout | a >  b;
     52        sout | a >= b;
    5353
    54         sout | "arithmetic" | endl;
    55         sout | a | b | endl;
    56         sout | a + b | endl;
    57         sout | a - b | endl;
    58         sout | a * b | endl;
    59         sout | a / b | endl;
     54        sout | "arithmetic";
     55        sout | a | b;
     56        sout | a + b;
     57        sout | a - b;
     58        sout | a * b;
     59        sout | a / b;
    6060
    61         sout | "conversion" | endl;
     61        sout | "conversion";
    6262        a = (Rational(int)){ 3, 4 };
    63         sout | widen( a ) | endl;
     63        sout | widen( a );
    6464        a = (Rational(int)){ 1, 7 };
    65         sout | widen( a ) | endl;
     65        sout | widen( a );
    6666        a = (Rational(int)){ 355, 113 };
    67         sout | widen( a ) | endl;
    68         sout | narrow( 0.75, 4 ) | endl;
    69         sout | narrow( 0.14285714285714, 16 ) | endl;
    70         sout | narrow( 3.14159265358979, 256 ) | endl;
     67        sout | widen( a );
     68        sout | narrow( 0.75, 4 );
     69        sout | narrow( 0.14285714285714, 16 );
     70        sout | narrow( 3.14159265358979, 256 );
    7171
    72         sout | "decompose" | endl;
     72        sout | "decompose";
    7373        int n, d;
    7474//      [n, d] = a;
    75 //      sout | a | n | d | endl;
     75//      sout | a | n | d;
    7676
    77         sout | "more tests" | endl;
     77        sout | "more tests";
    7878        Rational(int) x = { 1, 2 }, y = { 2 };
    79         sout | x - y | endl;
    80         sout | x > y | endl;
    81         sout | x | numerator( x, 2 ) | x | endl;
    82         sout | y | denominator( y, -2 ) | y | endl;
     79        sout | x - y;
     80        sout | x > y;
     81        sout | x | numerator( x, 2 ) | x;
     82        sout | y | denominator( y, -2 ) | y;
    8383
    8484        Rational(int) z = { 0, 5 };
    85         sout | z | endl;
     85        sout | z;
    8686
    87         sout | x | numerator( x, 0 ) | x | endl;
     87        sout | x | numerator( x, 0 ) | x;
    8888
    8989        x = (Rational(int)){ 1, MAX } + (Rational(int)){ 1, MAX };
    90         sout | x | endl;
     90        sout | x;
    9191        x = (Rational(int)){ 3, MAX } + (Rational(int)){ 2, MAX };
    92         sout | x | endl;
     92        sout | x;
    9393
    9494        sin | a | b;
    95         sout | a | b | endl;
     95        sout | a | b;
    9696} // main
    9797
    9898// Local Variables: //
    9999// tab-width: 4 //
    100 // compile-command: "cfa rational.c" //
     100// compile-command: "cfa rational.cfa" //
    101101// End: //
  • tests/searchsort.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // searchsort.c --
     7// searchsort.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Thu Feb  4 18:17:50 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  9 07:54:57 2018
    13 // Update Count     : 101
     12// Last Modified On : Thu Dec 20 22:49:46 2018
     13// Update Count     : 108
    1414//
    1515
    1616#include <fstream.hfa>
    17 #include <stdlib.hfa>                                                                           // bsearch, qsort
     17#include <stdlib.hfa>                                                                   // bsearch, qsort
    1818#include <stdlib.h>                                                                             // C version of bsearch
    1919
     
    2121
    2222int main( void ) {
    23         const unsigned int size = 10;
     23        const int size = 10;
    2424        int iarr[size];
    2525
    26         for ( i; 0u ~ size ) {
     26        sout | nlOff;                                                                           // turn off auto newline
     27
     28        for ( i; 0 ~ size ) {
    2729                iarr[i] = size - i;
    2830                sout | iarr[i] | ", ";
    2931        } // for
    30         sout | endl | endl;
     32        sout | nl | nl;
    3133
    3234        // ascending sort/search by changing < to >
    3335        qsort( iarr, size );
    34         for ( i; 0u ~ size ) {
     36        for ( i; 0 ~ size ) {
    3537                sout | iarr[i] | ", ";
    3638        } // for
    37         sout | endl;
    38         for ( i; 0u ~ size ) {          // C version
     39        sout | nl;
     40        for ( i; 0 ~ size ) {           // C version
    3941                int key = size - i;
    4042                int * v = bsearch( &key, iarr, size, sizeof( iarr[0] ), comp );
    4143                sout | key | ':' | *v | ", ";
    4244        } // for
    43         sout | endl;
     45        sout | nl;
    4446
    45         for ( i; 0u ~ size ) {
     47        for ( i; 0 ~ size ) {
    4648                int * v = bsearch( size - i, iarr, size );
    4749                sout | size - i | ':' | *v | ", ";
    4850        } // for
    49         sout | endl;
    50         for ( i; 0u ~ size ) {
     51        sout | nl;
     52        for ( i; 0 ~ size ) {
    5153                unsigned int posn = bsearch( size - i, iarr, size );
    5254                sout | size - i | ':' | iarr[posn] | ", ";
    5355        } // for
    54         sout | endl | endl;
     56        sout | nl | nl;
    5557
    5658        // descending sort/search by changing < to >
    57         for ( i; 0u ~ size ) {
     59        for ( i; 0 ~ size ) {
    5860                iarr[i] = i + 1;
    5961                sout | iarr[i] | ", ";
    6062        } // for
    61         sout | endl;
     63        sout | nl;
    6264        {
    63                 int ?<?( int x, int y ) { return x > y; }
    64                 qsort( iarr, size );
    65                 for ( i; 0u ~ size ) {
     65                // redefinition of ?<? can't overlap the loop controls:
     66                {
     67                        int (*?<?)(int, int) = ?>?;
     68                        qsort( iarr, size );
     69                }
     70                for ( i; 0 ~ size ) {
    6671                        sout | iarr[i] | ", ";
    6772                } // for
    68                 sout | endl;
    69                 for ( i; 0u ~ size ) {
     73                sout | nl;
     74                for ( i; 0 ~ size ) {
     75                        int (*?<?)(int, int) = ?>?;
    7076                        int * v = bsearch( size - i, iarr, size );
    7177                        sout | size - i | ':' | *v | ", ";
    7278                } // for
    73                 sout | endl;
    74                 for ( i; 0u ~ size ) {
     79                sout | nl;
     80                for ( i; 0 ~ size ) {
     81                        int (*?<?)(int, int) = ?>?;
    7582                        unsigned int posn = bsearch( size - i, iarr, size );
    7683                        sout | size - i | ':' | iarr[posn] | ", ";
    7784                } // for
    7885        }
    79         sout | endl | endl;
     86        sout | nl | nl;
    8087
    8188        double darr[size];
    82         for ( i; 0u ~ size ) {
     89        for ( i; 0 ~ size ) {
    8390                darr[i] = size - i + 0.5;
    8491                sout | darr[i] | ", ";
    8592        } // for
    86         sout | endl;
     93        sout | nl;
    8794        qsort( darr, size );
    88         for ( i; 0u ~ size ) {
     95        for ( i; 0 ~ size ) {
    8996                sout | darr[i] | ", ";
    9097        } // for
    91         sout | endl;
    92         for ( i; 0u ~ size ) {
     98        sout | nl;
     99        for ( i; 0 ~ size ) {
    93100                double * v = bsearch( size - i + 0.5, darr, size );
    94101                sout | size - i + 0.5 | ':' | *v | ", ";
    95102        } // for
    96         sout | endl;
    97         for ( i; 0u ~ size ) {
     103        sout | nl;
     104        for ( i; 0 ~ size ) {
    98105                unsigned int posn = bsearch( size - i + 0.5, darr, size );
    99106                sout | size - i + 0.5 | ':' | darr[posn] | ", ";
    100107        } // for
    101         sout | endl | endl;
     108        sout | nl | nl;
    102109
    103110        struct S { int i, j; } sarr[size];
    104111        int ?<?( S t1, S t2 ) { return t1.i < t2.i && t1.j < t2.j; }
    105112        ofstream & ?|?( ofstream & os, S v ) { return os | v.i | ' ' | v.j; }
    106         for ( i; 0u ~ size ) {
     113        for ( i; 0 ~ size ) {
    107114                sarr[i].i = size - i;
    108115                sarr[i].j = size - i + 1;
    109116                sout | sarr[i] | ", ";
    110117        } // for
    111         sout | endl;
     118        sout | nl;
    112119        qsort( sarr, size );
    113         for ( i; 0u ~ size ) {
     120        for ( i; 0 ~ size ) {
    114121                sout | sarr[i] | ", ";
    115122        } // for
    116         sout | endl;
    117         for ( i; 0u ~ size ) {
     123        sout | nl;
     124        for ( i; 0 ~ size ) {
    118125                S temp = { size - i, size - i + 1 };
    119126                S * v = bsearch( temp, sarr, size );
    120127                sout | temp | ':' | *v | ", ";
    121128        } // for
    122         sout | endl;
    123         for ( i; 0u ~ size ) {
     129        sout | nl;
     130        for ( i; 0 ~ size ) {
    124131                S temp = { size - i, size - i + 1 };
    125132                unsigned int posn = bsearch( temp, sarr, size );
    126133                sout | temp | ':' | sarr[posn] | ", ";
    127134        } // for
    128         sout | endl | endl;
     135        sout | nl | nl;
    129136        {
    130                 unsigned int getKey( const S & s ) { return s.j; }
    131                 for ( i; 0u ~ size ) {
     137                int getKey( const S & s ) { return s.j; }
     138                for ( i; 0 ~ size ) {
    132139                        sout | sarr[i] | ", ";
    133140                } // for
    134                 sout | endl;
    135                 for ( i; 0u ~ size ) {
     141                sout | nl;
     142                for ( i; 0 ~ size ) {
    136143                        S * v = bsearch( size - i + 1, sarr, size );
    137144                        sout | size - i + 1 | ':' | *v | ", ";
    138145                } // for
    139                 sout | endl;
    140                 for ( i; 0u ~ size ) {
     146                sout | nl;
     147                for ( i; 0 ~ size ) {
    141148                        unsigned int posn = bsearch( size - i + 1, sarr, size );
    142149                        sout | size - i + 1 | ':' | sarr[posn] | ", ";
    143150                } // for
    144                 sout | endl | endl;
     151                sout | nl | nl;
    145152        }
    146153} // main
     
    148155// Local Variables: //
    149156// tab-width: 4 //
    150 // compile-command: "cfa searchsort.c" //
     157// compile-command: "cfa searchsort.cfa" //
    151158// End: //
  • tests/stdincludes.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // stdincludes.c --
     7// stdincludes.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Tue Aug 29 08:26:14 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 30 07:56:39 2017
    13 // Update Count     : 5
     12// Last Modified On : Tue Nov  6 18:00:53 2018
     13// Update Count     : 6
    1414//
    1515
     
    5151// Local Variables: //
    5252// tab-width: 4 //
    53 // compile-command: "cfa stdincludes.c" //
     53// compile-command: "cfa stdincludes.cfa" //
    5454// End: //
  • tests/sum.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // sum.c -- test resolvers ability to deal with many variables with the same name and to use the minimum number of casts
    8 //    necessary to disambiguate overloaded variable names.
     7// sum.cfa -- test resolvers ability to deal with many variables with the same name and to use the minimum number of
     8//    casts necessary to disambiguate overloaded variable names.
    99//
    1010// Author           : Peter A. Buhr
    1111// Created On       : Wed May 27 17:56:53 2015
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Thu Aug  2 08:03:09 2018
    14 // Update Count     : 279
     13// Last Modified On : Sun Dec 23 23:00:38 2018
     14// Update Count     : 287
    1515//
    1616
     
    5656        } // for
    5757        sout | "sum from" | low | "to" | High | "is"
    58                  | sum( size, (unsigned char *)a ) | ", check" | (int)s | endl;
     58                 | sum( size, (unsigned char *)a ) | ", check" | (int)s;
    5959
    6060        int s = 0, a[size], v = low;
     
    6464        } // for
    6565        sout | "sum from" | low | "to" | High | "is"
    66                  | sum( size, (int *)a ) | ", check" | (int)s | endl;
     66                 | sum( size, (int *)a ) | ", check" | (int)s;
    6767
    6868        float s = 0.0f, a[size], v = low / 10.0f;
     
    7272        } // for
    7373        sout | "sum from" | low / 10.0f | "to" | High / 10.0f | "is"
    74                  | sum( size, (float *)a ) | ", check" | (float)s | endl;
     74                 | sum( size, (float *)a ) | ", check" | (float)s;
    7575
    7676        double s = 0.0, a[size], v = low / 10.0;
     
    8080        } // for
    8181        sout | "sum from" | low / 10.0 | "to" | High / 10.0 | "is"
    82                  | sum( size, (double *)a ) | ", check" | (double)s | endl;
     82                 | sum( size, (double *)a ) | ", check" | (double)s;
    8383
    8484        struct S { int i, j; };
     
    9393        S ?++( S & t ) { S temp = t; t += (S){1}; return temp; }
    9494        ofstream & ?|?( ofstream & os, S v ) { return os | v.i | v.j; }
     95        void ?|?( ofstream & os, S v ) { (ofstream &)(os | v); nl( os ); }
    9596
    9697        S s = (S){0}, a[size], v = { low, low };
     
    100101        } // for
    101102        sout | "sum from" | low | "to" | High | "is"
    102                  | sum( size, (S *)a ) | ", check" | (S)s | endl;
     103                 | sum( size, (S *)a ) | ", check" | (S)s;
    103104
    104105        forall( otype Impl | sumable( Impl ) )
     
    114115        } // for
    115116        sout | "sum from" | low | "to" | High | "is"
    116                  | sum( size, gs.x ) | ", check" | (int)s | endl; // add field array in generic type
     117                 | sum( size, gs.x ) | ", check" | (int)s;              // add field array in generic type
    117118        delete( gs.x );
    118119} // main
     
    120121// Local Variables: //
    121122// tab-width: 4 //
    122 // compile-command: "cfa sum.c" //
     123// compile-command: "cfa sum.cfa" //
    123124// End: //
  • tests/swap.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // swap.c --
     7// swap.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec  7 09:13:13 2017
    13 // Update Count     : 71
     12// Last Modified On : Sun Dec 23 23:00:49 2018
     13// Update Count     : 77
    1414//
    1515
     
    1919int main( void ) {
    2020        char c1 = 'a', c2 = 'b';
    21         sout | "char\t\t\t" | c1 | ' ' | c2 | "\t\t\tswap ";
     21        sout | "char\t\t\t" | c1 | ' ' | c2 | "\t\t\tswap " | nonl;
    2222        swap( c1, c2 );
    23         sout | '\t' | c1 | ' ' | c2 | endl;
     23        sout | '\t' | c1 | ' ' | c2;
    2424
    2525        signed int i1 = -1, i2 = -2;
    26         sout | "signed int\t\t" | i1 | i2 | "\t\t\tswap ";
     26        sout | "signed int\t\t" | i1 | i2 | "\t\t\tswap " | nonl;
    2727        swap( i1, i2 );
    28         sout | '\t' | i1 | i2 | endl;
     28        sout | '\t' | i1 | i2;
    2929
    3030        unsigned int ui1 = 1, ui2 = 2;
    31         sout | "unsigned int\t\t" | ui1 | ui2 | "\t\t\tswap ";
     31        sout | "unsigned int\t\t" | ui1 | ui2 | "\t\t\tswap " | nonl;
    3232        swap( ui1, ui2 );
    33         sout | '\t' | ui1 | ui2 | endl;
     33        sout | '\t' | ui1 | ui2;
    3434
    3535        signed long int li1 = -1, li2 = -2;
    36         sout | "signed long int\t\t" | li1 | li2 | "\t\t\tswap ";
     36        sout | "signed long int\t\t" | li1 | li2 | "\t\t\tswap " | nonl;
    3737        swap( li1, li2 );
    38         sout | '\t' | li1 | li2 | endl;
     38        sout | '\t' | li1 | li2;
    3939
    4040        unsigned long int uli1 = 1, uli2 = 2;
    41         sout | "unsigned long int\t" | uli1 | uli2 | "\t\t\tswap ";
     41        sout | "unsigned long int\t" | uli1 | uli2 | "\t\t\tswap " | nonl;
    4242        swap( uli1, uli2 );
    43         sout | '\t' | uli1 | uli2 | endl;
     43        sout | '\t' | uli1 | uli2;
    4444
    4545        signed long long int lli1 = -1, lli2 = -2;
    46         sout | "signed long long int\t" | lli1 | lli2 | "\t\t\tswap ";
     46        sout | "signed long long int\t" | lli1 | lli2 | "\t\t\tswap " | nonl;
    4747        swap( lli1, lli2 );
    48         sout | '\t' | lli1 | lli2 | endl;
     48        sout | '\t' | lli1 | lli2;
    4949
    5050        unsigned long long int ulli1 = 1, ulli2 = 2;
    51         sout | "unsigned long long int\t" | ulli1 | ulli2 | "\t\t\tswap ";
     51        sout | "unsigned long long int\t" | ulli1 | ulli2 | "\t\t\tswap " | nonl;
    5252        swap( ulli1, ulli2 );
    53         sout | '\t' | ulli1 | ulli2 | endl;
     53        sout | '\t' | ulli1 | ulli2;
    5454
    5555        float f1 = 1.5, f2 = 2.5;
    56         sout | "float\t\t\t" | f1 | f2 | "\t\t\tswap ";
     56        sout | "float\t\t\t" | f1 | f2 | "\t\t\tswap " | nonl;
    5757        swap( f1, f2 );
    58         sout | '\t' | f1 | f2 | endl;
     58        sout | '\t' | f1 | f2;
    5959
    6060        double d1 = 1.5, d2 = 2.5;
    61         sout | "double\t\t\t" | d1 | d2 | "\t\t\tswap ";
     61        sout | "double\t\t\t" | d1 | d2 | "\t\t\tswap " | nonl;
    6262        swap( d1, d2 );
    63         sout | '\t' | d1 | d2 | endl;
     63        sout | '\t' | d1 | d2;
    6464
    6565        long double ld1 = 1.5, ld2 = 2.5;
    66         sout | "long double\t\t" | ld1 | ld2 | "\t\t\tswap ";
     66        sout | "long double\t\t" | ld1 | ld2 | "\t\t\tswap " | nonl;
    6767        swap( ld1, ld2 );
    68         sout | '\t' | ld1 | ld2 | endl;
     68        sout | '\t' | ld1 | ld2;
    6969
    7070        float _Complex fc1 = 1.5f+1.5if, fc2 = 2.5f+2.5if;
    71         sout | "float _Complex\t\t" | fc1 | fc2 | "\tswap ";
     71        sout | "float _Complex\t\t" | fc1 | fc2 | "\tswap " | nonl;
    7272        swap( fc1, fc2 );
    73         sout | '\t' | fc1 | fc2 | endl;
     73        sout | '\t' | fc1 | fc2;
    7474
    7575        double _Complex dc1 = 1.5d+1.5id, dc2 = 2.5d+2.5id;
    76         sout | "double _Complex\t\t" | dc1 | dc2 | "\tswap ";
     76        sout | "double _Complex\t\t" | dc1 | dc2 | "\tswap " | nonl;
    7777        swap( dc1, dc2 );
    78         sout | '\t' | dc1 | dc2 | endl;
     78        sout | '\t' | dc1 | dc2;
    7979
    8080        long double _Complex ldc1 = 1.5d+1.5il, ldc2 = 2.5d+2.5il;
    81         sout | "long double _Complex\t" | ldc1 | ldc2 | "\tswap ";
     81        sout | "long double _Complex\t" | ldc1 | ldc2 | "\tswap " | nonl;
    8282        swap( ldc1, ldc2 );
    83         sout | '\t' | ldc1 | ldc2 | endl;
     83        sout | '\t' | ldc1 | ldc2;
    8484
    8585        struct S { int i, j; } s1 = { 1, 2 }, s2 = { 2, 1 };
    8686        ofstream & ?|?( ofstream & os, S s ) { return os | s.i | s.j; }
    87         sout | "struct S\t\t" | s1 | "," | s2 | "\t\tswap ";
     87        void ?|?( ofstream & os, S s ) { (ofstream &)(os | s.i | s.j); nl( os ); }
     88        sout | "struct S\t\t" | s1 | "," | s2 | "\t\tswap " | nonl;
    8889        swap( s1, s2 );
    89         sout | '\t' | s1 | "," | s2 | endl;
     90        sout | '\t' | s1 | "," | s2;
    9091} // main
    9192
    9293// Local Variables: //
    9394// tab-width: 4 //
    94 // compile-command: "cfa swap.c" //
     95// compile-command: "cfa swap.cfa" //
    9596// End: //
  • tests/switch.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // switch.c --
     7// switch.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Tue Jul 12 06:50:22 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar  8 07:33:05 2018
    13 // Update Count     : 36
     12// Last Modified On : Tue Nov  6 18:01:34 2018
     13// Update Count     : 37
    1414//
    1515
     
    104104// Local Variables: //
    105105// tab-width: 4 //
    106 // compile-command: "cfa switch.c" //
     106// compile-command: "cfa switch.cfa" //
    107107// End: //
  • tests/test.py

    r9b086ca rcde3891  
    1919
    2020        def matchTest(path):
    21                 match = re.search("%s\/([\w\/\-_]*).expect\/([\w\-_]+)(\.[\w\-_]+)?\.txt" % settings.SRCDIR, path)
     21                match = re.search("^%s\/([\w\/\-_]*).expect\/([\w\-_]+)(\.[\w\-_]+)?\.txt$" % settings.SRCDIR, path)
    2222                if match :
    2323                        test = Test()
     
    3434# reads the directory ./.expect and indentifies the tests
    3535def listTests( includes, excludes ):
    36         includes = [canonicalPath( i ) for i in includes] if includes else None
    37         excludes = [canonicalPath( i ) for i in excludes] if excludes else None
    38 
    3936        # tests directly in the .expect folder will always be processed
    4037        test_list = findTests()
     
    124121#               running test functions
    125122################################################################################
    126 # fix the absolute paths in the output
    127 def fixoutput( fname ):
    128         if not is_ascii(fname):
    129                 return
    130 
    131         file_replace(fname, "%s/" % settings.SRCDIR, "")
    132 
     123def success(val):
     124        return val == 0 or settings.dry_run
     125
     126def isExe(file):
     127        return settings.dry_run or fileIsExecutable(file)
     128
     129def noRule(file, target):
     130        return not settings.dry_run and fileContainsOnly(file, "make: *** No rule to make target `%s'.  Stop." % target)
    133131
    134132# logic to run a single test and return the result (No handling of printing or other test framework logic)
     
    146144
    147145        # build, skipping to next test on error
    148         before = time.time()
    149         make_ret, _ = make( test.target(),
    150                 redirects  = "2> %s 1> /dev/null" % out_file,
    151                 error_file = err_file
    152         )
    153         after = time.time()
    154 
    155         comp_dur = after - before
    156 
     146        with Timed() as comp_dur:
     147                make_ret, _ = make( test.target(),      redirects  = ("2> %s 1> /dev/null" % out_file), error_file = err_file )
     148
     149        # if the make command succeds continue otherwise skip to diff
    157150        run_dur = None
    158 
    159         # if the make command succeds continue otherwise skip to diff
    160         if make_ret == 0 or settings.dry_run:
    161                 before = time.time()
    162                 if settings.dry_run or fileIsExecutable(exe_file) :
    163                         # run test
    164                         retcode, _ = sh("timeout %d %s > %s 2>&1" % (settings.timeout.single, exe_file, out_file), input = in_file)
    165                 else :
    166                         # simply cat the result into the output
    167                         retcode, _ = sh("cat %s > %s" % (exe_file, out_file))
    168 
    169                 after = time.time()
    170                 run_dur = after - before
     151        if success(make_ret):
     152                with Timed() as run_dur:
     153                        if isExe(exe_file):
     154                                # run test
     155                                retcode = run(exe_file, out_file, in_file)
     156                        else :
     157                                # simply cat the result into the output
     158                                retcode = cat(exe_file, out_file)
    171159        else:
    172                 retcode, _ = sh("mv %s %s" % (err_file, out_file))
    173 
    174 
    175         if retcode == 0:
    176                 # fixoutput(out_file)
     160                retcode = mv(err_file, out_file)
     161
     162        if success(retcode):
    177163                if settings.generating :
    178164                        # if we are ounly generating the output we still need to check that the test actually exists
    179                         if not settings.dry_run and fileContainsOnly(out_file, "make: *** No rule to make target `%s'.  Stop." % test.target()) :
    180                                 retcode = 1;
     165                        if noRule(out_file, test.target()) :
     166                                retcode = 1
    181167                                error = "\t\tNo make target for test %s!" % test.target()
    182                                 sh("rm %s" % out_file, False)
     168                                rm(out_file)
    183169                        else:
    184170                                error = None
     
    191177                        error = myfile.read()
    192178
     179                ret, info = coreInfo(exe_file)
     180                error = error + info
     181
     182
    193183
    194184        # clean the executable
    195         sh("rm -f %s > /dev/null 2>&1" % test.target())
    196 
    197         return retcode, error, [comp_dur, run_dur]
     185        rm(exe_file)
     186
     187        return retcode, error, [comp_dur.duration, run_dur.duration if run_dur else None]
    198188
    199189# run a single test and handle the errors, outputs, printing, exception handling, etc.
     
    202192        with SignalHandling():
    203193                # print formated name
    204                 name_txt = "%20s  " % t.name
     194                name_txt = "%24s  " % t.name
    205195
    206196                retcode, error, duration = run_single_test(t)
     
    266256        allTests = listTests( options.include, options.exclude )
    267257
     258
    268259        # if user wants all tests than no other treatement of the test list is required
    269260        if options.all or options.list or options.list_comp or options.include :
  • tests/tuple/tupleAssign.cfa

    r9b086ca rcde3891  
    1010// Created On       : Tue Nov 15 17:24:32 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Mar  6 21:23:58 2017
    13 // Update Count     : 34
     12// Last Modified On : Tue Dec  4 22:03:48 2018
     13// Update Count     : 35
    1414//
    1515
     
    2424                // swap x, y and store the new [x, y] in [u, v] and in z;
    2525                printf( "u=%d v=%d x=%d y=%d z=[%d, %d]\n", u, v, x, y, z );
    26                 sout | "u=" | u | "v=" | v | "x=" | x | "y=" | y | "z=[" | z | "]" | endl;
     26                sout | "u=" | u | "v=" | v | "x=" | x | "y=" | y | "z=[" | z | "]";
    2727                z = [u, v] = [x, y] = [y, x];
    2828                printf( "u=%d v=%d x=%d y=%d z=[%d, %d]\n", u, v, x, y, z );
    29                 sout | "u=" | u | "v=" | v | "x=" | x | "y=" | y | "z=[" | z | "]" | endl;
     29                sout | "u=" | u | "v=" | v | "x=" | x | "y=" | y | "z=[" | z | "]";
    3030
    3131                // shuffle elements -- v = z.0, z.0 = z.1, z.1 = u, u = v
    3232                [v, z, u] = [z, u, v];
    3333                printf( "u=%d v=%d z=[%d, %d]\n", u, v, z );
    34                 sout | "u=" | u | "v=" | v | "z=[" | z | "]" | endl;
     34                sout | "u=" | u | "v=" | v | "z=[" | z | "]";
    3535
    3636                // multiple assignment with tuple expression on right
     
    3838                [u, v] = [123, 456];
    3939                printf( "u=%d v=%d z=[%d, %d]\n", u, v, z );
    40                 sout | "u=" | u | "v=" | v | "z=[" | z | "]" | endl;
     40                sout | "u=" | u | "v=" | v | "z=[" | z | "]";
    4141        }
    4242        {
     
    5555                [t, x, d, i, c, x] = (double)94.12;
    5656                printf( "d=%lg i=%d c=%c t=[%d, %lg, %d]\n", d, i, (int)c, t );
    57                 sout | "d=" | d | "i=" | i | "c=" | c | ' ' | "t=[" | t | "]" | endl;
     57                sout | "d=" | d | "i=" | i | "c=" | c | ' ' | "t=[" | t | "]";
    5858                [x, c, i, d, x, t] = (double)-94.12;
    5959                printf( "d=%lg i=%d c=%c t=[%d, %lg, %d]\n", d, i, c, t );
    60                 sout | "d=" | d | "i=" | i | "c=" | c | ' ' | "t=[" | t | "]" | endl;
     60                sout | "d=" | d | "i=" | i | "c=" | c | ' ' | "t=[" | t | "]";
    6161        }
    6262}
  • tests/userLiterals.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // user_literals.c --
     7// user_literals.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Sep  6 21:40:50 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Apr 29 16:51:42 2018
    13 // Update Count     : 54
     12// Last Modified On : Tue Dec  4 22:03:10 2018
     13// Update Count     : 56
    1414//
    1515
     
    1818#include <uchar.h>
    1919
    20 int ?`s( int s ) { sout | "secs" | s | endl; return s; }
    21 int ?`m( int m ) { sout | "mins" | m | endl; return m * 60; }
    22 int ?`h( int h ) { sout | "hours" | h | endl; return h * 3600; }
    23 int ?`_A_( int x ) { sout | "_A_" | x | endl; return x; }
    24 int ?`__thingy_( int x ) { sout | "_thingy_" | x | endl; return x; }
     20int ?`s( int s ) { sout | "secs" | s; return s; }
     21int ?`m( int m ) { sout | "mins" | m; return m * 60; }
     22int ?`h( int h ) { sout | "hours" | h; return h * 3600; }
     23int ?`_A_( int x ) { sout | "_A_" | x; return x; }
     24int ?`__thingy_( int x ) { sout | "_thingy_" | x; return x; }
    2525
    26 int ?`s( const char * s ) { sout | "secs" | s | endl; return 0; }
    27 int ?`m( const char16_t * m ) { sout | "mins" | m | endl; return 0;}
    28 int ?`h( const char32_t * h ) { sout | "hours" | h | endl; return 0; }
    29 int ?`_A_( const wchar_t * str ) { sout | "_A_" | str | endl; return 0; }
    30 int ?`__thingy_( const char * str ) { sout | "_thingy_" | str | endl; return 0; }
     26int ?`s( const char * s ) { sout | "secs" | s; return 0; }
     27int ?`m( const char16_t * m ) { sout | "mins" | m; return 0;}
     28int ?`h( const char32_t * h ) { sout | "hours" | h; return 0; }
     29int ?`_A_( const wchar_t * str ) { sout | "_A_" | str; return 0; }
     30int ?`__thingy_( const char * str ) { sout | "_thingy_" | str; return 0; }
    3131
    3232
     
    4646        Weight w, heavy = { 20 };                                                       // 20 stone
    4747        w = 155`lb;
    48         sout | w | endl;
     48        sout | w;
    4949        w = 0b_1111`st;
    50         sout | w | endl;
     50        sout | w;
    5151        w = 0_233`lb;                                                                           // octal weight (155)
    52         sout | w | endl;
     52        sout | w;
    5353        w = 0x_9b_u`kg;
    54         sout | w | endl;
     54        sout | w;
    5555        w = 70.3`kg;
    56         sout | w | endl;
     56        sout | w;
    5757        w = 11`st + 1`lb;
    58         sout | w | endl;
     58        sout | w;
    5959        w = 5`st + 8`kg + 25`lb + heavy;
    60         sout | w | endl;
     60        sout | w;
    6161
    6262//      0`secs;
     
    9090// Local Variables: //
    9191// tab-width: 4 //
    92 // compile-command: "cfa user_literals.c" //
     92// compile-command: "cfa user_literals.cfa" //
    9393// End: //
  • tests/variableDeclarator.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // variableDeclarator.c --
     7// variableDeclarator.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Aug 17 08:41:42 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 17 08:42:21 2016
    13 // Update Count     : 1
     12// Last Modified On : Tue Nov  6 18:02:16 2018
     13// Update Count     : 2
    1414//
    1515
     
    182182// Local Variables: //
    183183// tab-width: 4 //
    184 // compile-command: "cfa variableDeclarator.c" //
     184// compile-command: "cfa variableDeclarator.cfa" //
    185185// End: //
  • tests/vector.cfa

    r9b086ca rcde3891  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // vector.c --
     7// vector.cfa --
    88//
    99// Author           : Thierry Delisle
    1010// Created On       : Mon Jul  4 23:36:19 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jan 18 17:08:08 2018
    13 // Update Count     : 27
     12// Last Modified On : Tue Dec  4 22:02:39 2018
     13// Update Count     : 29
    1414//
    1515
     
    2121        do {                                                                            \
    2222                if ( !(x) ) {                                                   \
    23                         sout | "CHECK failed :" | #x | "at" | __FILE__ | " :" | __LINE__ | endl;        \
     23                        sout | "CHECK failed :" | #x | "at" | __FILE__ | " :" | __LINE__;       \
    2424                        abort();                                                        \
    2525                }                                                                               \
     
    3131        assert( empty( &iv ) );
    3232        assert( size( &iv ) == 0 );
    33         sout | size( &iv ) | endl;
     33        sout | size( &iv );
    3434
    3535        push_back( &iv, 1 );
    3636        assert( size( &iv ) == 1 );
    37         sout | size( &iv ) | endl;
     37        sout | size( &iv );
    3838
    3939        push_back( &iv, 2 );
    4040        assert( size( &iv ) == 2 );
    41         sout | size( &iv ) | endl;
     41        sout | size( &iv );
    4242
    4343        push_back( &iv, 3 );
    4444        assert( size( &iv ) == 3 );
    45         sout | size( &iv ) | endl;
     45        sout | size( &iv );
    4646
    4747        assert( !empty( &iv ) );
     
    5858        assert( empty( &iv ) );
    5959        assert( size( &iv ) == 0 );
    60         sout | size( &iv ) | endl;
     60        sout | size( &iv );
    6161}
    6262
    6363// Local Variables: //
    6464// tab-width: 4 //
    65 // compile-command: "cfa vector.c" //
     65// compile-command: "cfa vector.cfa" //
    6666// End: //
  • tests/warnings/.expect/self-assignment.txt

    r9b086ca rcde3891  
    1 warnings/self-assignment.c:29:1 warning: self assignment of expression: Cast of:
     1warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Cast of:
    22  Variable Expression: j: signed int
    33... to:
    44  reference to signed int
    5 warnings/self-assignment.c:30:1 warning: self assignment of expression: Cast of:
    6   Variable Expression: s: instance of struct S with body 1 
     5warnings/self-assignment.cfa:30:1 warning: self assignment of expression: Cast of:
     6  Variable Expression: s: instance of struct S with body 1
    77... to:
    8   reference to instance of struct S with body 1 
    9 warnings/self-assignment.c:31:1 warning: self assignment of expression: Cast of:
    10   Member Expression, with field: 
     8  reference to instance of struct S with body 1
     9warnings/self-assignment.cfa:31:1 warning: self assignment of expression: Cast of:
     10  Member Expression, with field:
    1111    i: signed int
    12   ... from aggregate: 
    13     Variable Expression: s: instance of struct S with body 1 
     12  ... from aggregate:
     13    Variable Expression: s: instance of struct S with body 1
    1414... to:
    1515  reference to signed int
    16 warnings/self-assignment.c:32:1 warning: self assignment of expression: Cast of:
    17   Member Expression, with field: 
     16warnings/self-assignment.cfa:32:1 warning: self assignment of expression: Cast of:
     17  Member Expression, with field:
    1818    i: signed int
    19   ... from aggregate: 
    20     Member Expression, with field: 
    21       s: instance of struct S with body 1 
    22     ... from aggregate: 
    23       Variable Expression: t: instance of struct T with body 1 
     19  ... from aggregate:
     20    Member Expression, with field:
     21      s: instance of struct S with body 1
     22    ... from aggregate:
     23      Variable Expression: t: instance of struct T with body 1
    2424... to:
    2525  reference to signed int
Note: See TracChangeset for help on using the changeset viewer.