HomePhabricator

[APFloat] Add recoverable string parsing errors to APFloat
Audit Requiredc5fb73c5d1b3

Authored by ekatz on Jan 6 2020, 12:05 AM.

Description

[APFloat] Add recoverable string parsing errors to APFloat

Implementing the APFloat part in PR4745.

Differential Revision: https://reviews.llvm.org/D69770

Details

Auditors
grosbach
Committed
ekatzJan 6 2020, 12:09 AM
Differential Revision
D69770: [APFloat] Add recoverable string parsing errors to APFloat
Parents
rGa79295333005: [Metadata] Add TBAA struct metadata to `AAMDNode`
Branches
Unknown
Tags
Unknown

Event Timeline

This commit now requires audit.Jan 6 2020, 12:16 AM
foad added a subscriber: foad.Jan 6 2020, 2:03 AM

@ekatz this causes ninja check-llvm-unit to fail in my DEBUG build:

[0/1] Running lit suite /home/jayfoad2/git/llvm-project/llvm/test/Unit
FAIL: LLVM-Unit :: ADT/./ADTTests/APFloatTest.DecimalStringsWithoutNullTerminators (120 of 4322)
******************** TEST 'LLVM-Unit :: ADT/./ADTTests/APFloatTest.DecimalStringsWithoutNullTerminators' FAILED ********************
Note: Google Test filter = APFloatTest.DecimalStringsWithoutNullTerminators
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from APFloatTest
[ RUN      ] APFloatTest.DecimalStringsWithoutNullTerminators
Expected<T> must be checked before access or destruction.
Expected<T> value was in success state. (Note: Expected<T> values in success mode must still be checked prior to being destroyed).
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa69b99]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa69d49]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa68506]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa6a4eb]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f32d4fc7890]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f32d3a70e97]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f32d3a72801]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0x4db10b]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0x4daeed]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0x4dade9]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0x47f628]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa9909e]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa888c2]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa767f6]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa770b3]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa7760c]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa7cd51]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa9bc3e]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa8a222]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa7ca42]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa6eed1]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0xa6ee67]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f32d3a53b97]
/home/jayfoad2/llvm-debug/unittests/ADT/./ADTTests[0x46702a]

********************

Testing Time: 8.65s
********************
Failing Tests (1):
    LLVM-Unit :: ADT/./ADTTests/APFloatTest.DecimalStringsWithoutNullTerminators

  Expected Passes    : 4321
  Unexpected Failures: 1
FAILED: test/CMakeFiles/check-llvm-unit 
cd /home/jayfoad2/llvm-debug/test && /usr/bin/python2.7 /home/jayfoad2/llvm-debug/./bin/llvm-lit -sv /home/jayfoad2/git/llvm-project/llvm/test/Unit
ninja: build stopped: subcommand failed.
foad added a comment.Jan 6 2020, 2:05 AM

@ekatz it also causes these warnings when building the unit tests (with clang 6.0):

[1727/1959] Building CXX object unittests/ADT/CMakeFiles/ADTTests.dir/APFloatTest.cpp.o
/home/jayfoad2/git/llvm-project/llvm/unittests/ADT/APFloatTest.cpp:670:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
  Val.convertFromString(StringRef("0.00", 3),
  ^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
/home/jayfoad2/git/llvm-project/llvm/unittests/ADT/APFloatTest.cpp:673:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
  Val.convertFromString(StringRef("0.01", 3),
  ^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
/home/jayfoad2/git/llvm-project/llvm/unittests/ADT/APFloatTest.cpp:676:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
  Val.convertFromString(StringRef("0.09", 3),
  ^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
/home/jayfoad2/git/llvm-project/llvm/unittests/ADT/APFloatTest.cpp:679:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
  Val.convertFromString(StringRef("0.095", 4),
  ^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
/home/jayfoad2/git/llvm-project/llvm/unittests/ADT/APFloatTest.cpp:682:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
  Val.convertFromString(StringRef("0.00e+3", 7),
  ^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
/home/jayfoad2/git/llvm-project/llvm/unittests/ADT/APFloatTest.cpp:685:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
  Val.convertFromString(StringRef("0e+3", 4),
  ^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
6 warnings generated.