Changeset a505021 for tests


Ignore:
Timestamp:
Feb 21, 2020, 3:36:36 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
c7a900a
Parents:
8c50aed (diff), c744563a (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 park_unpark

Location:
tests
Files:
11 added
3 deleted
17 edited
15 moved

Legend:

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

    r8c50aed ra505021  
    1 alloc.cfa:311:1 error: No reasonable alternatives for expression Applying untyped:
     1alloc.cfa:310:1 error: No reasonable alternatives for expression Applying untyped:
    22  Name: ?=?
    33...to:
     
    1919
    2020
    21 alloc.cfa:312:1 error: No reasonable alternatives for expression Applying untyped:
     21alloc.cfa:311:1 error: No reasonable alternatives for expression Applying untyped:
    2222  Name: ?=?
    2323...to:
     
    3939
    4040
    41 alloc.cfa:313:1 error: No reasonable alternatives for expression Applying untyped:
     41alloc.cfa:312:1 error: No reasonable alternatives for expression Applying untyped:
    4242  Name: ?=?
    4343...to:
     
    5050
    5151
    52 alloc.cfa:314:1 error: No reasonable alternatives for expression Applying untyped:
     52alloc.cfa:313:1 error: No reasonable alternatives for expression Applying untyped:
    5353  Name: ?=?
    5454...to:
  • tests/.expect/alloc.txt

    r8c50aed ra505021  
    22CFA malloc 0xdeadbeef
    33CFA alloc 0xdeadbeef
    4 CFA array alloc, fill 0xde
    54CFA alloc, fill dededede
    65CFA alloc, fill 3
  • tests/.expect/nested-types-ERR1.txt

    r8c50aed ra505021  
    1 nested-types.cfa:70:1 error: Use of undefined type T
     1nested-types.cfa:83:1 error: Use of undefined type T
  • tests/.expect/nested-types-ERR2.txt

    r8c50aed ra505021  
    1 nested-types.cfa:73:1 error: Use of undefined global type Z
    2 nested-types.cfa:74:1 error: Qualified type requires an aggregate on the left, but has: signed int
    3 nested-types.cfa:75:1 error: Undefined type in qualified type: Qualified Type:
     1nested-types.cfa:86:1 error: Use of undefined global type Z
     2nested-types.cfa:87:1 error: Qualified type requires an aggregate on the left, but has: signed int
     3nested-types.cfa:88:1 error: Undefined type in qualified type: Qualified Type:
    44  instance of struct S with body 1
    55  instance of type Z (not function type)
  • tests/.expect/rational.txt

    r8c50aed ra505021  
    11constructor
    2 3/1 4/1 0/1
     23/1 4/1 0/1 0/1 1/1
    331/2 5/7
    442/3 -3/2
  • tests/Makefile.in

    r8c50aed ra505021  
    374374am__v_GOC_0 = @echo "  GOC     " $@;
    375375am__v_GOC_1 =
     376AM_V_PY = $(am__v_PY_@AM_V@)
     377am__v_PY_ = $(am__v_PY_@AM_DEFAULT_V@)
     378am__v_PY_0 = @echo "  PYTHON  " $@;
     379am__v_PY_1 =
    376380AM_V_RUST = $(am__v_RUST_@AM_V@)
    377381am__v_RUST_ = $(am__v_RUST_@AM_DEFAULT_V@)
    378 am__v_RUST_0 = @echo "  RUST     " $@;
     382am__v_RUST_0 = @echo "  RUST    " $@;
    379383am__v_RUST_1 =
    380384AM_V_NODEJS = $(am__v_NODEJS_@AM_V@)
    381385am__v_NODEJS_ = $(am__v_NODEJS_@AM_DEFAULT_V@)
    382 am__v_NODEJS_0 = @echo "  NODEJS     " $@;
     386am__v_NODEJS_0 = @echo "  NODEJS  " $@;
    383387am__v_NODEJS_1 =
    384388AM_V_JAVAC = $(am__v_JAVAC_@AM_V@)
  • tests/alloc.cfa

    r8c50aed ra505021  
    1010// Created On       : Wed Feb  3 07:56:22 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Nov 22 15:34:19 2019
    13 // Update Count     : 404
     12// Last Modified On : Sun Feb 16 09:21:13 2020
     13// Update Count     : 405
    1414//
    1515
     
    4848
    4949        p = alloc_set( fill );                                                          // CFA alloc, fill
    50         printf( "CFA array alloc, fill %#hhx\n", fill );
    5150        printf( "CFA alloc, fill %08x\n", *p );
    5251        free( p );
  • tests/concurrent/examples/quickSort.cfa

    r8c50aed ra505021  
    1111// Created On       : Wed Dec  6 12:15:52 2017
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Thu Oct 10 13:58:18 2019
    14 // Update Count     : 176
     13// Last Modified On : Wed Feb 12 18:24:47 2020
     14// Update Count     : 177
    1515//
    1616
     
    2727
    2828void ?{}( Quicksort & qs, int values[], int size, int depth ) {
    29         qs.values = values;  qs.low = 0;  qs.high = size;  qs.depth = depth;
     29        qs.[values, low, high, depth] = [values, 0, size, depth];
    3030} // Quicksort
    3131
     
    167167                        values[counter] = size - counter;                       // descending values
    168168                } // for
    169                 for ( int i = 0; i < 200; i +=1 ) {                             // random shuffle a few values
     169                for ( i; 200 ) {                                                                // random shuffle a few values
    170170                        swap( values[rand() % size], values[rand() % size] );
    171171                } // for
  • tests/errors/.expect/completeType.txt

    r8c50aed ra505021  
    1 completeTypeError.cfa:34:1 error: Cannot choose between 2 alternatives for expression
     1errors/completeType.cfa:34:1 error: Cannot choose between 2 alternatives for expression
    22Generated Cast of:
    33  Applying untyped:
     
    5454
    5555
    56 completeTypeError.cfa:35:1 error: No reasonable alternatives for expression Applying untyped:
     56errors/completeType.cfa:35:1 error: No reasonable alternatives for expression Applying untyped:
    5757  Name: foo
    5858...to:
    5959  Name: v
    6060
    61 completeTypeError.cfa:36:1 error: No reasonable alternatives for expression Applying untyped:
     61errors/completeType.cfa:36:1 error: No reasonable alternatives for expression Applying untyped:
    6262  Name: baz
    6363...to:
    6464  Name: v
    6565
    66 completeTypeError.cfa:37:1 error: No reasonable alternatives for expression Applying untyped:
     66errors/completeType.cfa:37:1 error: No reasonable alternatives for expression Applying untyped:
    6767  Name: quux
    6868...to:
    6969  Name: v
    7070
    71 completeTypeError.cfa:59:1 error: No reasonable alternatives for expression Applying untyped:
     71errors/completeType.cfa:59:1 error: No reasonable alternatives for expression Applying untyped:
    7272  Name: baz
    7373...to:
    7474  Name: y
    7575
    76 completeTypeError.cfa:60:1 error: No reasonable alternatives for expression Applying untyped:
     76errors/completeType.cfa:60:1 error: No reasonable alternatives for expression Applying untyped:
    7777  Name: quux
    7878...to:
    7979  Name: y
    8080
    81 completeTypeError.cfa:72:1 error: No alternatives with satisfiable assertions for Applying untyped:
     81errors/completeType.cfa:72:1 error: No alternatives with satisfiable assertions for Applying untyped:
    8282  Name: baz
    8383...to:
  • tests/exceptions/except-0.cfa

    r8c50aed ra505021  
    1919};
    2020
    21 void ?{}(signal_exit * this, const char * area) {
    22         this->area = area;
    23 }
    24 
    25 void ^?{}(signal_exit * this) {
    26         printf("Exiting: %s\n", this->area);
     21void ?{}(signal_exit & this, const char * area) {
     22        this.area = area;
     23}
     24
     25void ^?{}(signal_exit & this) {
     26        printf("Exiting: %s\n", this.area);
    2727//      sout | "Exiting:" | this->area;
    2828}
     
    242242
    243243        // Uncaught termination test.
     244        /* Removed due to non-deterministic output.
    244245        printf("Throw uncaught.\n");
    245246        yang z;
    246247        terminate(&z);
    247 }
     248        */
     249}
  • tests/exceptions/except-2.cfa

    r8c50aed ra505021  
    1212        struct TABLE(BASE_EXCEPT) const * parent;
    1313        size_t size;
    14         void (*copy)(num_error *this, num_error * other);
    15         void (*free)(num_error *this);
     14        void (*copy)(num_error &this, num_error & other);
     15        void (*free)(num_error &this);
    1616        const char * (*msg)(num_error *this);
    1717        int (*code)(num_error *this);
     
    2828        if ( ! this->msg ) {
    2929                static const char * base = "Num Error with code: X";
    30                 this->msg = malloc(22);
     30                this->msg = (char *)malloc(22);
    3131                for (int i = 0 ; (this->msg[i] = base[i]) ; ++i);
    3232        }
     
    3434        return this->msg;
    3535}
    36 void ?{}(num_error * this, int num) {
    37         this->virtual_table = &INSTANCE(num_error);
    38         this->msg = 0;
    39         this->num = num;
     36void ?{}(num_error & this, int num) {
     37        this.virtual_table = &INSTANCE(num_error);
     38        this.msg = 0;
     39        this.num = num;
    4040}
    41 void ?{}(num_error * this, num_error * other) {
    42         this->virtual_table = other->virtual_table;
    43         this->msg = 0;
    44         this->num = other->num;
     41void ?{}(num_error & this, num_error & other) {
     42        this.virtual_table = other.virtual_table;
     43        this.msg = 0;
     44        this.num = other.num;
    4545}
    46 void ^?{}(num_error * this) {
    47         if( this->msg ) free( this->msg );
     46void ^?{}(num_error & this) {
     47        if( this.msg ) free( this.msg );
    4848}
    4949int num_error_code( num_error * this ) {
  • tests/labelledExit.cfa

    r8c50aed ra505021  
    1010// Created On       : Wed Aug 10 07:29:39 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Oct 25 17:41:51 2019
    13 // Update Count     : 7
     12// Last Modified On : Wed Feb  5 16:49:48 2020
     13// Update Count     : 9
    1414//
    1515
     
    162162
    163163        // computed goto
    164         // {
    165         //      void *array[] = { &&foo, &&bar, &&hack };
    166         //   foo: bar: hack:
    167         //      &&foo;
    168         //      &&bar;
    169         //      goto *array[i];
    170         // }
     164        {
     165                void *array[] = { &&foo, &&bar, &&hack };
     166          foo: bar: hack:
     167                &&foo;
     168                &&bar;
     169                goto *array[i];
     170        }
    171171
    172172  Q: if ( i > 5 ) {
  • tests/nested-types.cfa

    r8c50aed ra505021  
    1010// Created On       : Mon Jul 9 10:20:03 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Nov  6 17:59:40 2018
    13 // Update Count     : 2
     12// Last Modified On : Wed Feb 12 18:21:15 2020
     13// Update Count     : 3
    1414//
    1515
     
    5050//   double d;
    5151// };
     52
     53// struct S {
     54//     enum C { R, G, B };
     55//     int i;
     56//     struct T {
     57//      int i;
     58//     };
     59//     T t;
     60// };
     61
     62// S s;
     63// S.C c;
     64// S.T t;
    5265
    5366int main() {
  • tests/pybin/tools.py

    r8c50aed ra505021  
    175175
    176176def which(program):
    177     fpath, fname = os.path.split(program)
    178     if fpath:
    179         if is_exe(program):
    180             return program
    181     else:
    182         for path in os.environ["PATH"].split(os.pathsep):
    183             exe_file = os.path.join(path, program)
    184             if is_exe(exe_file):
    185                 return exe_file
    186 
    187     return None
     177        fpath, fname = os.path.split(program)
     178        if fpath:
     179                if is_exe(program):
     180                        return program
     181        else:
     182                for path in os.environ["PATH"].split(os.pathsep):
     183                        exe_file = os.path.join(path, program)
     184                        if is_exe(exe_file):
     185                                return exe_file
     186        return None
    188187
    189188@contextlib.contextmanager
     
    365364
    366365class Timed:
    367     def __enter__(self):
    368         self.start = time.time()
    369         return self
    370 
    371     def __exit__(self, *args):
    372         self.end = time.time()
    373         self.duration = self.end - self.start
     366        def __enter__(self):
     367                self.start = time.time()
     368                return self
     369
     370        def __exit__(self, *args):
     371                self.end = time.time()
     372                self.duration = self.end - self.start
    374373
    375374def timed(src, timeout):
    376375        expire = time.time() + timeout
    377376        i = iter(src)
    378         while True:
    379                 yield i.next(max(expire - time.time(), 0))
     377        with contextlib.suppress(StopIteration):
     378                while True:
     379                        yield i.next(max(expire - time.time(), 0))
  • tests/quotedKeyword.cfa

    r8c50aed ra505021  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Feb  1 00:02:22 2020
    13 // Update Count     : 24
     12// Last Modified On : Fri Feb  7 19:07:07 2020
     13// Update Count     : 25
    1414//
    1515
     
    1717
    1818struct {
    19         int ``otype``;
    20         int ``struct``;
     19        int ``otype;
     20        int ``struct;
    2121} st = { 10, 10 };
    2222
    23 typedef int ``forall``;
    24 ``forall`` xxx = 10;
     23typedef int ``forall;
     24``forall xxx = 10;
    2525
    26 int ``_Alignas``, ``_Alignof``, ``__alignof``, ``__alignof__``, ``asm``, ``__asm``, ``__asm__``, ``_At``, ``_Atomic``, ``__attribute``,
    27         ``__attribute__``, ``auto``, ``_Bool``, ``break``, ``case``, ``catch``, ``catchResume``, ``char``, ``choose``, ``_Complex``, ``__complex``,
    28         ``__complex__``, ``const``, ``__const``, ``__const__``, ``continue``, ``default``, ``disable``, ``do``, ``double``, ``dtype``, ``else``,
    29         ``enable``, ``enum``, ``__extension__``, ``extern``, ``fallthru``, ``finally``, ``float``, ``__float128``, ``for``, ``forall``, ``fortran``,
    30         ``ftype``, ``_Generic``, ``goto``, ``if``, ``_Imaginary``, ``__imag``, ``__imag__``, ``inline``, ``__inline``, ``__inline__``, ``int``,
    31         ``__int128``, ``__label__``, ``long``, ``lvalue``, ``_Noreturn``, ``__builtin_offsetof``, ``otype``, ``register``, ``restrict``,
    32         ``__restrict``, ``__restrict__``, ``return``, ``short``, ``signed``, ``__signed``, ``__signed__``, ``sizeof``, ``static``,
    33         ``_Static_assert``, ``struct``, ``switch``, ``_Thread_local``, ``throw``, ``throwResume``, ``trait``, ``try``, ``typedef``,
    34         ``typeof``, ``__typeof``, ``__typeof__``, ``union``, ``unsigned``, ``__builtin_va_list``, ``void``, ``volatile``, ``__volatile``,
    35         ``__volatile__``, ``while``;
     26int ``_Alignas, ``_Alignof, ``__alignof, ``__alignof__, ``asm, ``__asm, ``__asm__, ``_At, ``_Atomic, ``__attribute,
     27        ``__attribute__, ``auto, ``_Bool, ``break, ``case, ``catch, ``catchResume, ``char, ``choose, ``_Complex, ``__complex,
     28        ``__complex__, ``const, ``__const, ``__const__, ``continue, ``default, ``disable, ``do, ``double, ``dtype, ``else,
     29        ``enable, ``enum, ``__extension__, ``extern, ``fallthru, ``finally, ``float, ``__float128, ``for, ``forall, ``fortran,
     30        ``ftype, ``_Generic, ``goto, ``if, ``_Imaginary, ``__imag, ``__imag__, ``inline, ``__inline, ``__inline__, ``int,
     31        ``__int128, ``__label__, ``long, ``lvalue, ``_Noreturn, ``__builtin_offsetof, ``otype, ``register, ``restrict,
     32        ``__restrict, ``__restrict__, ``return, ``short, ``signed, ``__signed, ``__signed__, ``sizeof, ``static,
     33        ``_Static_assert, ``struct, ``switch, ``_Thread_local, ``throw, ``throwResume, ``trait, ``try, ``typedef,
     34        ``typeof, ``__typeof, ``__typeof__, ``union, ``unsigned, ``__builtin_va_list, ``void, ``volatile, ``__volatile,
     35        ``__volatile__, ``while;
    3636
    3737int main() {
    38         int ``if`` = 0;
    39         ``catch`` = 1;
    40         st.``otype`` = 2;
    41         st.``struct`` = 3;
    42         ``throw`` = 4;
    43         sout | ``catch`` + st.``otype`` + st.``struct`` + ``throw``;
     38        int ``if = 0;
     39        ``catch = 1;
     40        st.``otype = 2;
     41        st.``struct = 3;
     42        ``throw = 4;
     43        sout | ``catch + st.``otype + st.``struct + ``throw;
    4444}
    4545
  • tests/rational.cfa

    r8c50aed ra505021  
    1010// Created On       : Mon Mar 28 08:43:12 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar 27 07:37:17 2019
    13 // Update Count     : 80
     12// Last Modified On : Sat Feb  8 18:46:23 2020
     13// Update Count     : 86
    1414//
    1515
     
    1919#include <fstream.hfa>
    2020
    21 double convert( int i ) { return (double)i; }
     21typedef Rational(int) RatInt;
     22double convert( int i ) { return (double)i; }                   // used by narrow/widen
    2223int convert( double d ) { return (int)d; }
    2324
    2425int main() {
    2526        sout | "constructor";
    26         Rational(int) a = { 3 }, b = { 4 }, c;
    27         sout | a | b | c;
     27        RatInt a = { 3 }, b = { 4 }, c, d = 0, e = 1;
     28        sout | a | b | c | d | e;
    2829
    29         a = (Rational(int)){ 4, 8 };
    30         b = (Rational(int)){ 5, 7 };
     30        a = (RatInt){ 4, 8 };
     31        b = (RatInt){ 5, 7 };
    3132        sout | a | b;
    32         a = (Rational(int)){ -2, -3 };
    33         b = (Rational(int)){ 3, -2 };
     33        a = (RatInt){ -2, -3 };
     34        b = (RatInt){ 3, -2 };
    3435        sout | a | b;
    35         a = (Rational(int)){ -2, 3 };
    36         b = (Rational(int)){ 3, 2 };
     36        a = (RatInt){ -2, 3 };
     37        b = (RatInt){ 3, 2 };
    3738        sout | a | b;
    3839
    3940        sout | "logical";
    40         a = (Rational(int)){ -2 };
    41         b = (Rational(int)){ -3, 2 };
     41        a = (RatInt){ -2 };
     42        b = (RatInt){ -3, 2 };
    4243        sout | a | b;
    4344//      sout | a == 1; // FIX ME
     
    5859
    5960        sout | "conversion";
    60         a = (Rational(int)){ 3, 4 };
     61        a = (RatInt){ 3, 4 };
    6162        sout | widen( a );
    62         a = (Rational(int)){ 1, 7 };
     63        a = (RatInt){ 1, 7 };
    6364        sout | widen( a );
    64         a = (Rational(int)){ 355, 113 };
     65        a = (RatInt){ 355, 113 };
    6566        sout | widen( a );
    6667        sout | narrow( 0.75, 4 );
     
    7475
    7576        sout | "more tests";
    76         Rational(int) x = { 1, 2 }, y = { 2 };
     77        RatInt x = { 1, 2 }, y = { 2 };
    7778        sout | x - y;
    7879        sout | x > y;
     
    8081        sout | y | denominator( y, -2 ) | y;
    8182
    82         Rational(int) z = { 0, 5 };
     83        RatInt z = { 0, 5 };
    8384        sout | z;
    8485
    8586        sout | x | numerator( x, 0 ) | x;
    8687
    87         x = (Rational(int)){ 1, MAX } + (Rational(int)){ 1, MAX };
     88        x = (RatInt){ 1, MAX } + (RatInt){ 1, MAX };
    8889        sout | x;
    89         x = (Rational(int)){ 3, MAX } + (Rational(int)){ 2, MAX };
     90        x = (RatInt){ 3, MAX } + (RatInt){ 2, MAX };
    9091        sout | x;
    9192
  • tests/test.py

    r8c50aed ra505021  
    152152        # run everything in a temp directory to make sure core file are handled properly
    153153        with tempdir():
    154                 # if the make command succeds continue otherwise skip to diff
     154                # if the make command succeeds continue otherwise skip to diff
    155155                if success(make_ret):
    156156                        with Timed() as run_dur:
  • tests/userLiterals.cfa

    r8c50aed ra505021  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // user_literals.cfa --
     7// userLiterals.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Sep  6 21:40:50 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec  4 22:03:10 2018
    13 // Update Count     : 56
     12// Last Modified On : Wed Feb 19 07:48:45 2020
     13// Update Count     : 74
    1414//
    1515
     
    2424int ?`__thingy_( int x ) { sout | "_thingy_" | x; return x; }
    2525
    26 int ?`s( const char * s ) { sout | "secs" | s; return 0; }
    27 int ?`m( const char16_t * m ) { sout | "mins" | m; return 0;}
    28 int ?`h( const char32_t * h ) { sout | "hours" | h; return 0; }
     26int ?`s( const char * s ) { sout | "s" | s; return 0; }
     27int ?`m( const char16_t * m ) { sout | "m" | m; return 0;}
     28int ?`h( const char32_t * h ) { sout | "h" | h; return 0; }
    2929int ?`_A_( const wchar_t * str ) { sout | "_A_" | str; return 0; }
    3030int ?`__thingy_( const char * str ) { sout | "_thingy_" | str; return 0; }
     
    3737        return (Weight){ l.stones + r.stones };
    3838}
    39 ofstream & ?|?( ofstream & os, Weight w ) { return os | w.stones; }
     39ofstream & ?|?( ofstream & os, Weight w ) { return os | wd(1,1, w.stones); }
     40void ?|?( ofstream & os, Weight w ) { (ofstream)(os | w); ends( os ); }
    4041
    4142Weight ?`st( double w ) { return (Weight){ w }; }               // backquote for user literals
     
    6061        sout | w;
    6162
    62 //      0`secs;
     63        0`s;
    6364        1`s;
    6465        23`s;
     
    8283
    8384        "abc"`s;
    84 //      u"abc"`m;
    85 //      U_"abc"`h;
    86 //      L"abc"`_A_;
     85        // FIX ME: requires char16_t, char32_t, and wchar_t be unique types
     86        // u"abc"`m;
     87        // U_"abc"`h;
     88        // L"abc"`_A_;
    8789        u8_"abc"`__thingy_;
    8890} // main
     
    9092// Local Variables: //
    9193// tab-width: 4 //
    92 // compile-command: "cfa user_literals.cfa" //
     94// compile-command: "cfa userLiterals.cfa" //
    9395// End: //
Note: See TracChangeset for help on using the changeset viewer.