qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6 31/35] Hexagon (tests/tcg/hexagon) TCG tests


From: Alex Bennée
Subject: Re: [PATCH v6 31/35] Hexagon (tests/tcg/hexagon) TCG tests
Date: Tue, 12 Jan 2021 12:04:19 +0000
User-agent: mu4e 1.5.7; emacs 28.0.50

Taylor Simpson <tsimpson@quicinc.com> writes:

> Modify tests/tcg/configure.sh
> Add reference files to tests/tcg/hexagon
> Add Hexagon-specific tests
>
> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
> ---
>  tests/tcg/hexagon/atomics.c        | 122 ++++++
>  tests/tcg/hexagon/clrtnew.c        |  56 +++
>  tests/tcg/hexagon/dual_stores.c    |  60 +++
>  tests/tcg/hexagon/fpstuff.c        | 370 ++++++++++++++++++
>  tests/tcg/hexagon/mem_noshuf.c     | 328 ++++++++++++++++
>  tests/tcg/hexagon/misc.c           | 360 +++++++++++++++++
>  tests/tcg/hexagon/preg_alias.c     | 106 +++++
>  tests/tcg/hexagon/pthread_cancel.c |  43 +++
>  tests/tcg/configure.sh             |   4 +-
>  tests/tcg/hexagon/Makefile.target  |  48 +++

Could you split this patch up please. I would say:

 1: configure.sh, Makefilefile.target with multiarch tests (and float
 ref files)
 2. atomics/loadstore/mem tests
 3. additional fp tests

BTW is there enough support for a bare metal system emulation test? You
would need a minimal boot.S and a library function for outputting
characters to some device and an exit which can set the return code.

<snip>

> +++ b/tests/tcg/hexagon/pthread_cancel.c
> @@ -0,0 +1,43 @@
> +/*
> + *  Copyright(c) 2019-2020 Qualcomm Innovation Center, Inc. All Rights 
> Reserved.
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <pthread.h>
> +
> +static void *func(void *arg)
> +{
> +    sleep(3);
> +    return 0;
> +}
> +
> +int main()
> +{
> +    int err = 0;
> +    pthread_t thread;
> +    void *res;
> +
> +    pthread_create(&thread, 0, func, NULL);
> +    pthread_cancel(thread);
> +    pthread_join(thread, &res);
> +    if (res != PTHREAD_CANCELED) {
> +        err++;
> +    }
> +
> +    puts(err == 0 ? "PASS" : "FAIL");
> +    return err == 0 ? 0 : -1;
> +}

This seems like it could be a multiarch test unless the othread cancel
semantics for Hexagon/Linux are very different.

<snip>

-- 
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]