Vladimir Prus wrote:> Vladimir Prus wrote: > > The above-mentioned test contains this: > > > > long B53 = - (1LL << 53); > > > > strictly speaking, this is not correct code. The C standard says about > > shift: "if the value of the first operator is ... or greater than ... the > > width of the promoted left operand, the behaviour is underfined". > > Forget this, I've missed the 'LL' suffix. Sorry for the noise.But the test still has a problem ;-) printf("%ld\n", Arg / (1LL << 4)); Again, the passed value is long long, and format specifier is '%ld'. What about the attached patch? - Volodya -------------- next part -------------- A non-text attachment was scrubbed... Name: 2002-05-19-DivTest.diff Type: text/x-diff Size: 614 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040708/e12da2e8/attachment.diff>
On Thu, 2004-07-08 at 07:07, Vladimir Prus wrote:> Vladimir Prus wrote: > > Vladimir Prus wrote: > > > The above-mentioned test contains this: > > > > > > long B53 = - (1LL << 53); > > > > > > strictly speaking, this is not correct code. The C standard says about > > > shift: "if the value of the first operator is ... or greater than ... the > > > width of the promoted left operand, the behaviour is underfined". > > > > Forget this, I've missed the 'LL' suffix. Sorry for the noise. > > But the test still has a problem ;-) > > printf("%ld\n", Arg / (1LL << 4)); > > Again, the passed value is long long, and format specifier is '%ld'. What > about the attached patch?I think testL has another problem. It takes a long argument which in C I think is a 4-byte int, right? -- Alkis
Alkis Evlogimenos wrote:> > But the test still has a problem ;-) > > > > printf("%ld\n", Arg / (1LL << 4)); > > > > Again, the passed value is long long, and format specifier is '%ld'. What > > about the attached patch? > > I think testL has another problem. It takes a long argument which in C I > think is a 4-byte int, right?Yes, but I don't understand what follows. I though conversion from 4 to 8 bytes is part of what this test is about....... - Volodya
On Thu, 8 Jul 2004, Alkis Evlogimenos wrote:> > > Forget this, I've missed the 'LL' suffix. Sorry for the noise. > > > > But the test still has a problem ;-) > > > > printf("%ld\n", Arg / (1LL << 4)); > > > > Again, the passed value is long long, and format specifier is '%ld'. What > > about the attached patch? > > I think testL has another problem. It takes a long argument which in C I > think is a 4-byte int, right?sizeof(long) varies based on the target. On the SparcV9 for example, sizeof(long) == sizeof(long long) == 8. Many of these tests are from the era when we only had a sparc backend. Thanks for getting them cleaned up! -Chris -- http://llvm.cs.uiuc.edu/ http://www.nondot.org/~sabre/Projects/