DRAFT lib: tests: 17-compare-unsigned-char-le.c: Avoid gcc optimize.

* lib/tests/scaffold/17-compare-unsigned-char-le.c (main): Change
comparison with immediate to comparison with variable.
This commit is contained in:
Janneke Nieuwenhuizen 2023-08-30 04:46:27 +02:00
parent b33e3e8b76
commit 03179824f8
1 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2023 Janneke Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -21,10 +21,12 @@
int
main ()
{
unsigned char r = -2;
if (r <= -3)
unsigned char uc = -2;
int i = - 3;
if (uc <= i)
return 1;
if (r <= (unsigned char) -1)
i = -1;
if (uc <= (unsigned char) i)
return 0;
return 2;
}