Changeset 23a08aa0 for tests


Ignore:
Timestamp:
Sep 19, 2022, 8:11:02 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
aa9f215
Parents:
ebf8ca5 (diff), ae1d151 (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:

fix merge conflict

Location:
tests
Files:
2 added
46 deleted
15 edited
36 moved

Legend:

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

    rebf8ca5 r23a08aa0  
    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

    rebf8ca5 r23a08aa0  
    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

    rebf8ca5 r23a08aa0  
    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/Makefile.am

    rebf8ca5 r23a08aa0  
    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/clib.c

    rebf8ca5 r23a08aa0  
    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

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

    rebf8ca5 r23a08aa0  
    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

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

    rebf8ca5 r23a08aa0  
    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/io/comp_fair.cfa

    rebf8ca5 r23a08aa0  
    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/meta/.expect/arch.arm64.txt

    rebf8ca5 r23a08aa0  
    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

    rebf8ca5 r23a08aa0  
    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

    rebf8ca5 r23a08aa0  
    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

    rebf8ca5 r23a08aa0  
    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

    rebf8ca5 r23a08aa0  
    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

    rebf8ca5 r23a08aa0  
    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

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

    rebf8ca5 r23a08aa0  
    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

    rebf8ca5 r23a08aa0  
    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.