From 0b2cb25b2694be834eb250283e1638ae11ce85b7 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Thu, 4 Sep 2008 12:15:39 +0000 Subject: [PATCH] simplified and improved [r21699] --- ir/be/test/fehler149.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ir/be/test/fehler149.c b/ir/be/test/fehler149.c index 3b7f9950d..0c8bb8de5 100644 --- a/ir/be/test/fehler149.c +++ b/ir/be/test/fehler149.c @@ -1,14 +1,16 @@ -unsigned short tdenm, tquot; +unsigned short tdenm = 0xff; +unsigned int ui = 0xffffffff; -void test(unsigned short num[]) { +int test(void) { - unsigned int tnum = (((unsigned int) num[0]) << 16) + num[1]; + unsigned int tnum = ui; /* Do not execute the divide instruction if it will overflow. */ if ((tdenm * 0xffffL) < tnum) - tquot = 0xffff; + return 0; + return 1; } int main(int argc, char *argv[]) { - return 0; + return test(); } -- 2.20.1