From a0c9c0aedbe76b2ea44f5a67756b5e08f90063e0 Mon Sep 17 00:00:00 2001 From: Janneke Nieuwenhuizen Date: Wed, 30 Aug 2023 04:53:28 +0200 Subject: [PATCH] DRAFT lib: tests: 17-compare-unsigned-short-le.c: Avoid gcc optimize. * lib/tests/scaffold/17-compare-unsigned-short-le.c (main): Change comparison with immediate to comparison with variable. --- lib/tests/scaffold/17-compare-unsigned-short-le.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/tests/scaffold/17-compare-unsigned-short-le.c b/lib/tests/scaffold/17-compare-unsigned-short-le.c index 20b77ebc..97403af4 100644 --- a/lib/tests/scaffold/17-compare-unsigned-short-le.c +++ b/lib/tests/scaffold/17-compare-unsigned-short-le.c @@ -1,6 +1,6 @@ /* -*-comment-start: "//";comment-end:""-*- * GNU Mes --- Maxwell Equations of Software - * Copyright © 2018 Jan (janneke) Nieuwenhuizen + * Copyright © 2018,2023 Janneke Nieuwenhuizen * * This file is part of GNU Mes. * @@ -21,10 +21,12 @@ int main () { - unsigned short r = -2; - if (r <= -3) + unsigned short us = -2; + int i = -3; + if (us <= i) return 1; - if (r <= (unsigned short) -1) + i = -1; + if (us <= (unsigned short) i) return 0; return 2; }