Changeset bcd74f3 for tests


Ignore:
Timestamp:
May 8, 2020, 4:44:53 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
5c9b20c
Parents:
e3bc51c (diff), 0e7e3c17 (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 new-ast

Location:
tests
Files:
14 added
4 deleted
20 edited

Legend:

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

    re3bc51c rbcd74f3  
    3535CFA realloc array alloc, fill
    36360xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede
    37 CFA realloc array alloc, 5
    38 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede
    39 CFA realloc array alloc, 5
    40 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef
    41 CFA realloc array alloc, 5
    42 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
    4337
    4438C   memalign 42 42.5
  • tests/Makefile.am

    re3bc51c rbcd74f3  
    4141        -quiet @CFA_FLAGS@ \
    4242        -DIN_DIR="${abs_srcdir}/.in/"
     43
     44AM_CFAFLAGS = -XCFA --deterministic-out
    4345
    4446# get the desired cfa to test
  • tests/Makefile.in

    re3bc51c rbcd74f3  
    408408        -DIN_DIR="${abs_srcdir}/.in/"
    409409
     410AM_CFAFLAGS = -XCFA --deterministic-out
    410411
    411412# get the desired cfa to test
  • tests/alloc.cfa

    re3bc51c rbcd74f3  
    1010// Created On       : Wed Feb  3 07:56:22 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Apr  1 10:58:35 2020
    13 // Update Count     : 424
     12// Last Modified On : Mon Apr  6 21:08:23 2020
     13// Update Count     : 428
    1414//
    1515
     
    151151        ip = alloc_set( ip, 3 * dim, fill );                            // CFA realloc array alloc, fill
    152152        printf( "CFA realloc array alloc, fill\n" );
    153         for ( i; 3 * dim ) { printf( "%#x ", ip[i] );; }
    154         printf( "\n" );
    155         // do not free
    156 
    157         ip = alloc_set( ip, 3 * dim, 5 );                                       // CFA realloc array alloc, 5
     153        for ( i; 3 * dim ) { printf( "%#x ", ip[i] ); }
     154        printf( "\n" );
     155        // do not free
     156#if 0 // FIX ME
     157        ip = alloc_set( ip, 5 * dim, 5 );                                       // CFA realloc array alloc, 5
    158158        printf( "CFA realloc array alloc, 5\n" );
    159         for ( i; 3 * dim ) { printf( "%#x ", ip[i] ); }
     159        for ( i; 5 * dim ) { printf( "%#x ", ip[i] ); }
    160160        printf( "\n" );
    161161        // do not free
     
    167167        // do not free
    168168
    169         ip = alloc_set( ip, 3 * dim, 5 );                                       // CFA realloc array alloc, 5
     169        ip = alloc_set( ip, 5 * dim, 5 );                                       // CFA realloc array alloc, 5
    170170        printf( "CFA realloc array alloc, 5\n" );
    171         for ( i; 3 * dim ) { printf( "%#x ", ip[i] );; }
    172         printf( "\n" );
    173         free( ip );
    174 
     171        for ( i; 5 * dim ) { printf( "%#x ", ip[i] ); }
     172        printf( "\n" );
     173#endif // 0
     174        free( ip );
    175175
    176176        // resize, non-array types
  • tests/concurrent/.expect/monitor.txt

    re3bc51c rbcd74f3  
    1 4000000
     13000000
  • tests/concurrent/monitor.cfa

    re3bc51c rbcd74f3  
    2929
    3030void main( MyThread & this ) {
    31         for(int i = 0; i < 1_000_000; i++) {
     31        for(int i = 0; i < 750_000; i++) {
    3232                increment( global );
    3333        }
  • tests/errors/.expect/completeType.txt

    re3bc51c rbcd74f3  
    2727    void
    2828  )
    29   Environment:( _85_4_DT ) -> instance of struct A with body 0 (no widening)
     29  Environment: -> instance of struct A with body 0 (no widening)
    3030
    3131
     
    5050    void
    5151  )
    52   Environment:( _85_4_DT ) -> instance of struct B with body 1 (no widening)
     52  Environment: -> instance of struct B with body 1 (no widening)
    5353
    5454
     
    127127          void
    128128        )
    129         Environment:( _104_0_T ) -> instance of type T (not function type) (no widening)
     129        Environment: -> instance of type T (not function type) (no widening)
    130130
    131131      Could not satisfy assertion:
  • tests/exceptions/.expect/interact.txt

    re3bc51c rbcd74f3  
    1414resumption catch, will terminate
    1515inner termination catch
     16
     17throwing resume moon
     18resumption moon catch, will terminate
     19termination catch
     20throwing resume star
     21resumption star catch
  • tests/exceptions/.expect/resume.txt

    re3bc51c rbcd74f3  
    2525caught second exception
    2626recaught first exception
     27
     28inner catch
     29inner catch
     30outer catch
  • tests/exceptions/.expect/terminate.txt

    re3bc51c rbcd74f3  
    2424caught second exception
    2525recaught first exception
     26
     27inner catch
     28outer catch
  • tests/exceptions/conditional.cfa

    re3bc51c rbcd74f3  
    44// up the non-trivial exception is reasonable to do.
    55
    6 #include "except-mac.hfa"
     6#include <exception.hfa>
    77#include <stdio.h>
    88
    9 DECLARE_EXCEPT(num_error, BASE_EXCEPT,
     9VTABLE_DECLARATION(num_error)(
    1010        int (*code)(num_error *this);
    1111);
     
    3636    this.num = other.num;
    3737}
    38 void copy(num_error * this, num_error * other) {
    39         *this = *other;
    40 }
    4138void ^?{}(num_error & this) {
    4239    if( this.msg ) free( this.msg );
     
    4643}
    4744
    48 VTABLE_INSTANCE(num_error, BASE_EXCEPT, copy, ^?{},
    49         num_error_msg, num_error_code
     45VTABLE_INSTANCE(num_error)(
     46        num_error_msg,
     47        num_error_code,
    5048);
    5149
     
    5856
    5957        try {
    60                 THROW(&exc);
     58                throw &exc;
    6159        } catch (num_error * error ; 3 == error->virtual_table->code( error )) {
    6260                caught_num_error(3, error);
     
    6664
    6765        try {
    68                 THROW_RESUME(&exc);
     66                throwResume &exc;
    6967        } catchResume (num_error * error ; 3 == error->virtual_table->code( error )) {
    7068                caught_num_error(3, error);
  • tests/exceptions/finally.cfa

    re3bc51c rbcd74f3  
    11// Finally Clause Tests
    22
    3 #include "except-mac.hfa"
     3#include <exception.hfa>
    44#include "except-io.hfa"
    55
     
    1212                try {
    1313                        printf("termination throw\n");
    14                         THROW(&exc);
     14                        throw &exc;
    1515                } finally {
    1616                        loud_exit a = "termination inner finally";
     
    2828                try {
    2929                        printf("resumption throw\n");
    30                         THROW_RESUME(&exc);
     30                        throwResume &exc;
    3131                } finally {
    3232                        loud_exit a = "resumption inner finally";
  • tests/exceptions/interact.cfa

    re3bc51c rbcd74f3  
    11// Testing Interactions Between Termination and Resumption
    22
    3 #include "except-mac.hfa"
     3#include <exception.hfa>
    44#include "except-io.hfa"
    55
     
    1010        // Resume falls back to terminate.
    1111        try {
    12                 THROW_RESUME(&(star){});
     12                throwResume &(star){};
    1313        } catch (star *) {
    1414                printf("caught as termination\n");
     
    1717        try {
    1818                loud_region a = "try block with resume throw";
    19                 THROW_RESUME(&(star){});
     19                throwResume &(star){};
    2020        } catch (star *) {
    2121                printf("caught as termination\n");
     
    2929        try {
    3030                try {
    31                         THROW(&(star){});
     31                        throw &(star){};
    3232                } catchResume (star *) {
    3333                        printf("resume catch on terminate\n");
     
    4343        try {
    4444                try {
    45                         THROW_RESUME(&(star){});
     45                        throwResume &(star){};
    4646                } catch (star *) {
    4747                        printf("terminate catch on resume\n");
     
    5858                try {
    5959                        try {
    60                                 THROW(&(star){});
     60                                throw &(star){};
    6161                        } catchResume (star *) {
    6262                                printf("inner resume catch (error)\n");
     
    6464                } catch (star * error) {
    6565                        printf("termination catch, will resume\n");
    66                         THROW_RESUME(error);
     66                        throwResume error;
    6767                }
    6868        } catchResume (star *) {
     
    7575                try {
    7676                        try {
    77                                 THROW_RESUME(&(star){});
     77                                throwResume &(star){};
    7878                        } catch (star *) {
    7979                                printf("inner termination catch\n");
     
    8181                } catchResume (star * error) {
    8282                        printf("resumption catch, will terminate\n");
    83                         THROW(error);
     83                        throw error;
    8484                }
    8585        } catch (star *) {
    8686                printf("outer terminate catch (error)\n");
    8787        }
    88 #if 0
    8988        printf("\n");
    9089
     
    9594                                try {
    9695                                        printf("throwing resume moon\n");
    97                                         THROW_RESUME(&(moon){});
     96                                        throwResume &(moon){};
    9897                                } catch (star *) {
    9998                                        printf("termination catch\n");
    10099                                }
    101100                                printf("throwing resume star\n");
    102                                 THROW_RESUME(&(star){});
     101                                throwResume &(star){};
    103102                        } catchResume (star *) {
    104103                                printf("resumption star catch\n");
     
    106105                } catchResume (moon *) {
    107106                        printf("resumption moon catch, will terminate\n");
    108                         THROW(&(star){});
     107                        throw &(star){};
    109108                }
    110109        } catchResume (star *) {
    111110                printf("outermost catch (error)\n");
    112111        }
    113 #endif
    114112}
  • tests/exceptions/resume.cfa

    re3bc51c rbcd74f3  
    11// Resumption Exception Tests
    22
    3 #include "except-mac.hfa"
     3#include <exception.hfa>
    44#include "except-io.hfa"
    55
     
    1414                loud_exit a = "simple try clause";
    1515                printf("simple throw\n");
    16                 THROW_RESUME(&(zen){});
     16                throwResume &(zen){};
    1717                printf("end of try clause\n");
    1818        } catchResume (zen * error) {
     
    2525        try {
    2626                printf("throwing child exception\n");
    27                 THROW_RESUME(&(moment_of){});
     27                throwResume &(moment_of){};
    2828        } catchResume (zen *) {
    2929                printf("inner parent match\n");
     
    3636        try {
    3737                try {
    38                         THROW_RESUME(&(yin){});
     38                        throwResume &(yin){};
    3939                } catchResume (zen *) {
    4040                        printf("caught yin as zen\n");
     
    5252                        loud_exit a = "rethrow inner try";
    5353                        printf("rethrow inner try\n");
    54                         THROW_RESUME(&(zen){});
     54                        throwResume &(zen){};
    5555                } catchResume (zen *) {
    5656                        loud_exit a = "rethrowing catch clause";
     
    6767        try {
    6868                try {
    69                         THROW_RESUME(&(yin){});
     69                        throwResume &(yin){};
    7070                } catchResume (yin *) {
    7171                        printf("caught yin, will throw yang\n");
    72                         THROW_RESUME(&(yang){});
     72                        throwResume &(yang){};
    7373                } catchResume (yang *) {
    7474                        printf("caught exception from same try\n");
     
    8383                try {
    8484                        printf("throwing first exception\n");
    85                         THROW_RESUME(&(yin){});
     85                        throwResume &(yin){};
    8686                } catchResume (yin *) {
    8787                        printf("caught first exception\n");
    8888                        try {
    8989                                printf("throwing second exception\n");
    90                                 THROW_RESUME(&(yang){});
     90                                throwResume &(yang){};
    9191                        } catchResume (yang *) {
    9292                                printf("caught second exception\n");
     
    9999                printf("caught second exception (bad location)\n");
    100100        }
     101        printf("\n");
     102
     103        // Check successive operations.
     104        try {
     105                try {
     106                        throwResume &(zen){};
     107                        throwResume &(zen){};
     108                } catchResume (zen *) {
     109                        printf("inner catch\n");
     110                }
     111                throwResume &(zen){};
     112        } catchResume (zen *) {
     113                printf("outer catch\n");
     114        }
    101115}
  • tests/exceptions/terminate.cfa

    re3bc51c rbcd74f3  
    11// Termination Exception Tests
    22
    3 #include "except-mac.hfa"
     3#include <exception.hfa>
    44#include "except-io.hfa"
    55
     
    1414                loud_exit a = "simple try clause";
    1515                printf("simple throw\n");
    16                 THROW(&(zen){});
     16                throw &(zen){};
    1717                printf("end of try clause\n");
    1818        } catch (zen * error) {
     
    2525        try {
    2626                printf("throwing child exception\n");
    27                 THROW(&(moment_of){});
     27                throw &(moment_of){};
    2828        } catch (zen *) {
    2929                printf("inner parent match\n");
     
    3636        try {
    3737                try {
    38                         THROW(&(yin){});
     38                        throw &(yin){};
    3939                } catch (zen *) {
    4040                        printf("caught yin as zen\n");
     
    5252                        loud_exit a = "rethrow inner try";
    5353                        printf("rethrow inner try\n");
    54                         THROW(&(zen){});
     54                        throw &(zen){};
    5555                } catch (zen *) {
    5656                        loud_exit a = "rethrowing catch clause";
     
    6767        try {
    6868                try {
    69                         THROW(&(yin){});
     69                        throw &(yin){};
    7070                } catch (yin *) {
    7171                        printf("caught yin, will throw yang\n");
    72                         THROW(&(yang){});
     72                        throw &(yang){};
    7373                } catch (yang *) {
    7474                        printf("caught exception from same try\n");
     
    8383                try {
    8484                        printf("throwing first exception\n");
    85                         THROW(&(yin){});
     85                        throw &(yin){};
    8686                } catch (yin *) {
    8787                        printf("caught first exception\n");
    8888                        try {
    8989                                printf("throwing second exception\n");
    90                                 THROW(&(yang){});
     90                                throw &(yang){};
    9191                        } catch (yang *) {
    9292                                printf("caught second exception\n");
     
    9999                printf("caught second exception (bad location)\n");
    100100        }
     101        printf("\n");
     102
     103        // Check successive operations.
     104        try {
     105                try {
     106                        throw &(zen){};
     107                        throw &(zen){};
     108                } catch (zen *) {
     109                        printf("inner catch\n");
     110                }
     111                throw &(zen){};
     112        } catch (zen *) {
     113                printf("outer catch\n");
     114        }
    101115}
  • tests/manipulatorsOutput1.cfa

    re3bc51c rbcd74f3  
    77// Created On       : Sat Jun  8 18:04:11 2019
    88// Last Modified By : Peter A. Buhr
    9 // Last Modified On : Mon Jun 10 12:37:28 2019
    10 // Update Count     : 8
     9// Last Modified On : Fri May  1 11:51:44 2020
     10// Update Count     : 9
    1111//
    1212
     
    1717        signed char sc = -12;
    1818        printf( "%hhd %2hhd %5.2hhd %-5.2hhd %hho %#hho %hhx %#hhx %#8hhx %#8.10hhx %#8.3hhX %+-8.3hhd %08hhd\n", sc, sc, sc, sc, sc, sc, sc, sc, sc, sc, sc, sc, sc );
    19         sout | sc | wd(2,sc) | wd(5,2,sc) | left(wd(5,2,sc)) | nobase(oct(sc)) | oct(sc) | nobase(hex(sc)) | hex(sc) | wd(8,hex(sc)) | wd(8,10,hex(sc)) | upcase(wd(8,3,hex(sc))) | left(sign(upcase(wd(8,3,sc)))) | pad0(wd(8,sc));
     19        sout | sc | wd(2,sc) | wd(5,2,sc) | left(wd(5,2,sc)) | nobase(oct(sc)) | oct(sc) | nonl;
     20        sout | nobase(hex(sc)) | hex(sc) | wd(8,hex(sc)) | wd(8,10,hex(sc)) | upcase(wd(8,3,hex(sc))) | nonl;
     21        sout | left(sign(upcase(wd(8,3,sc)))) | pad0(wd(8,sc));
    2022
    2123        sout | "unsigned char";
    2224        unsigned char usc = 12;
    2325        printf( "%hhu %2hhu %5.2hhu %-5.2hhu %hho %#hho %hhx %#hhx %#8hhx %#8.10hhx %#8.3hhX %-8.3hhu %08hhu\n", usc, usc, usc, usc, usc, usc, usc, usc, usc, usc, usc, usc, usc );
    24         sout | usc | wd(2,usc) | wd(5,2,usc) | left(wd(5,2,usc)) | nobase(oct(usc)) | oct(usc) | nobase(hex(usc)) | hex(usc) | wd(8,hex(usc)) | wd(8,10,hex(usc)) | upcase(wd(8,3,hex(usc))) | left(upcase(wd(8,3,usc))) | pad0(wd(8,usc));
     26        sout | usc | wd(2,usc) | wd(5,2,usc) | left(wd(5,2,usc)) | nobase(oct(usc)) | oct(usc) | nonl;
     27        sout | nobase(hex(usc)) | hex(usc) | wd(8,hex(usc)) | wd(8,10,hex(usc)) | upcase(wd(8,3,hex(usc))) | nonl;
     28        sout | left(upcase(wd(8,3,usc))) | pad0(wd(8,usc));
    2529
    2630        sout | "signed short int";
    2731        signed short int si = -12;
    2832        printf( "%hd %2hd %5.2hd %-5.2hd %ho %#ho %hx %#hx %#8hx %#8.10hx %#8.3hX %+-8.3hd %08hd\n", si, si, si, si, si, si, si, si, si, si, si, si, si );
    29         sout | si | wd(2,si) | wd(5,2,si) | left(wd(5,2,si)) | nobase(oct(si)) | oct(si) | nobase(hex(si)) | hex(si) | wd(8,hex(si)) | wd(8,10,hex(si)) | upcase(wd(8,3,hex(si))) | left(sign(upcase(wd(8,3,si)))) | pad0(wd(8,si));
     33        sout | si | wd(2,si) | wd(5,2,si) | left(wd(5,2,si)) | nobase(oct(si)) | oct(si) | nonl;
     34        sout | nobase(hex(si)) | hex(si) | wd(8,hex(si)) | wd(8,10,hex(si)) | upcase(wd(8,3,hex(si))) | nonl;
     35        sout | left(sign(upcase(wd(8,3,si)))) | pad0(wd(8,si));
    3036
    3137        sout | "unsigned short int";
    3238        unsigned short int usi = 12;
    3339        printf( "%hu %2hu %5.2hu %-5.2hu %ho %#ho %hx %#hx %#8hx %#8.10hx %#8.3hX %-8.3hu %08hu\n", usi, usi, usi, usi, usi, usi, usi, usi, usi, usi, usi, usi, usi );
    34         sout | usi | wd(2,usi) | wd(5,2,usi) | left(wd(5,2,usi)) | nobase(oct(usi)) | oct(usi) | nobase(hex(usi)) | hex(usi) | wd(8,hex(usi)) | wd(8,10,hex(usi)) | upcase(wd(8,3,hex(usi))) | left(upcase(wd(8,3,usi))) | pad0(wd(8,usi));
     40        sout | usi | wd(2,usi) | wd(5,2,usi) | left(wd(5,2,usi)) | nobase(oct(usi)) | oct(usi) | nonl;
     41        sout | nobase(hex(usi)) | hex(usi) | wd(8,hex(usi)) | wd(8,10,hex(usi)) | upcase(wd(8,3,hex(usi))) | nonl;
     42        sout | left(upcase(wd(8,3,usi))) | pad0(wd(8,usi));
    3543
    3644        sout | "signed int";
    3745        signed int i = -12;
    3846        printf( "%d %2d %5.2d %-5.2d %o %#o %x %#x %#8x %#8.10x %#8.3X %+-8.3d %08d\n", i, i, i, i, i, i, i, i, i, i, i, i, i );
    39         sout | i | wd(2,i) | wd(5,2,i) | left(wd(5,2,i)) | nobase(oct(i)) | oct(i) | nobase(hex(i)) | hex(i) | wd(8,hex(i)) | wd(8,10,hex(i)) | upcase(wd(8,3,hex(i))) | left(sign(upcase(wd(8,3,i)))) | pad0(wd(8,i));
     47        sout | i | wd(2,i) | wd(5,2,i) | left(wd(5,2,i)) | nobase(oct(i)) | oct(i) | nonl;
     48        sout | nobase(hex(i)) | hex(i) | wd(8,hex(i)) | wd(8,10,hex(i)) | upcase(wd(8,3,hex(i))) | nonl;
     49        sout | left(sign(upcase(wd(8,3,i)))) | pad0(wd(8,i));
    4050
    4151        sout | "unsigned int";
    4252        unsigned int ui = 12;
    4353        printf( "%u %2u %5.2u %-5.2u %o %#o %x %#x %#8x %#8.10x %#8.3X %-8.3u %08u\n", ui, ui, ui, ui, ui, ui, ui, ui, ui, ui, ui, ui, ui );
    44         sout | ui | wd(2,ui) | wd(5,2,ui) | left(wd(5,2,ui)) | nobase(oct(ui)) | oct(ui) | nobase(hex(ui)) | hex(ui) | wd(8,hex(ui)) | wd(8,10,hex(ui)) | upcase(wd(8,3,hex(ui))) | left(upcase(wd(8,3,ui))) | pad0(wd(8,ui));
     54        sout | ui | wd(2,ui) | wd(5,2,ui) | left(wd(5,2,ui)) | nobase(oct(ui)) | oct(ui) | nonl;
     55        sout | nobase(hex(ui)) | hex(ui) | wd(8,hex(ui)) | wd(8,10,hex(ui)) | upcase(wd(8,3,hex(ui))) | nonl;
     56        sout | left(upcase(wd(8,3,ui))) | pad0(wd(8,ui));
    4557
    4658        sout | "signed long long int";
    4759        signed long long int lli = -12;
    4860        printf( "%lld %2lld %5.2lld %-5.2lld %llo %#llo %llx %#llx %#8llx %#8.10llx %#8.3llX %+-8.3lld %08lld\n", lli, lli, lli, lli, lli, lli, lli, lli, lli, lli, lli, lli, lli );
    49         sout | lli | wd(2,lli) | wd(5,2,lli) | left(wd(5,2,lli)) | nobase(oct(lli)) | oct(lli) | nobase(hex(lli)) | hex(lli) | wd(8,hex(lli)) | wd(8,10,hex(lli)) | upcase(wd(8,3,hex(lli))) | left(sign(upcase(wd(8,3,lli)))) | pad0(wd(8,lli));
     61        sout | lli | wd(2,lli) | wd(5,2,lli) | left(wd(5,2,lli)) | nobase(oct(lli)) | oct(lli) | nonl;
     62        sout | nobase(hex(lli)) | hex(lli) | wd(8,hex(lli)) | wd(8,10,hex(lli)) | upcase(wd(8,3,hex(lli))) | nonl;
     63        sout | left(sign(upcase(wd(8,3,lli)))) | pad0(wd(8,lli));
    5064
    5165        sout | "unsigned long long int";
    5266        unsigned long long int ulli = 12;
    5367        printf( "%llu %2llu %5.2llu %-5.2llu %llo %#llo %llx %#llx %#8llx %#8.10llx %#8.3llX %-8.3llu %08llu\n", ulli, ulli, ulli, ulli, ulli, ulli, ulli, ulli, ulli, ulli, ulli, ulli, ulli );
    54         sout | ulli | wd(2,ulli) | wd(5,2,ulli) | left(wd(5,2,ulli)) | nobase(oct(ulli)) | oct(ulli) | nobase(hex(ulli)) | hex(ulli) | wd(8,hex(ulli)) | wd(8,10,hex(ulli)) | upcase(wd(8,3,hex(ulli))) | left(upcase(wd(8,3,ulli))) | pad0(wd(8,ulli));
     68        sout | ulli | wd(2,ulli) | wd(5,2,ulli) | left(wd(5,2,ulli)) | nobase(oct(ulli)) | oct(ulli) | nonl;
     69        sout | nobase(hex(ulli)) | hex(ulli) | wd(8,hex(ulli)) | wd(8,10,hex(ulli)) | upcase(wd(8,3,hex(ulli))) | nonl;
     70        sout | left(upcase(wd(8,3,ulli))) | pad0(wd(8,ulli));
    5571
    5672        sout | nl | "binary integral";
    57         sout | bin(0) | bin(13) | upcase(bin(13)) | nobase(bin(13)) | left(wd(8,bin(13))) | wd(8,bin(13)) | pad0(left(wd(8,bin(13)))) | pad0(wd(8,bin(13))) | pad0(wd(8,10,bin(13))) | pad0(wd(8,6,bin(13)));
     73        sout | bin(0) | bin(13) | upcase(bin(13)) | nobase(bin(13)) | left(wd(8,bin(13))) | wd(8,bin(13)) | nonl;
     74        sout | pad0(left(wd(8,bin(13)))) | pad0(wd(8,bin(13))) | pad0(wd(8,10,bin(13))) | pad0(wd(8,6,bin(13)));
    5875
    5976
     
    6279        printf( "%g  %8g %#8g %g %8g %8.0g %#8.0g %8.2g %#8.2g %-8.2g %-8.2g %-#8.2g %-+8.2g %-+#8.2g %08.2g %8.2E %8.2a %#8.2A %#8.2e\n",
    6380                    0.0,3.0F,3.0F, f,  f,    f,     f,    f,     f,  3.0F,      f,      f,      f,       f,     f,    f,    f,     f,     f );
    64         sout | 0.0 | wd(8, 3.0F) | nodp(wd(8, 3.0F)) | f | wd(8, f) | ws(8,0, f) | nodp(ws(8,0, f)) | ws(8,2, f) | nodp(ws(8,2, f)) | left(ws(8,2, 3.0F)) | left(ws(8,2, f)) | left(nodp(ws(8,2, f))) | left(sign(ws(8,2, f))) | left(sign(nodp(ws(8,2, f)))) | pad0(ws(8,2, f)) | upcase(wd(8,2, sci(f))) | wd(8,2, hex(f)) | upcase(wd(8,2, hex(f))) | nodp(wd(8,2, sci(f)));
     81        sout | 0.0 | wd(8, 3.0F) | nodp(wd(8, 3.0F)) | f | wd(8, f) | ws(8,0, f) | nodp(ws(8,0, f)) | ws(8,2, f) | nodp(ws(8,2, f)) | nonl;
     82        sout | left(ws(8,2, 3.0F)) | left(ws(8,2, f)) | left(nodp(ws(8,2, f))) | left(sign(ws(8,2, f))) | left(sign(nodp(ws(8,2, f)))) | nonl;
     83        sout | pad0(ws(8,2, f)) | upcase(wd(8,2, sci(f))) | wd(8,2, hex(f)) | upcase(wd(8,2, hex(f))) | nodp(wd(8,2, sci(f)));
    6584
    6685        sout | "double";
     
    6887        printf( "%g  %#8f %g %8f %#8.0f %8.0f %8.2f %-8.2f %-+#8.2f %08.2F %8.2E %8.2a %8.2A %8.2e\n",
    6988                        0.0,  3.0, d,  d,     d,    d,    d,     d,       d,     d,    d,    d,    d,    d );
    70         sout | 0.0 | wd(8, 3.0) | d | wd(8, d) | nodp(wd(8,0, d)) | wd(8,0, d) | wd(8,2, d) | left(wd(8,2, d)) | left(sign(wd(8,2, d))) | pad0(upcase(wd(8,2, d))) | upcase(wd(8,2, sci(d))) | wd(8,2, hex(d)) | upcase(wd(8,2, hex(d))) | wd(8,2, sci(d));
     89        sout | 0.0 | wd(8, 3.0) | d | wd(8, d) | nodp(wd(8,0, d)) | wd(8,0, d) | wd(8,2, d) | nonl;
     90        sout | left(wd(8,2, d)) | left(sign(wd(8,2, d))) | pad0(upcase(wd(8,2, d))) | upcase(wd(8,2, sci(d))) | wd(8,2, hex(d)) | upcase(wd(8,2, hex(d))) | wd(8,2, sci(d));
    7191
    7292        sout | "long double";
     
    7494        printf( "%Lg  %#8Lf %Lg %8Lf %#8.0Lf %8.0Lf %8.2Lf %-8.2Lf %-+#8.2Lf %08.2LF %8.2LE %8.2La %8.2LA %8.2Le\n",
    7595                        0.0L,  3.0L, ld,  ld,     ld,    ld,    ld,     ld,       ld,     ld,    ld,    ld,    ld,    ld );
    76         sout | 0.0L | wd(8, 3.0L) | ld | wd(8, ld) | nodp(wd(8,0, ld)) | wd(8,0, ld) | wd(8,2, ld) | left(wd(8,2, ld)) | left(sign(wd(8,2, ld))) | pad0(upcase(wd(8,2, ld))) | upcase(wd(8,2, sci(ld))) | wd(8,2, hex(ld)) | upcase(wd(8,2, hex(ld))) | wd(8,2, sci(ld));
     96        sout | 0.0L | wd(8, 3.0L) | ld | wd(8, ld) | nodp(wd(8,0, ld)) | wd(8,0, ld) | wd(8,2, ld) | nonl;
     97        sout | left(wd(8,2, ld)) | left(sign(wd(8,2, ld))) | pad0(upcase(wd(8,2, ld))) | upcase(wd(8,2, sci(ld))) | wd(8,2, hex(ld)) | upcase(wd(8,2, hex(ld))) | wd(8,2, sci(ld));
    7798
    7899
     
    80101        char c = 'a';
    81102        printf( "%c %2c %5c %-5c %hho %#hho %hhx %#hhx %#8hhx %#8hhX %-8c %8c\n", c, c, c, c, c, c, c, c, c, c, c, c );
    82         sout | c | ' ' | wd(2,c) | wd(5,c) | left(wd(5,c)) | nobase(oct(c)) | oct(c) | nobase(hex(c)) | hex(c) | wd(8,hex(c)) | upcase(wd(8,hex(c))) | left(wd(8,c)) | wd(8,c);
     103        sout | c | ' ' | wd(2,c) | wd(5,c) | left(wd(5,c)) | nobase(oct(c)) | oct(c) | nonl;
     104        sout | nobase(hex(c)) | hex(c) | wd(8,hex(c)) | upcase(wd(8,hex(c))) | left(wd(8,c)) | wd(8,c);
    83105
    84106        sout | nl | "string";
  • tests/pybin/settings.py

    re3bc51c rbcd74f3  
    2323class Architecture:
    2424        KnownArchitectures = {
    25                 'x64'           : 'x64',
    26                 'x86-64'        : 'x64',
    27                 'x86_64'        : 'x64',
    28                 'x86'           : 'x86',
    29                 'aarch64'       : 'arm',
    30                 'i386'          : 'x86',
    31                 'i486'          : 'x86',
    32                 'i686'          : 'x86',
    33                 'Intel 80386'   : 'x86',
    34                 'arm'           : 'arm',
    35                 'ARM'           : 'arm',
     25                'x64'         : 'x64',
     26                'x86-64'      : 'x64',
     27                'x86_64'      : 'x64',
     28                'x86'         : 'x86',
     29                'aarch64'     : 'arm',
     30                'i386'        : 'x86',
     31                'i486'        : 'x86',
     32                'i686'        : 'x86',
     33                'Intel 80386' : 'x86',
     34                'arm'         : 'arm',
     35                'ARM'         : 'arm',
    3636        }
    3737
     
    8181                return True if not arch else self.target == arch
    8282
    83         @classmethod
    84         def make_canonical(_, arch):
     83        @staticmethod
     84        def make_canonical(arch):
    8585                return Architecture.KnownArchitectures[arch]
    8686
     
    105105                self.total  = Timeouts.check(tg)
    106106
    107         @classmethod
    108         def check(_, value):
     107        @staticmethod
     108        def check(value):
    109109                if value < 1:
    110110                        print("Timeouts must be at least 1 second", file=sys.stderr)
     
    129129        global timeout2gdb
    130130
    131         all_arch     = [Architecture(o) for o in list(dict.fromkeys(options.arch   ))]
     131        all_arch     = [Architecture(o) for o in list(dict.fromkeys(options.arch   ))] if options.arch else [Architecture(None)]
    132132        all_debug    = [Debug(o)        for o in list(dict.fromkeys(options.debug  ))]
    133133        all_install  = [Install(o)      for o in list(dict.fromkeys(options.install))]
  • tests/pybin/test_run.py

    re3bc51c rbcd74f3  
    4040                return os.path.normpath( os.path.join(settings.BUILDDIR, self.path, self.name) )
    4141
    42         @classmethod
    43         def valid_name(_, name):
     42        @staticmethod
     43        def valid_name(name):
    4444                return not name.endswith( ('.c', '.cc', '.cpp', '.cfa') )
    4545
    46         @classmethod
    47         def from_target(_, target):
     46        @staticmethod
     47        def new_target(target, arch):
    4848                test = Test()
    4949                test.name = os.path.basename(target)
    5050                test.path = os.path.relpath (os.path.dirname(target), settings.SRCDIR)
    51                 test.arch = settings.arch.target if settings.arch.cross_compile else ''
     51                test.arch = arch.target if arch else ''
    5252                return test
    5353
     
    7272                return text
    7373
    74         @classmethod
    75         def fmtDur( cls, duration ):
     74        @staticmethod
     75        def fmtDur( duration ):
    7676                if duration :
    7777                        hours, rem = divmod(duration, 3600)
  • tests/test.py

    re3bc51c rbcd74f3  
    6767                for testname in options.tests :
    6868                        testname = canonical_path( testname )
     69                        # first check if this is a valid name to regenerate
    6970                        if Test.valid_name(testname):
     71                                # this is a valid name, let's check if it already exists
    7072                                found = [test for test in all_tests if canonical_path( test.target() ) == testname]
    71                                 tests.append( found[0] if len(found) == 1 else Test.from_target(testname) )
     73                                if not found:
     74                                        # it's a new name, create it according to the name and specified architecture
     75                                        if options.arch:
     76                                                # user specified one or multiple architectures, assume the tests will have architecture specific results
     77                                                tests.extend( [Test.new_target(testname, arch) for arch in settings.all_arch] )
     78                                        else:
     79                                                # user didn't specify an architecture, just create a cross platform test
     80                                                tests.append( Test.new_target( testname, None ) )
     81                                elif len(found) == 1 and not found[0].arch:
     82                                        # we found a single test, the user better be wanting to create a cross platform test
     83                                        if options.arch:
     84                                                print('ERROR: "%s", test has no specified architecture but --arch was specified, ignoring it' % testname, file=sys.stderr)
     85                                        else:
     86                                                tests.append( found[0] )
     87                                else:
     88                                        # this test is already cross platform, just add a test for each platform the user asked
     89                                        tests.extend( [Test.new_target(testname, arch) for arch in settings.all_arch] )
     90
     91                                        # print a warning if it users didn't ask for a specific architecture
     92                                        if not options.arch:
     93                                                print('WARNING: "%s", test has architecture specific expected files but --arch was not specified, regenerating only for current host' % testname, file=sys.stderr)
     94
    7295                        else :
    7396                                print('ERROR: "%s", tests are not allowed to end with a C/C++/CFA extension, ignoring it' % testname, file=sys.stderr)
     
    91114        parser.add_argument('--debug', help='Run all tests in debug or release', type=comma_separated(yes_no), default='yes')
    92115        parser.add_argument('--install', help='Run all tests based on installed binaries or tree binaries', type=comma_separated(yes_no), default='no')
    93         parser.add_argument('--arch', help='Test for specific architecture', type=comma_separated(str), default='')
     116        parser.add_argument('--arch', help='Test for specific architecture', type=comma_separated(str), default=None)
    94117        parser.add_argument('--continue', help='When multiple specifications are passed (debug/install/arch), sets whether or not to continue if the last specification failed', type=yes_no, default='yes', dest='continue_')
    95118        parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=60)
     
    183206
    184207                else:
    185                         with open (out_file, "r") as myfile:
    186                                 error = myfile.read()
     208                        if os.stat(out_file).st_size < 1048576:
     209                                with open (out_file, "r") as myfile:
     210                                        error = myfile.read()
     211                        else:
     212                                error = "Output log can't be read, file is bigger than 1MB, see {} for actual error\n".format(out_file)
    187213
    188214                        ret, info = core_info(exe_file)
     
    220246                return False, ""
    221247        except Exception as ex:
    222                 print("Unexpected error in worker thread: %s" % ex, file=sys.stderr)
     248                print("Unexpected error in worker thread running {}: {}".format(t.target(), ex), file=sys.stderr)
    223249                sys.stderr.flush()
    224250                return False, ""
  • tests/vector.cfa

    re3bc51c rbcd74f3  
    1414//
    1515
     16#include <vector.hfa>
    1617#include <fstream.hfa>
    17 #include <vector.hfa>
    1818
    1919#undef assert
     
    2828int main() {
    2929        vector( int ) iv;
     30
     31        assert( ((uintptr_t)&iv.storage.storage ) == (((uintptr_t)&iv)) );
     32        assert( ((uintptr_t)&iv.storage.capacity) == (((uintptr_t)&iv) + sizeof(void *)) );
     33        assert( ((uintptr_t)&iv.size            ) == (((uintptr_t)&iv) + sizeof(void *) + sizeof(size_t)) );
    3034
    3135        assert( empty( &iv ) );
Note: See TracChangeset for help on using the changeset viewer.