Changeset 7f6a7c9 for tests


Ignore:
Timestamp:
Sep 21, 2022, 11:02:15 AM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
95dab9e
Parents:
428adbc (diff), 0bd46fd (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 pthread-emulation

Location:
tests
Files:
9 added
46 deleted
23 edited
36 moved

Legend:

Unmodified
Added
Removed
  • tests/.expect/declarationSpecifier.arm64.txt

    r428adbc r7f6a7c9  
    735735}
    736736static volatile const struct __anonymous15 _X3x36KVS13__anonymous15_1;
     737_Thread_local signed int _X3x37i_1;
     738__thread signed int _X3x38i_1;
    737739static inline volatile const signed int _X3f11Fi___1();
    738740static inline volatile const signed int _X3f12Fi___1();
  • tests/.expect/declarationSpecifier.x64.txt

    r428adbc r7f6a7c9  
    735735}
    736736static volatile const struct __anonymous15 _X3x36KVS13__anonymous15_1;
     737_Thread_local signed int _X3x37i_1;
     738__thread signed int _X3x38i_1;
    737739static inline volatile const signed int _X3f11Fi___1();
    738740static inline volatile const signed int _X3f12Fi___1();
  • tests/.expect/declarationSpecifier.x86.txt

    r428adbc r7f6a7c9  
    735735}
    736736static volatile const struct __anonymous15 _X3x36KVS13__anonymous15_1;
     737_Thread_local signed int _X3x37i_1;
     738__thread signed int _X3x38i_1;
    737739static inline volatile const signed int _X3f11Fi___1();
    738740static inline volatile const signed int _X3f12Fi___1();
  • tests/.expect/loop_else.txt

    r428adbc r7f6a7c9  
    33330 1 2 3 4 5 6 7 8 9 else
    34340 1 2 3 4 5 6 7 8 9 10 else
    35 10 9 8 7 6 5 4 3 2 1 else
     3510 9 8 7 6 5 4 3 2 1 0 else
    3636
    37373 6 9 else
    38 
    39 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else
    40 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else
    41 
    42 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else
    43 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else
    44 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10)else
    45 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10)else
    46 
    47 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)else
    48 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)else
    49 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)else
    50 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)else
    5138
    52390 -5 1 -4 2 -3 3 -2 4 -1 5 0 6 1 7 2 8 3 9 4 else
     
    63500 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5 else
    64510 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5 else
     52(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else
     53(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else
     54
     55(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else
     56(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else
     57(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10)else
     58(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10)else
     59
     60(10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)else
     61(10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)else
     62(10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)else
     63(10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)else
     64
  • tests/.expect/loopctrl.txt

    r428adbc r7f6a7c9  
    31310 1 2 3 4 5 6 7 8 9
    32320 1 2 3 4 5 6 7 8 9 10
    33 10 9 8 7 6 5 4 3 2 1
     3310 9 8 7 6 5 4 3 2 1 0
    3434
    35353 6 9
    36 
    37 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)
    38 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)
    39 
    40 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)
    41 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)
    42 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10)
    43 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10)
    44 
    45 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)
    46 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)
    47 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)
    48 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)
    4936
    50370 -5 1 -4 2 -3 3 -2 4 -1 5 0 6 1 7 2 8 3 9 4
     
    61480 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5
    62490 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5
     50(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)
     51(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)
     52
     53(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)
     54(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)
     55(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10)
     56(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10)
     57
     58(10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)
     59(10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)
     60(10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)
     61(10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)
     62
     63A A A A A A A A A A
     64B B B B B B B B B B B
     65C C C C C C C C C C
     66D D D D D D D D D D D
     67A A A A A A A A A A
     68B B B B B B B B B B B
     69C C C C C C C C C C
     70D D D D D D D D D D D
     71A A A A A
     72B B B B B B
     73C C C C C
     74D D D D D D
     750 1 2 3 4 5 6 7 8 9
     760 1 2 3 4 5 6 7 8 9 10
     7710 9 8 7 6 5 4 3 2 1
     7810 9 8 7 6 5 4 3 2 1 0
     790 1 2 3 4 5 6 7 8 9
     800 1 2 3 4 5 6 7 8 9 10
     8110 9 8 7 6 5 4 3 2 1
     8210 9 8 7 6 5 4 3 2 1 0
     830 2 4 6 8
     840 2 4 6 8 10
     8510 8 6 4 2
     8610 8 6 4 2 0
     870 1 2 3 4 5 6 7 8 9
     880 1 2 3 4 5 6 7 8 9
     890 1 2 3 4 5 6 7 8 9 10
     9010 9 8 7 6 5 4 3 2 1
     9110 9 8 7 6 5 4 3 2 1 0
     920 1 2 3 4 5 6 7 8 9
     930 1 2 3 4 5 6 7 8 9 10
     9410 9 8 7 6 5 4 3 2 1
     9510 9 8 7 6 5 4 3 2 1 0
     960 2 4 6 8
     970 2 4 6 8 10
     9810 8 6 4 2
     9910 8 6 4 2 0
     1000 1 2 3 4 5 6 7 8 9
     1010 -1 -2 -3 -4 -5 -6 -7 -8 -9
     1020 2 4 6 8
     1030 -2 -4 -6 -8
     1040 1 2 3 4 5 6 7 8 9
     1050 2 4 6 8
     1060 -2 -4 -6 -8
     1070 2 4 6 8
     1080 -2 -4 -6 -8
     1090 1 2 3 4 5 6 7 8 9
  • tests/Makefile.am

    r428adbc r7f6a7c9  
    5454
    5555# adjust CC to current flags
    56 CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS} ${AST_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS} ${AST_FLAGS})
     56CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS} ,$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
    5757CFACC = $(CC)
    5858
     
    6161
    6262# adjusted CC but without the actual distcc call
    63 CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS} ${AST_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS} ${AST_FLAGS})
     63CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS} ,$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
    6464CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'))
    6565
  • tests/concurrent/.expect/ctor-check.txt

    r428adbc r7f6a7c9  
    22?{}: function
    33... with parameters
    4   this: lvalue reference to instance of struct Empty with body
     4  this: mutex reference to instance of struct Empty with body
    55... returning nothing
    66 with body
  • tests/concurrent/clib.c

    r428adbc r7f6a7c9  
    88}
    99
    10 thread_local struct drand48_data buffer = { 0 };
     10_Thread_local struct drand48_data buffer = { 0 };
    1111int myrand() {
    1212        long int result;
  • tests/concurrent/clib_tls.c

    r428adbc r7f6a7c9  
    1414
    1515
    16 thread_local int checkval = 0xBAADF00D;
     16__thread int checkval = 0xBAADF00D;
    1717
    1818void init(void * ) {
  • tests/concurrent/park/contention.cfa

    r428adbc r7f6a7c9  
    22#include <thread.hfa>
    33
    4 thread_local drand48_data buffer = { 0 };
     4__thread drand48_data buffer = { 0 };
    55int myrand() {
    66        long int result;
  • tests/config.py.in

    r428adbc r7f6a7c9  
    99HOSTARCH = "@host_cpu@"
    1010DISTRIBUTE = @HAS_DISTCC@
    11 NEWAST = @DEFAULT_NEW_AST@
  • tests/declarationSpecifier.cfa

    r428adbc r7f6a7c9  
    1 // 
     1//
    22// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    33//
    44// The contents of this file are covered under the licence agreement in the
    55// file "LICENCE" distributed with Cforall.
    6 // 
    7 // declarationSpecifier.cfa -- 
    8 // 
     6//
     7// declarationSpecifier.cfa --
     8//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Aug 17 08:21:04 2016
     
    1212// Last Modified On : Tue Apr 30 18:20:36 2019
    1313// Update Count     : 4
    14 // 
     14//
    1515
    1616typedef short int Int;
     
    5151struct { Int i; } const static volatile x35;
    5252struct { Int i; } const volatile static x36;
     53
     54_Thread_local int x37;
     55__thread int x38;
    5356
    5457static inline const volatile int f11();
  • tests/enum_tests/structEnum.cfa

    r428adbc r7f6a7c9  
    22
    33struct Point {
    4     int x;
    5     char y;
     4     int x;
     5     char y;
    66};
    77
    88enum(Point) PointEnum {
    9     first={
    10         100,
    11         'c'
    12     },
    13     second={
    14         200,
    15         'a'
    16     }
     9     first={
     10         100,
     11         'c'
     12     },
     13     second={
     14         200,
     15         'a'
     16     }
    1717};
     18
     19PointEnum foo(PointEnum in) {
     20     return in;
     21}
    1822
    1923// The only valid usage
    2024struct Point apple = first;
    2125// Failed due to Qualified name is currently unimplemented.
    22 // struct Point banana = PointEnum.first;
    2326
    2427int main() {
    25     printf("%d %c\n", apple.x, apple.y);
    26     // Failed; enumInstType is now not a real type and not instantiated.
    27     // Not sure if we want that
    28     // printf("%d %c\n", second.x, second.y);
    29     return 0;
     28     PointEnum vals = second;
     29     PointEnum val2;
     30     // The failing line: assignment
     31     // val2 = vals;
     32
     33     printf("%d %c\n", apple.x, apple.y);
     34     // Failed; enumInstType is now not a real type and not instantiated.
     35     // Not sure if we want that
     36     // printf("%d %c\n", second.x, second.y);
     37     return 0;
    3038}
  • tests/heap.cfa

    r428adbc r7f6a7c9  
    1010// Created On       : Tue Nov  6 17:54:56 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 15 12:11:51 2020
    13 // Update Count     : 79
     12// Last Modified On : Wed Aug 10 09:57:01 2022
     13// Update Count     : 86
    1414//
    1515
     
    2626//      return __CFA_DEFAULT_PREEMPTION__;
    2727// }
    28 
    29 size_t default_heap_expansion() {
    30         return 10 * 1024 * 1024;
    31 } // default_heap_expansion
    32 
    33 size_t default_mmap_start() {
    34         return 512 * 1024 + 1;
    35 } // default_mmap_start
    3628
    3729thread Worker {
     
    6658                        for ( k; i ) locns[i][k] = '\345';
    6759                } // for
    68                 for ( i; NoOfAllocs - 1 -~= 0 ) {
     60                for ( i; -~= NoOfAllocs - 1 ) {
    6961                        //sout | (void *)locns[i];
    7062                        for ( k; i ) if ( locns[i][k] != '\345' ) abort( "new/delete corrupt storage2" );
     
    9991
    10092        for ( i; NoOfMmaps ) {
    101                 size_t s = i + default_mmap_start();                    // cross over point
     93                size_t s = i + malloc_mmap_start();                     // cross over point
    10294                char * area = (char *)malloc( s );
    10395                area[0] = '\345'; area[s - 1] = '\345';                 // fill first/last
     
    10799
    108100        for ( i; NoOfMmaps ) {
    109                 size_t s = i + default_mmap_start();                    // cross over point
     101                size_t s = i + malloc_mmap_start();                     // cross over point
    110102                locns[i] = (char *)malloc( s );
    111103                locns[i][0] = '\345'; locns[i][s - 1] = '\345'; // fill first/last
     
    113105        } // for
    114106        for ( i; NoOfMmaps ) {
    115                 size_t s = i + default_mmap_start();                    // cross over point
     107                size_t s = i + malloc_mmap_start();                     // cross over point
    116108                if ( locns[i][0] != '\345' || locns[i][s - 1] != '\345' ||
    117109                         locns[i][malloc_usable_size( locns[i] ) - 1] != '\345' ) abort( "malloc/free corrupt storage" );
     
    151143
    152144        for ( i; NoOfMmaps ) {
    153                 size_t s = i + default_mmap_start();                    // cross over point
     145                size_t s = i + malloc_mmap_start();                     // cross over point
    154146                char * area = (char *)calloc( 1, s );
    155147                if ( area[0] != '\0' || area[s - 1] != '\0' ) abort( "calloc/free corrupt storage4.1" );
     
    162154
    163155        for ( i; NoOfMmaps ) {
    164                 size_t s = i + default_mmap_start();                    // cross over point
     156                size_t s = i + malloc_mmap_start();                     // cross over point
    165157                locns[i] = (char *)calloc( 1, s );
    166158                if ( locns[i][0] != '\0' || locns[i][s - 1] != '\0' ||
     
    171163        } // for
    172164        for ( i; NoOfMmaps ) {
    173                 size_t s = i + default_mmap_start();                    // cross over point
     165                size_t s = i + malloc_mmap_start();                     // cross over point
    174166                if ( locns[i][0] != '\345' || locns[i][s - 1] != '\345' ||
    175167                         locns[i][malloc_usable_size( locns[i] ) - 1] != '\345' ) abort( "calloc/free corrupt storage6" );
     
    198190                //sout | alignments[a];
    199191                for ( i; 1 ~ NoOfMmaps ) {
    200                         size_t s = i + default_mmap_start();            // cross over point
     192                        size_t s = i + malloc_mmap_start();             // cross over point
    201193                        char * area = (char *)memalign( a, s );
    202194                        //sout | i | area;
     
    232224        for ( i; 2 ~ NoOfAllocs ~ 12 ) {
    233225                // initial N byte allocation
    234                 size_t s = i + default_mmap_start();                    // cross over point
     226                size_t s = i + malloc_mmap_start();                     // cross over point
    235227                char * area = (char *)malloc( s );
    236228                area[0] = '\345'; area[s - 1] = '\345';                 // fill first/penultimate byte
     
    269261        for ( i; 2 ~ NoOfAllocs ~ 12 ) {
    270262                // initial N byte allocation
    271                 size_t s = i + default_mmap_start();                    // cross over point
     263                size_t s = i + malloc_mmap_start();                     // cross over point
    272264                char * area = (char *)malloc( s );
    273265                area[0] = '\345'; area[s - 1] = '\345';                 // fill first/penultimate byte
     
    307299        for ( i; 1 ~ 10_000 ~ 12 ) {
    308300                // initial N byte allocation
    309                 size_t s = i + default_mmap_start();                    // cross over point
     301                size_t s = i + malloc_mmap_start();                     // cross over point
    310302                char * area = (char *)calloc( 1, s );
    311303                if ( area[0] != '\0' || area[s - 1] != '\0' ||
     
    481473
    482474int main() {
    483         const unsigned int NoOfWorkers = 4;
     475        enum { NoOfWorkers = 4 };
    484476        {
    485477                processor processors[NoOfWorkers - 1] __attribute__(( unused )); // more than one processor
  • tests/io/away_fair.cfa

    r428adbc r7f6a7c9  
    6060                        struct io_uring_sqe * sqe;
    6161                        __u32 idx;
    62                         struct $io_context * ctx = cfa_io_allocate(&sqe, &idx, 1);
     62                        struct io_context$ * ctx = cfa_io_allocate(&sqe, &idx, 1);
    6363
    6464                        zero_sqe(sqe);
  • tests/io/comp_fair.cfa

    r428adbc r7f6a7c9  
    2727
    2828struct {
    29       barrier & bar;
    30       int pipe[2];
     29        barrier & bar;
     30        int pipe[2];
    3131
    3232} globals;
     
    6565thread Reader {};
    6666void main(Reader & this) {
    67       bool do_read = has_user_level_blocking( (fptr_t)async_read );
     67        char thrash[1];
     68        bool do_read = has_user_level_blocking( (fptr_t)async_read );
    6869
    69       for(TIMES) {
    70             io_future_t f;
    71             if ( do_read ) {
    72                   char thrash[1];
    73                   async_read(f, globals.pipe[0], thrash, 1, 0);
    74             } else {
    75                   fulfil(f, 0); // If we don't have user-level blocking just play along
    76             }
     70        for(TIMES) {
     71                io_future_t f;
     72                if ( do_read ) {
     73                        async_read(f, globals.pipe[0], thrash, 1, 0);
     74                } else {
     75                        fulfil(f, 0); // If we don't have user-level blocking just play along
     76                }
    7777
    78             block( globals.bar );
     78                block( globals.bar );
    7979
    8080                yield( prng( this, 15 ) );
    8181
    82             unsigned i = __atomic_add_fetch( &counter, 1, __ATOMIC_SEQ_CST );
     82                unsigned i = __atomic_add_fetch( &counter, 1, __ATOMIC_SEQ_CST );
    8383                if(0 == (i % 100)) sout | i;
    8484
    85             wait( f );
     85                wait( f );
    8686
    87             if(f.result < 0)
    88                   abort | "Read error" | -f.result | ":" | strerror(-f.result);
     87                if(f.result < 0)
     88                        abort | "Read error" | -f.result | ":" | strerror(-f.result);
    8989
    90             block( globals.bar );
    91       }
     90                block( globals.bar );
     91        }
    9292}
    9393
     
    9797thread Writer {};
    9898void main(Writer & this) {
    99       for(TIMES) {
    100             block( globals.bar );
     99        for(TIMES) {
     100                block( globals.bar );
    101101
    102             sleep( 1`us );
     102                sleep( 1`us );
    103103
    104             char buf[1] = { '+' };
    105             int ret = write( globals.pipe[1], buf, 1 );
    106             if(ret < 0)
    107                   abort | "Write error" | errno | ":" | strerror(errno);
     104                char buf[1] = { '+' };
     105                int ret = write( globals.pipe[1], buf, 1 );
     106                if(ret < 0)
     107                        abort | "Write error" | errno | ":" | strerror(errno);
    108108
    109             block( globals.bar );
    110       }
     109                block( globals.bar );
     110        }
    111111}
    112112
     
    122122
    123123int main() {
    124       barrier bar = { 2 };
    125       &globals.bar = &bar;
    126       int ret = pipe(globals.pipe);
    127       if(ret != 0)
    128             abort | "Pipe error" | errno | ":" | strerror(errno);
     124        barrier bar = { 2 };
     125        &globals.bar = &bar;
     126        int ret = pipe(globals.pipe);
     127        if(ret != 0)
     128                abort | "Pipe error" | errno | ":" | strerror(errno);
    129129
    130130        processor p;
     
    134134                Spinner s;
    135135                Reader ior;
    136             Writer iow;
     136                Writer iow;
    137137        }
    138138        sout | "done";
  • tests/loop_else.cfa

    r428adbc r7f6a7c9  
    2020
    2121int main() {
    22     sout | nlOff;                                                                               // turn off auto newline
    23         while () { sout | "empty"; break; } else { sout | "else"; }                                         sout | nl;
    24         do { sout | "empty"; break; } while () else { sout | "else"; }                              sout | nl;
    25         for () { sout | "empty"; break; } else { sout | "else"; }                                           sout | nl | nl;
     22        // Test some loop options.
    2623
    27     do { sout | "false"; } while (false) else { sout | "else"; }                                    sout | nl | nl;
     24        sout | nlOff;                                                                           // turn off auto newline
     25        while () { sout | "empty"; break; } else { sout | "else"; }                                             sout | nl;
     26        do { sout | "empty"; break; } while () else { sout | "else"; }                                  sout | nl;
     27        for () { sout | "empty"; break; } else { sout | "else"; }                                               sout | nl | nl;
    2828
    29         for ( 0 ) { sout | "A"; } else { sout | "else"; }                                                   sout | "zero" | nl;
     29        do { sout | "false"; } while (false) else { sout | "else"; }                                    sout | nl | nl;
     30
     31        for ( 0 ) { sout | "A"; } else { sout | "else"; }                                                               sout | "zero" | nl;
    3032        for ( 1 ) { sout | "A"; } else { sout | "else"; }                                                               sout | nl;
    31         for ( 10 ) { sout | "A"; } else { sout | "else"; }                                                          sout | nl;
    32         for ( = 10 ) { sout | "A"; } else { sout | "else"; }                                                    sout | nl;
     33        for ( 10 ) { sout | "A"; } else { sout | "else"; }                                                              sout | nl;
     34        for ( ~= 10 ) { sout | "A"; } else { sout | "else"; }                                                   sout | nl;
    3335        for ( 1 ~= 10 ~ 2 ) { sout | "B"; } else { sout | "else"; }                                             sout | nl;
    34         for ( 10 -~= 1 ~ 2 ) { sout | "C"; } else { sout | "else"; }                                    sout | nl;
     36        for ( 1 -~= 10 ~ 2 ) { sout | "C"; } else { sout | "else"; }                                    sout | nl;
    3537        for ( 0.5 ~ 5.5 ) { sout | "D"; } else { sout | "else"; }                                               sout | nl;
    36         for ( 5.5 -~ 0.5 ) { sout | "E"; } else { sout | "else"; }                                              sout | nl | nl;
     38        for ( 0.5 -~ 5.5 ) { sout | "E"; } else { sout | "else"; }                                              sout | nl | nl;
    3739
    3840        for ( i; 10 ) { sout | i; } else { sout | "else"; }                                                             sout | nl;
    39         for ( i; = 10 ) { sout | i; } else { sout | "else"; }                                                   sout | nl;
     41        for ( i; ~= 10 ) { sout | i; } else { sout | "else"; }                                                  sout | nl;
    4042        for ( i; 1 ~= 10 ~ 2 ) { sout | i; } else { sout | "else"; }                                    sout | nl;
    41         for ( i; 10 -~= 1 ~ 2 ) { sout | i; } else { sout | "else"; }                                   sout | nl;
     43        for ( i; 1 -~= 10 ~ 2 ) { sout | i; } else { sout | "else"; }                                   sout | nl;
    4244        for ( i; 0.5 ~ 5.5 ) { sout | i; } else { sout | "else"; }                                              sout | nl;
    43         for ( i; 5.5 -~ 0.5 ) { sout | i; } else { sout | "else"; }                                             sout | nl;
     45        for ( i; 0.5 -~ 5.5 ) { sout | i; } else { sout | "else"; }                                             sout | nl;
    4446        for ( ui; 2u ~= 10u ~ 2u ) { sout | ui; } else { sout | "else"; }                               sout | nl;
    45         for ( ui; 10u -~= 2u ~ 2u ) { sout | ui; } else { sout | "else"; }                              sout | nl | nl;
     47        for ( ui; 2u -~= 10u ~ 2u ) { sout | ui; } else { sout | "else"; }                              sout | nl | nl;
    4648
    4749        // @ means do nothing
     
    5052                sout | i;
    5153        } else { sout | "else"; }                                                                                                               sout | nl;
    52         for ( i; 10 -~ @ ) {
     54        for ( i; @ -~ 10 ) {
    5355          if ( i < 0 ) break;
    5456                sout | i;
     
    6365                i += 1.7;
    6466        } else { sout | "else"; }                                                                                                               sout | nl;
    65         for ( i; 10 -~ @ ~ 2 ) {
     67        for ( i; @ -~ 10 ~ 2 ) {
    6668          if ( i < 0 ) break;
    6769                sout | i;
     
    7678        for ( N ) { sout | "N"; } else { sout | "else"; }                                                       sout | nl;
    7779        for ( i; N ) { sout | i; } else { sout | "else"; }                                                      sout | nl;
    78         for ( i; = N ) { sout | i; } else { sout | "else"; }                                            sout | nl;
    79         for ( i; N -~ 0 ) { sout | i; } else { sout | "else"; }                                         sout | nl | nl;
     80        for ( i; ~= N ) { sout | i; } else { sout | "else"; }                                           sout | nl;
     81        for ( i; -~= N ) { sout | i; } else { sout | "else"; }                                          sout | nl | nl;
    8082
    8183        const int start = 3, comp = 10, inc = 2;
    8284        for ( i; start ~ comp ~ inc + 1 ) { sout | i; } else { sout | "else"; }         sout | nl | nl;
     85
     86        for ( i; 10 : j; -5 ~ @ ) { sout | i | j; } else { sout | "else"; } sout | nl;
     87        for ( i; 10 : j; @ -~ -5 ) { sout | i | j; } else { sout | "else"; } sout | nl;
     88        for ( i; 10 : j; -5 ~ @ ~ 2 ) { sout | i | j; } else { sout | "else"; } sout | nl;
     89        for ( i; 10 : j; @ -~ -5 ~ 2 ) { sout | i | j; } else { sout | "else"; } sout | nl | nl;
     90
     91        for ( j; -5 ~ @ : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl;
     92        for ( j; @ -~ -5 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl;
     93        for ( j; -5 ~ @ ~ 2 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl;
     94        for ( j; @ -~ -5 ~ 2 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl | nl;
     95
     96        for ( j; @ -~ -5 ~ 2 : i; 10 : k; 1.5 ~ @ ) { sout | i | j | k; } else { sout | "else"; } sout | nl;
     97        for ( j; @ -~ -5 ~ 2 : k; 1.5 ~ @ : i; 10 ) { sout | i | j | k; } else { sout | "else"; } sout | nl;
     98        for ( k; 1.5 ~ @ : j; @ -~ -5 ~ 2 : i; 10 ) { sout | i | j | k; } else { sout | "else"; } sout | nl;
    8399
    84100        for ( S s = (S){0}; s < (S){10,10}; s += (S){1} ) { sout | s; } else { sout | "else"; } sout | nl;
     
    90106        for ( s; (S){0} ~= (S){10,10} ~ (S){1} ) { sout | s; } else { sout | "else"; } sout | nl;
    91107        sout | nl;
    92         for ( s; (S){10,10} -~ (S){0} ) { sout | s; } else { sout | "else"; }            sout | nl;
    93         for ( s; (S){10,10} -~ (S){0} ~ (S){1} ) { sout | s; } else { sout | "else"; } sout | nl;
    94         for ( s; (S){10,10} -~= (S){0} ) { sout | s; } else { sout | "else"; }           sout | nl;
    95         for ( s; (S){10,10} -~= (S){0} ~ (S){1} ) { sout | s; } else { sout | "else"; } sout | nl | nl;
    96 
    97         for ( i; 10 : j; -5 ~ @ ) { sout | i | j; } else { sout | "else"; } sout | nl;
    98         for ( i; 10 : j; -5 -~ @ ) { sout | i | j; } else { sout | "else"; } sout | nl;
    99         for ( i; 10 : j; -5 ~ @ ~ 2 ) { sout | i | j; } else { sout | "else"; } sout | nl;
    100         for ( i; 10 : j; -5 -~ @ ~ 2 ) { sout | i | j; } else { sout | "else"; } sout | nl | nl;
    101 
    102         for ( j; -5 ~ @ : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl;
    103         for ( j; -5 -~ @ : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl;
    104         for ( j; -5 ~ @ ~ 2 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl;
    105         for ( j; -5 -~ @ ~ 2 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl | nl;
    106 
    107         for ( j; -5 -~ @ ~ 2 : i; 10 : k; 1.5 ~ @ ) { sout | i | j | k; } else { sout | "else"; } sout | nl;
    108         for ( j; -5 -~ @ ~ 2 : k; 1.5 ~ @ : i; 10 ) { sout | i | j | k; } else { sout | "else"; } sout | nl;
    109         for ( k; 1.5 ~ @ : j; -5 -~ @ ~ 2 : i; 10 ) { sout | i | j | k; } else { sout | "else"; } sout | nl;
     108        for ( s; (S){0} -~  (S){10,10} ) { sout | s; } else { sout | "else"; }           sout | nl;
     109        for ( s; (S){0} -~  (S){10,10} ~ (S){1} ) { sout | s; } else { sout | "else"; } sout | nl;
     110        for ( s; (S){0} -~= (S){10,10} ) { sout | s; } else { sout | "else"; }           sout | nl;
     111        for ( s; (S){0} -~= (S){10,10} ~ (S){1} ) { sout | s; } else { sout | "else"; } sout | nl | nl;
    110112}
  • tests/loopctrl.cfa

    r428adbc r7f6a7c9  
    1010// Created On       : Wed Aug  8 18:32:59 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec 12 17:55:26 2019
    13 // Update Count     : 108
     12// Last Modified On : Thu Aug 11 23:04:35 2022
     13// Update Count     : 160
    1414//
    1515
    1616#include <fstream.hfa>
     17
     18void fred() {
     19        // Test all possible loop syntax.
     20
     21        int s = 0, c = 10, i = 2;
     22
     23        for ( c ) { sout | "A"; }                                               sout | nl;
     24        for ( ~= c ) { sout | "B"; }                                    sout | nl;
     25        for ( -~ c ) { sout | "C"; }                                    sout | nl;
     26        for ( -~= c ) { sout | "D"; }                                   sout | nl;
     27
     28        for ( s ~ c ) { sout | "A"; }                                   sout | nl;
     29        for ( s ~= c ) { sout | "B"; }                                  sout | nl;
     30        for ( s -~ c ) { sout | "C"; }                                  sout | nl;
     31        for ( s -~= c ) { sout | "D"; }                                 sout | nl;
     32
     33        for ( s ~ c ~ i ) { sout | "A"; }                               sout | nl;
     34        for ( s ~= c ~ i ) { sout | "B"; }                              sout | nl;
     35        for ( s -~ c ~ i ) { sout | "C"; }                              sout | nl;
     36        for ( s -~= c ~ i ) { sout | "D"; }                             sout | nl;
     37
     38        for ( j; c ) { sout | j; }                                                      sout | nl;
     39        for ( j; ~= c ) { sout | j; }                                   sout | nl;
     40        for ( j; -~ c ) { sout | j; }                                   sout | nl;
     41        for ( j; -~= c ) { sout | j; }                                  sout | nl;
     42
     43        for ( j; s ~ c ) { sout | j; }                                  sout | nl;
     44        for ( j; s ~= c ) { sout | j; }                                 sout | nl;
     45        for ( j; s -~ c ) { sout | j; }                                 sout | nl;
     46        for ( j; s -~= c ) { sout | j; }                                sout | nl;
     47
     48        for ( j; s ~ c ~ i ) { sout | j; }                              sout | nl;
     49        for ( j; s ~= c ~ i ) { sout | j; }                             sout | nl;
     50        for ( j; s -~ c ~ i ) { sout | j; }                             sout | nl;
     51        for ( j; s -~= c ~ i ) { sout | j; }                    sout | nl;
     52
     53        // CANNOT DIRECTLY INITIALIZE INDEX VARIABLE, ONLY SINGLE LOOP INDEX VARIABLE IN DECLARATION
     54
     55        for ( j; c ) { sout | j; }                                              sout | nl;
     56        for ( int j; c ) { sout | j; }                                  sout | nl;
     57        for ( int j; ~= c ) { sout | j; }                               sout | nl;
     58        for ( int j; -~ c ) { sout | j; }                               sout | nl;
     59        for ( int j; -~= c ) { sout | j; }                              sout | nl;
     60
     61        for ( int j; s ~ c ) { sout | j; }                              sout | nl;
     62        for ( int j; s ~= c ) { sout | j; }                             sout | nl;
     63        for ( int j; s -~ c ) { sout | j; }                             sout | nl;
     64        for ( int j; s -~= c ) { sout | j; }                    sout | nl;
     65
     66        for ( int j; s ~ c ~ i ) { sout | j; }                  sout | nl;
     67        for ( int j; s ~= c ~ i ) { sout | j; }                 sout | nl;
     68        for ( int j; s -~ c ~ i ) { sout | j; }                 sout | nl;
     69        for ( int j; s -~= c ~ i ) { sout | j; }                sout | nl;
     70
     71        for ( j; s ~ @ ) { if ( j == 10 ) break; sout | j; }                            sout | nl;
     72        for ( j; @ -~ s ) { if ( j == -10 ) break; sout | j; }                          sout | nl;
     73        for ( j; s ~ @ ~ i ) { if ( j == 10 ) break; sout | j; }                        sout | nl;
     74        for ( j; @ -~ s ~ i ) { if ( j == -10 ) break; sout | j; }                      sout | nl;
     75        for ( j; s ~ @ ~ @ ) { if ( j == 10 ) break; sout | j; j += 1; }        sout | nl;
     76
     77        for ( int j; s ~ @ ) { if ( j == 10 ) break; sout | j; j += 1; }        sout | nl;
     78        for ( int j; @ -~ s ) { if ( j == -10 ) break; sout | j; j -= 1; }      sout | nl;
     79        for ( int j; s ~ @ ~ i ) { if ( j == 10 ) break; sout | j; }            sout | nl;
     80        for ( int j; @ -~ s ~ i ) { if ( j == -10 ) break; sout | j; }          sout | nl;
     81        for ( int j; s ~ @ ~ @ ) { if ( j == 10 ) break; sout | j; j += 1; } sout | nl;
     82
     83        // enum E { A, B, C, D };
     84        // for ( e; A ~= C ) { sout | j; }
     85        // for ( e; A ~= D ) { sout | j; }
     86        // for ( e; A -~= D ~ 2 ) { sout | j; }
     87        // for ( e; E ) { sout | j; }
     88        // for ( e; -~ E ) { sout | j; }
     89}
    1790
    1891struct S { int i, j; };
     
    35108
    36109int main() {
     110        // Test some loop options.
     111
    37112        sout | nlOff;                                                                           // turn off auto newline
    38113        while () { sout | "empty"; break; }                                     sout | nl;
     
    43118        for ( 1 ) { sout | "A"; }                                                       sout | nl;
    44119        for ( 10 ) { sout | "A"; }                                                      sout | nl;
    45         for ( = 10 ) { sout | "A"; }                                            sout | nl;
     120        for ( ~= 10 ) { sout | "A"; }                                           sout | nl;
    46121        for ( 1 ~= 10 ~ 2 ) { sout | "B"; }                                     sout | nl;
    47         for ( 10 -~= 1 ~ 2 ) { sout | "C"; }                            sout | nl;
     122        for ( 1 -~= 10 ~ 2 ) { sout | "C"; }                            sout | nl;
    48123        for ( 0.5 ~ 5.5 ) { sout | "D"; }                                       sout | nl;
    49         for ( 5.5 -~ 0.5 ) { sout | "E"; }                                      sout | nl | nl;
     124        for ( 0.5 -~ 5.5 ) { sout | "E"; }                                      sout | nl | nl;
    50125
    51126        for ( i; 10 ) { sout | i; }                                                     sout | nl;
    52         for ( i; = 10 ) { sout | i; }                                           sout | nl;
     127        for ( i; ~= 10 ) { sout | i; }                                          sout | nl;
    53128        for ( i; 1 ~= 10 ~ 2 ) { sout | i; }                            sout | nl;
    54         for ( i; 10 -~= 1 ~ 2 ) { sout | i; }                           sout | nl;
     129        for ( i; 1 -~= 10 ~ 2 ) { sout | i; }                           sout | nl;
    55130        for ( i; 0.5 ~ 5.5 ) { sout | i; }                                      sout | nl;
    56         for ( i; 5.5 -~ 0.5 ) { sout | i; }                                     sout | nl;
     131        for ( i; 0.5 -~ 5.5 ) { sout | i; }                                     sout | nl;
    57132        for ( ui; 2u ~= 10u ~ 2u ) { sout | ui; }                       sout | nl;
    58         for ( ui; 10u -~= 2u ~ 2u ) { sout | ui; }                      sout | nl | nl;
     133        for ( ui; 2u -~= 10u ~ 2u ) { sout | ui; }                      sout | nl | nl;
    59134
    60135        // @ means do nothing
     
    63138                sout | i;
    64139        }                                                                                                       sout | nl;
    65         for ( i; 10 -~ @ ) {
     140        for ( i; @ -~ 10 ) {
    66141          if ( i < 0 ) break;
    67142                sout | i;
     
    76151                i += 1.7;
    77152        }                                                                                                       sout | nl;
    78         for ( i; 10 -~ @ ~ 2 ) {
     153        for ( i; @ -~ 10 ~ 2 ) {
    79154          if ( i < 0 ) break;
    80155                sout | i;
     
    89164        for ( N ) { sout | "N"; }                                                       sout | nl;
    90165        for ( i; N ) { sout | i; }                                                      sout | nl;
    91         for ( i; = N ) { sout | i; }                                            sout | nl;
    92         for ( i; N -~ 0 ) { sout | i; }                                         sout | nl | nl;
     166        for ( i; ~= N ) { sout | i; }                                           sout | nl;
     167        for ( i; -~= N ) { sout | i; }                                          sout | nl | nl;
    93168
    94169        const int start = 3, comp = 10, inc = 2;
    95170        for ( i; start ~ comp ~ inc + 1 ) { sout | i; }         sout | nl | nl;
     171
     172        for ( i; 10 : j; -5 ~ @ ) { sout | i | j; } sout | nl;
     173        for ( i; 10 : j; @ -~ -5 ) { sout | i | j; } sout | nl;
     174        for ( i; 10 : j; -5 ~ @ ~ 2 ) { sout | i | j; } sout | nl;
     175        for ( i; 10 : j; @ -~ -5 ~ 2 ) { sout | i | j; } sout | nl | nl;
     176
     177        for ( j; -5 ~ @ : i; 10 ) { sout | i | j; } sout | nl;
     178        for ( j; @ -~ -5 : i; 10 ) { sout | i | j; } sout | nl;
     179        for ( j; -5 ~ @ ~ 2 : i; 10 ) { sout | i | j; } sout | nl;
     180        for ( j; @ -~ -5 ~ 2 : i; 10 ) { sout | i | j; } sout | nl | nl;
     181
     182        for ( j; @ -~ -5 ~ 2 : i; 10 : k; 1.5 ~ @ ) { sout | i | j | k; } sout | nl;
     183        for ( j; @ -~ -5 ~ 2 : k; 1.5 ~ @ : i; 10 ) { sout | i | j | k; } sout | nl;
     184        for ( k; 1.5 ~ @ : j; @ -~ -5 ~ 2 : i; 10 ) { sout | i | j | k; } sout | nl;
    96185
    97186        for ( S s = (S){0}; s < (S){10,10}; s += (S){1} ) { sout | s; } sout | nl;
     
    103192        for ( s; (S){0} ~= (S){10,10} ~ (S){1} ) { sout | s; } sout | nl;
    104193        sout | nl;
    105         for ( s; (S){10,10} -~ (S){0} ) { sout | s; }            sout | nl;
    106         for ( s; (S){10,10} -~ (S){0} ~ (S){1} ) { sout | s; } sout | nl;
    107         for ( s; (S){10,10} -~= (S){0} ) { sout | s; }           sout | nl;
    108         for ( s; (S){10,10} -~= (S){0} ~ (S){1} ) { sout | s; } sout | nl | nl;
    109 
    110         for ( i; 10 : j; -5 ~ @ ) { sout | i | j; } sout | nl;
    111         for ( i; 10 : j; -5 -~ @ ) { sout | i | j; } sout | nl;
    112         for ( i; 10 : j; -5 ~ @ ~ 2 ) { sout | i | j; } sout | nl;
    113         for ( i; 10 : j; -5 -~ @ ~ 2 ) { sout | i | j; } sout | nl | nl;
    114 
    115         for ( j; -5 ~ @ : i; 10 ) { sout | i | j; } sout | nl;
    116         for ( j; -5 -~ @ : i; 10 ) { sout | i | j; } sout | nl;
    117         for ( j; -5 ~ @ ~ 2 : i; 10 ) { sout | i | j; } sout | nl;
    118         for ( j; -5 -~ @ ~ 2 : i; 10 ) { sout | i | j; } sout | nl | nl;
    119 
    120         for ( j; -5 -~ @ ~ 2 : i; 10 : k; 1.5 ~ @ ) { sout | i | j | k; } sout | nl;
    121         for ( j; -5 -~ @ ~ 2 : k; 1.5 ~ @ : i; 10 ) { sout | i | j | k; } sout | nl;
    122         for ( k; 1.5 ~ @ : j; -5 -~ @ ~ 2 : i; 10 ) { sout | i | j | k; } sout | nl;
     194        for ( s; (S){0} -~  (S){10,10} ) { sout | s; }           sout | nl;
     195        for ( s; (S){0} -~  (S){10,10} ~ (S){1} ) { sout | s; } sout | nl;
     196        for ( s; (S){0} -~= (S){10,10} ) { sout | s; }           sout | nl;
     197        for ( s; (S){0} -~= (S){10,10} ~ (S){1} ) { sout | s; } sout | nl | nl;
     198
     199        fred();
    123200}
    124201
  • tests/meta/.expect/arch.arm64.txt

    r428adbc r7f6a7c9  
    1 meta/archVast.cfa:28:1 error: Cannot choose between 3 alternatives for expression
     1meta/arch.cfa:28:1 error: Cannot choose between 3 alternatives for expression
    22Explicit Cast of:
    33  Name: FA64
  • tests/meta/.expect/arch.x64.txt

    r428adbc r7f6a7c9  
    1 meta/archVast.cfa:28:1 error: Cannot choose between 3 alternatives for expression
     1meta/arch.cfa:28:1 error: Cannot choose between 3 alternatives for expression
    22Explicit Cast of:
    33  Name: FX64
  • tests/meta/.expect/arch.x86.txt

    r428adbc r7f6a7c9  
    1 meta/archVast.cfa:28:1 error: Cannot choose between 3 alternatives for expression
     1meta/arch.cfa:28:1 error: Cannot choose between 3 alternatives for expression
    22Explicit Cast of:
    33  Name: FX86
  • tests/meta/arch.cfa

    r428adbc r7f6a7c9  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // archVast.cfa -- Check if all combinations are of ast/arch are properly distinguished
     7// arch.cfa -- Check if all architectures are properly distinguished by the test suite
    88//
    99// Author           : Thierry Delisle
  • tests/pybin/settings.py

    r428adbc r7f6a7c9  
    9797                self.path   = "debug" if value else "nodebug"
    9898
    99 class AST:
    100         def __init__(self, ast):
    101                 if ast == "new":
    102                         self.target = ast
    103                         self.string = "New AST"
    104                         self.flags  = """AST_FLAGS=-XCFA,--new-ast"""
    105                 elif ast == "old":
    106                         self.target = ast
    107                         self.string = "Old AST"
    108                         self.flags  = """AST_FLAGS=-XCFA,--old-ast"""
    109                 elif ast == None:
    110                         self.target = "new" if config.NEWAST else "old"
    111                         self.string = "Default AST (%s)" % self.target
    112                         self.flags  = """AST_FLAGS="""
    113                 else:
    114                         print("""ERROR: Invalid ast configuration, must be "old", "new" or left unspecified, was %s""" % (value), file=sys.stderr)
    115                         sys.exit(1)
    116 
    117         def filter(self, tests):
    118 
    119                 return [test for test in tests if not test.astv or self.target == test.astv]
    120 
    12199class Install:
    122100        def __init__(self, value):
     
    141119
    142120def init( options ):
    143         global all_ast
    144121        global all_arch
    145122        global all_debug
    146123        global all_install
    147         global ast
    148124        global arch
    149125        global debug
     
    160136        global timeout2gdb
    161137
    162         all_ast      = [AST(o)          for o in list(dict.fromkeys(options.ast    ))] if options.ast  else [AST(None)]
    163138        all_arch     = [Architecture(o) for o in list(dict.fromkeys(options.arch   ))] if options.arch else [Architecture(None)]
    164139        all_debug    = [Debug(o)        for o in list(dict.fromkeys(options.debug  ))]
  • tests/pybin/test_run.py

    r428adbc r7f6a7c9  
    1111                self.path = ''
    1212                self.arch = ''
    13                 self.astv = ''
    1413
    1514        def toString(self):
    16                 return "{:25s} ({:5s} arch, {:s} ast: {:s})".format( self.name, self.arch if self.arch else "Any", self.astv if self.astv else "Any", self.target() )
     15                return "{:25s} ({:5s} arch: {:s})".format( self.name, self.arch if self.arch else "Any", self.target() )
    1716
    1817        def prepare(self):
     
    2221        def expect(self):
    2322                arch = '' if not self.arch else ".%s" % self.arch
    24                 astv = '' if not self.astv else ".nast" if self.astv == "new" else ".oast"
    25                 return os.path.normpath( os.path.join(settings.SRCDIR  , self.path, ".expect", "%s%s%s.txt" % (self.name,astv,arch)) )
     23                return os.path.normpath( os.path.join(settings.SRCDIR  , self.path, ".expect", "%s%s.txt" % (self.name,arch)) )
    2624
    2725        def error_log(self):
     
    5856
    5957        @staticmethod
    60         def new_target(target, arch, astv):
     58        def new_target(target, arch):
    6159                test = Test()
    6260                test.name = os.path.basename(target)
    6361                test.path = os.path.relpath (os.path.dirname(target), settings.SRCDIR)
    6462                test.arch = arch.target if arch else ''
    65                 test.astv = astv.target if astv else ''
    6663                return test
    6764
  • tests/pybin/tools.py

    r428adbc r7f6a7c9  
    182182                '-s' if silent else None,
    183183                test_param,
    184                 settings.ast.flags,
    185184                settings.arch.flags,
    186185                settings.debug.flags,
  • tests/quotedKeyword.cfa

    r428adbc r7f6a7c9  
    3131        ``__int128, ``__label__, ``long, ``lvalue, ``_Noreturn, ``__builtin_offsetof, ``otype, ``register, ``restrict,
    3232        ``__restrict, ``__restrict__, ``return, ``short, ``signed, ``__signed, ``__signed__, ``sizeof, ``static,
    33         ``_Static_assert, ``struct, ``switch, ``_Thread_local, ``throw, ``throwResume, ``trait, ``try, ``typedef,
     33        ``_Static_assert, ``struct, ``switch, ``_thread, ``_Thread_local, ``throw, ``throwResume, ``trait, ``try, ``typedef,
    3434        ``typeof, ``__typeof, ``__typeof__, ``union, ``unsigned, ``__builtin_va_list, ``void, ``volatile, ``__volatile,
    3535        ``__volatile__, ``while;
  • tests/test.py

    r428adbc r7f6a7c9  
    2323
    2424        def match_test(path):
    25                 match = re.search("^%s\/([\w\/\-_]*).expect\/([\w\-_]+)(\.nast|\.oast)?(\.[\w\-_]+)?\.txt$" % settings.SRCDIR, path)
     25                match = re.search("^%s\/([\w\/\-_]*).expect\/([\w\-_]+)(\.[\w\-_]+)?\.txt$" % settings.SRCDIR, path)
    2626                if match :
    2727                        test = Test()
    2828                        test.name = match.group(2)
    2929                        test.path = match.group(1)
    30                         test.arch = match.group(4)[1:] if match.group(4) else None
    31 
    32                         astv = match.group(3)[1:] if match.group(3) else None
    33                         if astv == 'oast':
    34                                 test.astv = 'old'
    35                         elif astv == 'nast':
    36                                 test.astv = 'new'
    37                         elif astv:
    38                                 print('ERROR: "%s", expect file has astv but it is not "nast" or "oast"' % testname, file=sys.stderr)
    39                                 sys.exit(1)
     30                        test.arch = match.group(3)[1:] if match.group(3) else None
    4031
    4132                        expected.append(test)
     
    8172                                # this is a valid name, let's check if it already exists
    8273                                found = [test for test in all_tests if canonical_path( test.target() ) == testname]
    83                                 setup = itertools.product(settings.all_arch if options.arch else [None], settings.all_ast if options.ast else [None])
     74                                setup = itertools.product(settings.all_arch if options.arch else [None])
    8475                                if not found:
    85                                         # it's a new name, create it according to the name and specified architecture/ast version
    86                                         tests.extend( [Test.new_target(testname, arch, ast) for arch, ast in setup] )
     76                                        # it's a new name, create it according to the name and specified architecture
     77                                        tests.extend( [Test.new_target(testname, arch) for arch in setup] )
    8778                                elif len(found) == 1 and not found[0].arch:
    8879                                        # we found a single test, the user better be wanting to create a cross platform test
    8980                                        if options.arch:
    9081                                                print('ERROR: "%s", test has no specified architecture but --arch was specified, ignoring it' % testname, file=sys.stderr)
    91                                         elif options.ast:
    92                                                 print('ERROR: "%s", test has no specified ast version but --ast was specified, ignoring it' % testname, file=sys.stderr)
    9382                                        else:
    9483                                                tests.append( found[0] )
    9584                                else:
    9685                                        # this test is already cross platform, just add a test for each platform the user asked
    97                                         tests.extend( [Test.new_target(testname, arch, ast) for arch, ast in setup] )
     86                                        tests.extend( [Test.new_target(testname, arch) for arch in setup] )
    9887
    9988                                        # print a warning if it users didn't ask for a specific architecture
     
    10291                                                print('WARNING: "%s", test has architecture specific expected files but --arch was not specified, regenerating only for current host' % testname, file=sys.stderr)
    10392
    104 
    105                                         # print a warning if it users didn't ask for a specific ast version
    106                                         found_astv = [f.astv for f in found if f.astv]
    107                                         if found_astv and not options.ast:
    108                                                 print('WARNING: "%s", test has ast version specific expected files but --ast was not specified, regenerating only for current ast' % testname, file=sys.stderr)
    109 
    11093                        else :
    11194                                print('ERROR: "%s", tests are not allowed to end with a C/C++/CFA extension, ignoring it' % testname, file=sys.stderr)
     
    127110        # create a parser with the arguments for the tests script
    128111        parser = argparse.ArgumentParser(description='Script which runs cforall tests')
    129         parser.add_argument('--ast', help='Test for specific ast', type=comma_separated(str), default=None)
    130112        parser.add_argument('--arch', help='Test for specific architecture', type=comma_separated(str), default=None)
    131113        parser.add_argument('--debug', help='Run all tests in debug or release', type=comma_separated(yes_no), default='yes')
     
    351333
    352334                # print the possible options
    353                 print("-h --help --debug --dry-run --list --ast=new --ast=old --arch --all --regenerate-expected --archive-errors --install --timeout --global-timeout --timeout-with-gdb -j --jobs -I --include -E --exclude --continue ", end='')
     335                print("-h --help --debug --dry-run --list --arch --all --regenerate-expected --archive-errors --install --timeout --global-timeout --timeout-with-gdb -j --jobs -I --include -E --exclude --continue ", end='')
    354336                print(" ".join(map(lambda t: "%s" % (t.target()), tests)))
    355337
     
    422404        # for each build configurations, run the test
    423405        with Timed() as total_dur:
    424                 for ast, arch, debug, install in itertools.product(settings.all_ast, settings.all_arch, settings.all_debug, settings.all_install):
    425                         settings.ast     = ast
     406                for arch, debug, install in itertools.product(settings.all_arch, settings.all_debug, settings.all_install):
    426407                        settings.arch    = arch
    427408                        settings.debug   = debug
     
    430411                        # filter out the tests for a different architecture
    431412                        # tests are the same across debug/install
    432                         local_tests = settings.ast.filter( tests )
    433                         local_tests = settings.arch.filter( local_tests )
     413                        local_tests = settings.arch.filter( tests )
    434414
    435415                        # check the build configuration works
     
    438418
    439419                        # print configuration
    440                         print('%s %i tests on %i cores (%s:%s - %s)' % (
     420                        print('%s %i tests on %i cores (%s - %s)' % (
    441421                                'Regenerating' if settings.generating else 'Running',
    442422                                len(local_tests),
    443423                                jobs,
    444                                 settings.ast.string,
    445424                                settings.arch.string,
    446425                                settings.debug.string
Note: See TracChangeset for help on using the changeset viewer.