tst2005googlecode / re2

Automatically exported from code.google.com/p/re2
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

obj/test/re2_arg_test fails on sparc #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Building on Debian/sparc/sid, obj/test/re2_arg_test fails with the following 
output:
REArgTest.Int16Test
re2/testing/re2_arg_test.cc:117: Check failed: (r) == 
(kSuccessTable[i].value_int16)

The rest of the test suite passes.

Original issue reported on code.google.com by stefano.rivera on 27 Mar 2010 at 3:23

GoogleCodeExporter commented 9 years ago
Thanks for the report.
How did you get it compiling on sparc?

I would have expected the build to fail in util/atomicops.h.

Original comment by rsc+personal@swtch.com on 27 Mar 2010 at 11:03

GoogleCodeExporter commented 9 years ago
Here's a memory barrier for sparc:

#elif defined(__sparc__)
inline void WriteMemoryBarrier() {
  __asm__ __volatile__(".word 0x8143e00a" : : : "memory");
}

It's a bit ugly, but one can't use "membar #StoreStore" on 32-bit-only sparc, 
which 
some BSDs still support.

Original comment by stefano.rivera on 28 Mar 2010 at 6:07

GoogleCodeExporter commented 9 years ago
Identical failure on mips

Original comment by stefano.rivera on 6 Apr 2010 at 8:12

GoogleCodeExporter commented 9 years ago
Identical failure on ppc

Original comment by stefano.rivera on 7 Apr 2010 at 9:21

GoogleCodeExporter commented 9 years ago
Here's a patch to fix this:

Problem: re2_arg_test fails on big endian machines, as it expects to be able to 
access an integer as multiple sizes and see the same result.
Solution: Instead of using a unison, store each value once for each size in the 
success table struct.

Because compiler behaviour when storing too large a literal in a variable is 
undefined, I stored zeroes in such cases.

Original comment by stefano.rivera on 9 Apr 2010 at 9:59

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 31fb764097.

Original comment by rsc+personal@swtch.com on 23 Apr 2010 at 12:49