| Age | Commit message (Collapse) | Author |
|
getrandom returns a ssize_t, but the error codes are defined as
integers. We need to use the builtin cast in the Fails matcher to ensure
that everything is the same type.
clang will warn about this in a bootstrapping build. Originally found in
\#155627.
|
|
See PR #132823 for a previous change to sys/epoll tests, and prior
changes before that.
ErrnoCheckingTest ensures that errno is properly reset at the beginning
of the test case, and is validated at the end of it. This change removes
many instances of manual errno manipulation.
|
|
|
|
Having libc_errno outside of the namespace causes versioning issues when
trying to link the tests against LLVM-libc. Most of this patch is just
moving libc_errno inside the namespace in tests. This isn't necessary in
the function implementations since those are already inside the
namespace.
|
|
This is step 4 of
https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079
|
|
Along the way, couple of additional things have been done:
1. Move `ErrnoSetterMatcher.h` to `test/UnitTest` as all other matchers live
there now.
2. `ErrnoSetterMatcher` ignores matching `errno` on GPUs.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D151129
|
|
`getrandom` is implemented as a syscall.
We don't want to test linux implementation of the syscall. We just want to verify that it reacts as expected to sensible values.
Runtime before
```
[ RUN ] LlvmLibcGetRandomTest.InvalidFlag
[ OK ] LlvmLibcGetRandomTest.InvalidFlag (took 0 ms)
[ RUN ] LlvmLibcGetRandomTest.InvalidBuffer
[ OK ] LlvmLibcGetRandomTest.InvalidBuffer (took 0 ms)
[ RUN ] LlvmLibcGetRandomTest.ReturnsSize
[ OK ] LlvmLibcGetRandomTest.ReturnsSize (took 83 ms)
[ RUN ] LlvmLibcGetRandomTest.PiEstimation
[ OK ] LlvmLibcGetRandomTest.PiEstimation (took 9882 ms)
```
Runtime after
```
[ RUN ] LlvmLibcGetRandomTest.InvalidFlag
[ OK ] LlvmLibcGetRandomTest.InvalidFlag (took 0 ms)
[ RUN ] LlvmLibcGetRandomTest.InvalidBuffer
[ OK ] LlvmLibcGetRandomTest.InvalidBuffer (took 0 ms)
[ RUN ] LlvmLibcGetRandomTest.ReturnsSize
[ OK ] LlvmLibcGetRandomTest.ReturnsSize (took 0 ms)
[ RUN ] LlvmLibcGetRandomTest.CheckValue
[ OK ] LlvmLibcGetRandomTest.CheckValue (took 0 ms)
```
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D151336
|
|
`getrandom` should return the number of bytes successfully set on
success, not `0`.
Reviewed By: sivachandra, michaelrj
Differential Revision: https://reviews.llvm.org/D147981
|
|
|
|
This part of the effort to make all test related pieces into the `test`
directory. This helps is excluding test related pieces in a straight
forward manner if LLVM_INCLUDE_TESTS is OFF. Future patches will also move
the MPFR wrapper and testutils into the 'test' directory.
|
|
Reviewed By: michaelrj, sivachandra
Differential Revision: https://reviews.llvm.org/D134665
|