Changeset 8cbe732 for tests


Ignore:
Timestamp:
Oct 13, 2023, 7:13:21 PM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
a97b9ed, bab2917
Parents:
85034ed (diff), 0bf0b978 (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' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
tests
Files:
10 added
15 edited

Legend:

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

    r85034ed r8cbe732  
    1 signed=-7 unsigned=12
     1signed=7 unsigned=12
  • tests/collections/.expect/string-istream-manip.txt

    r85034ed r8cbe732  
     1preS1 0123456
     2preS1 x
     3preS2 01234567
     4preS2 x
     5preS3 012345678
     6preS3 x
     7preS4 0123456789
     8preS4 x
     9preSMN1 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456
     10preSMN1 x
     11preSMN2 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...01234567
     12preSMN2 x
     13preSMN3 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...012345678
     14preSMN3 x
     15preSMN4 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456789
     16preSMN4 x
     17preRMN1 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456
     18preRMN1 x
     19preRMN2 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...01234567
     20preRMN2 x
     21preRMN3 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...012345678
     22preRMN3 x
     23preRMN4 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456789
     24preRMN4 x
     25preSMI1 "...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...       "
     26preSMI1 "x"
     27preSMI2 "...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...        "
     28preSMI2 "x"
     29preSMI3 "...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...         "
     30preSMI3 "x"
     31preSMI4 "...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...          "
     32preSMI4 "x"
     33preSME1 "...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...       "
     34preSME1 "x"
     35preSME2 "...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...        "
     36preSME2 "x"
     37preSME3 "...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...         "
     38preSME3 "x"
     39preSME4 "...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...          "
     40preSME4 "x"
     41preSMG1 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456
     42preSMG1 x
     43preSMG2 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...01234567
     44preSMG2 x
     45preSMG3 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...012345678
     46preSMG3 x
     47preSMG4 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456789
     48preSMG4 x
     49preSMD1 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456
     50preSMD1 x
     51preSMD2 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...01234567
     52preSMD2 x
     53preSMD3 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...012345678
     54preSMD3 x
     55preSMD4 ...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456789
     56preSMD4 x
    1571 yyyyyyyyyyyyyyyyyyyy
    2582 abcxxx
     
    126812 wwwwwwww
    136913 wwwwwwww
     7014 cccc
     7115
    14721 yyyyyyyyyyyyyyyyyyyy
    15732 abcxxx
     
    258312 wwwwwwww
    268413 wwwwwwww
     8514 cccc
     8615
  • tests/collections/.in/string-istream-manip.txt

    r85034ed r8cbe732  
     10123456 x
     201234567 x
     3012345678 x
     40123456789 x
     5...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456 x
     6...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...01234567 x
     7...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...012345678 x
     8...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456789 x
     9...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456 x
     10...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...01234567 x
     11...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...012345678 x
     12...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456789 x
     13...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...       -x-
     14...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...        -x-
     15...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...         -x-
     16...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...          -x-
     17...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...       -x-
     18...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...        -x-
     19...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...         -x-
     20...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...          -x-
     21...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456
     22x
     23...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...01234567
     24x
     25...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...012345678
     26x
     27...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456789
     28x
     29...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456@x@
     30...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...01234567@x@
     31...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...012345678@x@
     32...:...:...:...|...:...:...:...|...:...:...:...|...:...:...:...#...:...:...:...|...:...:...:...|...:...:...:...|...:...0123456789@x@
    133abc
    2 abc
     34cccccb
    335xx
    436abcxxx
    537abcyyy
    638aaaaaaaaxxxxxxxxaabbccbbdddwwwbbbbbbbbwwwwwwwwaaaaaaaawwwwwwww
     39uuuuuccccuuuuu
    740abc
    8 abc
     41cccccb
    942xx
    1043abcxxx
    1144abcyyy
    1245aaaaaaaaxxxxxxxxaabbccbbdddwwwbbbbbbbbwwwwwwwwaaaaaaaawwwwwwww
     46uuuuuccccuuuuu
  • tests/collections/string-istream-manip.cfa

    r85034ed r8cbe732  
    33#include <collections/string.hfa>
    44#include <collections/string_res.hfa>
     5#include <stdio.h>
     6
     7// No-op manipulators.
     8// Temporary hack while there are two code paths in the string implementation.
     9// (One for reading plain strings, the other for reading via a manipulator.)
     10// The test cases that use plainjane(-) are exercising the via-manipulator code path,
     11// just with trivial manipulation.
     12static _Istream_Sstr plainjane( string     & s )  { return (_Istream_Sstr)@{  s, {{0p}, -1, {.flags.rwd : false}} }; }
     13static _Istream_Rstr plainjane( string_res & s )  { return (_Istream_Rstr)@{ &s, {{0p}, -1, {.flags.rwd : false}} }; }
     14
     15static void forceStringHeapFreeSpaceTo(int desiredSize) {
     16    for (1_000_000) {
     17        string x = "a";
     18        (void)x;
     19      if (desiredSize == DEBUG_string_bytes_avail_until_gc(DEBUG_string_heap())) return;
     20    }
     21    sout | "Unable to force size" | desiredSize | "in 1,000,000 tries";
     22}
    523
    624int main() {
     25    // These "pre" cases deal with issues analogous to the "pre" cases of io/manipulatorsInput.
     26    // The acceptance criterion is simpler but driving the cases is harder.
     27    // The tests just read strings and echo what they read; acceptance of simple echoing assures
     28    // no spurious splitting merging.
     29    // The lengths of the strings are chosen to match white-box knowledge of when the string layer
     30    // has tor drive the cstring layer through a second iteration:
     31    //  - for no-manip, lengths are near the room at end of string heap
     32    //    (chosen target size of 9 showed the original bug on preS2, aligned with the other cases)
     33    //  - for manip, lengths are near the auxiliary buffer size of 128
     34    // Only first case repeats for string_res; rest run only from the passthru string layer.
     35    // Similarly, the manipulator breadth isn't checked at the cstring layer either.
     36    {
     37        // S: string, no manipulator
     38        void echoTillX(const char * casename) {
     39            string s;
     40            do {
     41                forceStringHeapFreeSpaceTo(9);
     42                sin | s;
     43                sout | casename | s;
     44            } while ( size(s) > 0 && s[size(s)-1] != 'x' );
     45        }
     46        echoTillX("preS1");
     47        echoTillX("preS2");
     48        echoTillX("preS3");
     49        echoTillX("preS4");
     50    }
     51    {
     52        // SMN: string, manipulator for no-op
     53        void echoTillX(const char * casename) {
     54            string s;
     55            do {
     56                sin | plainjane( s );
     57                sout | casename | s;
     58            } while ( size(s) > 0 && s[size(s)-1] != 'x' );
     59        }
     60        echoTillX("preSMN1");
     61        echoTillX("preSMN2");
     62        echoTillX("preSMN3");
     63        echoTillX("preSMN4");
     64    }
     65    {
     66        // RMN: string_res, manipulator for no-op
     67        void echoTillX(const char * casename) {
     68            string_res s;
     69            do {
     70                sin | plainjane( s );
     71                sout | casename | s;
     72            } while ( size(s) > 0 && s[size(s)-1] != 'x' );
     73        }
     74        echoTillX("preRMN1");
     75        echoTillX("preRMN2");
     76        echoTillX("preRMN3");
     77        echoTillX("preRMN4");
     78    }
     79    {
     80        // SMI: string, manipulator `incl`
     81        void echoTillX(const char * casename) {
     82            string s;
     83            do {
     84                sin | skip("-\n");
     85                sin | incl( ".:|# x", s );
     86                sout | casename | " \"" | s | "\"";
     87            } while ( size(s) > 0 && s[size(s)-1] != 'x' );
     88        }
     89        echoTillX("preSMI1");
     90        echoTillX("preSMI2");
     91        echoTillX("preSMI3");
     92        echoTillX("preSMI4");
     93    }
     94    {
     95        // SME: string, manipulator `excl`
     96        void echoTillX(const char * casename) {
     97            string s;
     98            do {
     99                sin | skip("-\n");
     100                sin | excl( "-\n", s );
     101                sout | casename | " \"" | s | "\"";
     102            } while ( size(s) > 0 && s[size(s)-1] != 'x' );
     103        }
     104        echoTillX("preSME1");
     105        echoTillX("preSME2");
     106        echoTillX("preSME3");
     107        echoTillX("preSME4");
     108    }
     109    sin | skip("-\n");
     110    {
     111        // SMG: string, manipulator `getline`
     112        void echoTillX(const char * casename) {
     113            string s;
     114            do {
     115                sin | getline( s );
     116                sout | casename | s;
     117            } while ( size(s) > 0 && s[size(s)-1] != 'x' );
     118        }
     119        echoTillX("preSMG1");
     120        echoTillX("preSMG2");
     121        echoTillX("preSMG3");
     122        echoTillX("preSMG4");
     123    }
     124    {
     125        // SMD: string, manipulator (`getline` with custom) delimiter
     126        void echoTillX(const char * casename) {
     127            string s;
     128            do {
     129                sin | getline( s, '@' );
     130                sout | casename | s;
     131            } while ( size(s) > 0 && s[size(s)-1] != 'x' );
     132            sin | skip(" \n");
     133        }
     134        echoTillX("preSMD1");
     135        echoTillX("preSMD2");
     136        echoTillX("preSMD3");
     137        echoTillX("preSMD4");
     138    }
     139
    7140    /* Keep harmonized with io/manipulatorsInput */
    8141    {
     
    23156        sin | ignore( incl( "abc", wdi( 8, s ) ) );     sout | "12" | s;
    24157        sin | ignore( excl( "abc", wdi( 8, s ) ) );     sout | "13" | s;
    25     }
     158
     159                s = "q";
     160                sin | incl( "abc", s );                         sout | "14" | s;
     161                s = "q";
     162                sin | excl( "u", s );                           sout | "15" | s;
     163                sin | skip( "u" );
     164                sin | "\n";
     165        }
     166    // Full repeat on string_res layer assures the full manipulator vocabulary is supported there.
    26167    {
    27168        string_res s = "yyyyyyyyyyyyyyyyyyyy";
     
    41182        sin | ignore( incl( "abc", wdi( 8, s ) ) );     sout | "12" | s;
    42183        sin | ignore( excl( "abc", wdi( 8, s ) ) );     sout | "13" | s;
     184
     185                s = "q";
     186                sin | incl( "abc", s );                         sout | "14" | s;
     187                s = "q";
     188                sin | excl( "u", s );                           sout | "15" | s;
     189                sin | skip( "u" );
     190                sin | "\n";
    43191    }
    44192}
  • tests/concurrency/cofor.cfa

    r85034ed r8cbe732  
    11#include <cofor.hfa>
    22
    3 long total = 0;
    4 void add_num( void * arg ) { __atomic_fetch_add( &total, (long)arg, __ATOMIC_SEQ_CST ); }
     3
     4void add_num( long * total, long val ) { __atomic_fetch_add( total, (long)val, __ATOMIC_SEQ_CST ); }
    55
    66int main() {
    77    printf("start\n");
    88    processor p[4];
     9    long total = 0;
    910    COFOR( i, 0, 10, __atomic_fetch_add( &total, i, __ATOMIC_SEQ_CST ); );
    10     parallel_stmt_t stmts[5] = { add_num, add_num, add_num, add_num, add_num };
    11     void * nums[5] = { (void *)11, (void *)12, (void *)13, (void *)14, (void *)15 };
    12     parallel( stmts, nums, 5 );
     11    {
     12        corun;      // does nothing
     13        corun{};    // does nothing
     14        corun add_num( &total, 11 );
     15        corun { add_num( &total, 12 ); }
     16        corun __atomic_fetch_add( &total, 13, __ATOMIC_SEQ_CST );
     17        corun { __atomic_fetch_add( &total, 14, __ATOMIC_SEQ_CST ); }
     18        __atomic_fetch_add( &total, 15, __ATOMIC_SEQ_CST ); // run by main thd
     19    }
    1320    printf("total: %ld\n", total);
    1421    printf("done\n");
  • tests/errors/.expect/scope.txt

    r85034ed r8cbe732  
    1 errors/scope.cfa:2:1 error: duplicate object definition for thisIsAnError: signed int
    2 errors/scope.cfa:20:1 error: duplicate function definition for butThisIsAnError: function
     1errors/scope.cfa:13:1 error: duplicate object definition for thisIsAnError: signed int
     2errors/scope.cfa:30:1 error: duplicate function definition for butThisIsAnError: function
    33... with parameters
    44  double
  • tests/errors/scope.cfa

    r85034ed r8cbe732  
    1 int thisIsAnError;
    2 int thisIsAnError;
     1// Keep harmonized with errors/scope.
    32
    4 int thisIsNotAnError;
    5 float thisIsNotAnError;
     3#ifdef OMIT_DRIVING_REJECTIONS
     4// For manual sanity checking:
     5// Leave out the offensive declarations and verify that what's left is accepted.
     6#define EXPREJ(...)
     7#else
     8#define EXPREJ(...) __VA_ARGS__
     9#endif
    610
    7 int thisIsAlsoNotAnError() {
    8   int thisIsNotAnError;
    9 }
    1011
    11 int thisIsAlsoNotAnError( double x ) {
    12 }
     12        int thisIsAnError;
     13EXPREJ( int thisIsAnError; )
    1314
    14 double thisIsStillNotAnError( double );
    15 double thisIsStillNotAnError( double );
     15        int thisIsNotAnError;
     16        float thisIsNotAnError;
    1617
    17 double butThisIsAnError( double ) {
    18 }
     18        int thisIsAlsoNotAnError() {
     19          int thisIsNotAnError;
     20        }
    1921
    20 double butThisIsAnError( double ) {
    21 }
     22        int thisIsAlsoNotAnError( double x ) {
     23        }
     24
     25        double thisIsStillNotAnError( double );
     26        double thisIsStillNotAnError( double );
     27
     28        double butThisIsAnError( double ) {
     29        }
     30EXPREJ(
     31        double butThisIsAnError( double ) {
     32        }
     33)
    2234
    2335// Local Variables: //
  • tests/io/.expect/manipulatorsInput.arm64.txt

    r85034ed r8cbe732  
    11pre1 "123456", canary ok
    2 pre2a "1234567", exception occurred, canary ok
    3 pre2b "89", canary ok
     2pre2 "1234567", canary ok
     3pre3a "1234567", exception occurred, canary ok
     4pre3b "8", canary ok
     5pre4a "1234567", exception occurred, canary ok
     6pre4b "89", canary ok
    471 yyyyyyyyyyyyyyyyyyyy
    582 abcxxx
     
    151812 wwwwwwww
    161913 wwwwwwww
     2014 rc=1, cccc
     2115 rc=0, q
    17221 yyyyyyyyyyyyyyyyyyyy
    18232 abcxxx
     
    283312 wwwwwwww
    293413 wwwwwwww
     3514 cccc
     3615
    3037a
    3138a
  • tests/io/.expect/manipulatorsInput.x64.txt

    r85034ed r8cbe732  
    11pre1 "123456", canary ok
    2 pre2a "1234567", exception occurred, canary ok
    3 pre2b "89", canary ok
     2pre2 "1234567", canary ok
     3pre3a "1234567", exception occurred, canary ok
     4pre3b "8", canary ok
     5pre4a "1234567", exception occurred, canary ok
     6pre4b "89", canary ok
    471 yyyyyyyyyyyyyyyyyyyy
    582 abcxxx
     
    151812 wwwwwwww
    161913 wwwwwwww
     2014 rc=1, cccc
     2115 rc=0, q
    17221 yyyyyyyyyyyyyyyyyyyy
    18232 abcxxx
     
    283312 wwwwwwww
    293413 wwwwwwww
     3514 cccc
     3615
    3037a
    3138a
  • tests/io/.expect/manipulatorsInput.x86.txt

    r85034ed r8cbe732  
    11pre1 "123456", canary ok
    2 pre2a "1234567", exception occurred, canary ok
    3 pre2b "89", canary ok
     2pre2 "1234567", canary ok
     3pre3a "1234567", exception occurred, canary ok
     4pre3b "8", canary ok
     5pre4a "1234567", exception occurred, canary ok
     6pre4b "89", canary ok
    471 yyyyyyyyyyyyyyyyyyyy
    582 abcxxx
     
    151812 wwwwwwww
    161913 wwwwwwww
     2014 rc=1, cccc
     2115 rc=0, q
    17221 yyyyyyyyyyyyyyyyyyyy
    18232 abcxxx
     
    283312 wwwwwwww
    293413 wwwwwwww
     3514 cccc
     3615
    3037a
    3138a
  • tests/io/.in/manipulatorsInput.txt

    r85034ed r8cbe732  
    11123456
     21234567
     312345678
    24123456789
    35abc
    4 abc
     6cccccb
    57xx
    68abcxxx
    79abcyyy
    810aaaaaaaaxxxxxxxxaabbccbbdddwwwbbbbbbbbwwwwwwwwaaaaaaaawwwwwwww
     11uuuuuccccuuuuu
    912abc
    10 abc
     13cccccb
    1114xx
    1215abcxxx
    1316abcyyy
    1417aaaaaaaaxxxxxxxxaabbccbbdddwwwbbbbbbbbwwwwwwwwaaaaaaaawwwwwwww
     18uuuuuccccuuuuu
    1519ab
    16200xff 017 15-15
  • tests/io/manipulatorsInput.cfa

    r85034ed r8cbe732  
    4545                }
    4646
    47                 rep("pre1");
    48                 rep("pre2a");
    49                 rep("pre2b");
     47                rep("pre1");    // 123456     |  123456
     48                rep("pre2");    // 1234567    |  1234567
     49                rep("pre3a");   // 12345678   |  1234567
     50                rep("pre3b");   //            |  8
     51                rep("pre4a");   // 123456789  |  1234567
     52                rep("pre4b");   //            |  89
     53
    5054                scanf("\n");  // next test does not start with %s so does not tolerate leading whitespace
    5155        }
    5256        {
    5357                char s[] = "yyyyyyyyyyyyyyyyyyyy";
    54                 const char sk[] = "abc";
    55                 scanf( "abc " ); scanf( sk ); for ( 5 ) scanf( "%*c" ); printf( "1 %s\n", s );
     58                const char sk_fmt[] = "%*[abc]";
     59                scanf( "abc " ); scanf( sk_fmt ); for ( 5 ) scanf( "%*c" ); printf( "1 %s\n", s );
    5660                scanf( "%s", s );                                                               printf( "2 %s\n", s );
    5761                scanf( "%*s" );                                                                 printf( "3 %s\n", s );
     
    6771                scanf( "%*8[abc]" );                                                    printf( "12 %s\n", s );
    6872                scanf( "%*8[^abc]" );                                                   printf( "13 %s\n", s );
     73
     74                int rc;
     75                s[0] = 'q'; s[1] = '\0'; rc = 99;
     76                rc = scanf( "%[abc]", s );                                              printf( "14 rc=%d, %s\n", rc, s );
     77                s[0] = 'q'; s[1] = '\0'; rc = 99;
     78                rc = scanf( "%[^u]", s );                                               printf( "15 rc=%d, %s\n", rc, s );
     79                scanf( "%*[u]" );
     80                scanf("\n");
    6981        }
    7082        {
     
    8597                sin | ignore( incl( "abc", wdi( sizeof(s), 8, s ) ) ); sout | "12" | s;
    8698                sin | ignore( excl( "abc", wdi( sizeof(s), 8, s ) ) ); sout | "13" | s;
     99
     100                s[0] = 'q'; s[1] = '\0';
     101                sin | incl( "abc", wdi( sizeof(s), s ) );               sout | "14" | s;
     102                s[0] = 'q'; s[1] = '\0';
     103                sin | excl( "u", wdi( sizeof(s), s ) );                 sout | "15" | s;
     104                sin | skip( "u" );
     105                sin | "\n";
    87106        }
    88107    /* Keep harmonized with collections/string-istream-manip */
  • tests/link-once/main.cfa

    r85034ed r8cbe732  
    11// Test our new cfa_linkonce attribute:
    22
    3 __attribute__(( cfa_linkonce )) signed int example = -7;
     3__attribute__(( cfa_linkonce )) signed int example = 7;
    44__attribute__(( cfa_linkonce )) unsigned int example = 12;
    55
  • tests/link-once/partner.cfa

    r85034ed r8cbe732  
    11// Side file for the link-once test.
    22
    3 __attribute__(( cfa_linkonce )) signed int example = -7;
     3__attribute__(( cfa_linkonce )) signed int example = 7;
    44__attribute__(( cfa_linkonce )) unsigned int example = 12;
    55
  • tests/test.py

    r85034ed r8cbe732  
    116116        parser.add_argument('--no-invariant', help='Tell the compiler not to check invariants.', action='store_false', dest='invariant')
    117117        parser.add_argument('--invariant', help='Tell the compiler to check invariants.', action='store_const', const=True)
    118         parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=180)
     118        parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=240)
    119119        parser.add_argument('--global-timeout', help='Maximum cumulative duration in seconds after the ALL tests are considered to have timed out', type=int, default=7200)
    120120        parser.add_argument('--timeout-with-gdb', help='Instead of killing the command when it times out, orphan it and print process id to allow gdb to attach', type=yes_no, default="no")
     
    125125        parser.add_argument('--archive-errors', help='If called with a valid path, on test crashes the test script will copy the core dump and the executable to the specified path.', type=str, default='')
    126126        parser.add_argument('-j', '--jobs', help='Number of tests to run simultaneously, 0 (default) for unlimited', nargs='?', const=0, type=int)
    127         parser.add_argument('--list-comp', help='List all valide arguments', action='store_true')
     127        parser.add_argument('--list-comp', help='List all valid arguments', action='store_true')
    128128        parser.add_argument('--list-dist', help='List all tests for distribution', action='store_true')
    129129        parser.add_argument('-I','--include', help='Directory of test to include, can be used multiple time, All  if omitted', action='append')
Note: See TracChangeset for help on using the changeset viewer.