[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: add simple casting test.
From: |
Janneke Nieuwenhuizen |
Subject: |
Re: [PATCH] tests: add simple casting test. |
Date: |
Wed, 30 Aug 2023 06:17:47 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Ekaitz Zarraga writes:
> From c06a06c3706567c6a5ff3265c95296e055868d70 Mon Sep 17 00:00:00 2001
> From: Ekaitz Zarraga <ekaitz@elenq.tech>
> Date: Tue, 29 Aug 2023 20:09:36 +0200
> Subject: [PATCH] tests: add simple casting test.
>
> * lib/tests/scaffold/16-cast.c: Add file.
> * build-aux/check-mescc.sh (mes_tests): Add it.
Thanks! Added to `wip'
> +#include<stdio.h>
> +int
> +main ()
> +{
> + char r = -1;
> + unsigned s = r;
> + unsigned t = (unsigned char)r;
> + if (s != -1)
> + return 2;
> + if (t != 255)
> + return 1;
> + return 0;
> +
Slightly rewritten so that GCC cannot optimize-out any tests and adds
the SET_XX continuation instructions.
--
Janneke Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | AvatarĀ® https://AvatarAcademy.com