http://bugzilla.suse.com/show_bug.cgi?id=1145085 http://bugzilla.suse.com/show_bug.cgi?id=1145085#c2 --- Comment #2 from Petr Tesařík <ptesarik@suse.com> --- Adding -latomic fixes the build failure, but checks then fail here: [ 1254s] FAIL: LLVM-Unit :: Support/./SupportTests/JSONTest.Integers (2436 of 27030) [ 1254s] ******************** TEST 'LLVM-Unit :: Support/./SupportTests/JSONTest.Integers' FAILED ******************** [ 1254s] Note: Google Test filter = JSONTest.Integers [ 1254s] [==========] Running 1 test from 1 test case. [ 1254s] [----------] Global test environment set-up. [ 1254s] [----------] 1 test from JSONTest [ 1254s] [ RUN ] JSONTest.Integers [ 1254s] ../unittests/Support/JSONTest.cpp:319: Failure [ 1254s] Expected: Doc->getAsNumber() [ 1254s] Which is: 12-byte object <00-00 00-00 00-00 D0-43 01-38 D1-08> [ 1254s] To be equal to: T.AsNumber [ 1254s] Which is: 12-byte object <00-00 00-00 00-00 D0-43 01-B0 92-F2> [ 1254s] Integer, not exact double. Stored as int64, convertible. [ 1254s] ../unittests/Support/JSONTest.cpp:319: Failure [ 1254s] Expected: Doc->getAsNumber() [ 1254s] Which is: 12-byte object <00-00 00-00 00-00 D0-C3 01-60 D1-08> [ 1254s] To be equal to: T.AsNumber [ 1254s] Which is: 12-byte object <00-00 00-00 00-00 D0-C3 01-00 00-00> [ 1254s] Negative integer, not exact double. Stored as int64, convertible. [ 1254s] [ FAILED ] JSONTest.Integers (0 ms) [ 1254s] [----------] 1 test from JSONTest (0 ms total) [ 1254s] [ 1254s] [----------] Global test environment tear-down [ 1254s] [==========] 1 test from 1 test case ran. (1 ms total) [ 1254s] [ PASSED ] 0 tests. [ 1254s] [ FAILED ] 1 test, listed below: [ 1254s] [ FAILED ] JSONTest.Integers Essentially, there is a check that an int64_t converted to a double matches a pre-calculated value exactly. This does not work for a large 64-bit integer which cannot be interpreted exactly as a 64-bit double. That's because the integer value is stored in a hardware floating-point register (using the FILD instruction). This register has 80 bits, so it can represent the integer value exactly. This register is then compared with the 64-bit value (loaded into another 80-bit floating-point register from memory using FLD instruction). Of course, the two do not match. It is not an issue on x86-64, because 64-bit XMM registers are used in that case, so there is no extra precision. I believe this unit test is broken, at least on i586. -- You are receiving this mail because: You are on the CC list for the bug.