diff mbox series

bug-assign-op0.c: fix test on 32-bit builds

Message ID 69f6f834-b350-5553-8227-1c7b4c6532c2@ramsayjones.plus.com (mailing list archive)
State Mainlined, archived
Headers show
Series bug-assign-op0.c: fix test on 32-bit builds | expand

Commit Message

Ramsay Jones Aug. 11, 2020, 3:15 a.m. UTC
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---

Hi Luc,

Tonight my 32-bit build/test run on 32-bit Linux failed this test.

The first version of this patch was a simple one-liner to add an
'-m64' argument to the test-linearize 'check-command'. This seems
to be the usual fix for this, but I thought I would try something
different. ;-)

If you prefer the one-liner, then go with that (I tested it on 32-bit
Linux, but not on 64-bit Linux - I can't imagine that it would fail!).

ATB,
Ramsay Jones

 validation/linear/bug-assign-op0.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Luc Van Oostenryck Aug. 11, 2020, 4:45 a.m. UTC | #1
On Tue, Aug 11, 2020 at 04:15:23AM +0100, Ramsay Jones wrote:
> 
Hi Ramsay,
> 
> Tonight my 32-bit build/test run on 32-bit Linux failed this test.

Yeah :( When writing I thought "I must make them 64bit ones" but ...

> The first version of this patch was a simple one-liner to add an
> '-m64' argument to the test-linearize 'check-command'. This seems
> to be the usual fix for this, but I thought I would try something
> different. ;-)
> 
> If you prefer the one-liner, then go with that (I tested it on 32-bit
> Linux, but not on 64-bit Linux - I can't imagine that it would fail!).

No no, it's fine so when 64-bit vars are needed. Usnig -m64 is only
OK when 'long' is needed and that these long need

Many thanks for reporting and fixing this.
-- Luc
diff mbox series

Patch

diff --git a/validation/linear/bug-assign-op0.c b/validation/linear/bug-assign-op0.c
index b351bb51..3a2bef3c 100644
--- a/validation/linear/bug-assign-op0.c
+++ b/validation/linear/bug-assign-op0.c
@@ -10,7 +10,7 @@  unsigned int lsr(unsigned int u)
 	return u;
 }
 
-int divr(int s, unsigned long u)
+int divr(int s, unsigned long long u)
 {
 	extern int use(int, unsigned);
 	int t = s;
@@ -19,25 +19,25 @@  int divr(int s, unsigned long u)
 	return use(s, u);
 }
 
-int sdivul(int s, unsigned long u)
+int sdivul(int s, unsigned long long u)
 {
 	s /= u;			// divu
 	return s;
 }
 
-unsigned int udivsl(unsigned int u, long s)
+unsigned int udivsl(unsigned int u, long long s)
 {
 	u /= s;			// divs
 	return u;
 }
 
-int uldivs(int s, unsigned long u)
+int uldivs(int s, unsigned long long u)
 {
 	u /= s;			// divu
 	return u;
 }
 
-unsigned int sldivu(unsigned int u, long s)
+unsigned int sldivu(unsigned int u, long long s)
 {
 	s /= u;			// divs
 	return s;