From 6aa77fe162e97b476c20cc235464c59ae6213337 Mon Sep 17 00:00:00 2001 From: Janneke Nieuwenhuizen Date: Wed, 30 Aug 2023 05:53:19 +0200 Subject: [PATCH] DRAFT lib: tests: 17-compare-unsigned-le: Add case from 7s-unsigned-compare. * lib/tests/scaffold/17-compare-unsigned-le.c: Add case from 7s-unsigned-compare; rewrite to avoid gcc-optimize. --- lib/tests/scaffold/17-compare-unsigned-le.c | 22 +++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/tests/scaffold/17-compare-unsigned-le.c b/lib/tests/scaffold/17-compare-unsigned-le.c index e6b7fa60..54afafd7 100644 --- a/lib/tests/scaffold/17-compare-unsigned-le.c +++ b/lib/tests/scaffold/17-compare-unsigned-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,20 @@ int main () { - unsigned r = -2; - if (r <= -3) + unsigned u = -2; + int i = -3; + int r = u <= -3; + if (r) return 1; - if (r <= -1) - return 0; - return 2; + + i = -1; + r = u <= -1; + if (!r) + return 2; + + u = 0; + i = -1; + r = i <= u; + if (r) + return 3; }