File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 6868// //////////////////////////////////////////////////////////////////////////////
6969// Errno checks.
7070
71+ #ifdef LIBC_TARGET_ARCH_IS_GPU
72+ #define ASSERT_ERRNO_EQ (VAL )
73+ #else
7174#define ASSERT_ERRNO_EQ (VAL ) ASSERT_EQ(VAL, static_cast <int >(errno))
75+ #endif
76+
77+ #ifdef LIBC_TARGET_ARCH_IS_GPU
78+ #define ASSERT_ERRNO_SUCCESS ()
79+ #else
7280#define ASSERT_ERRNO_SUCCESS () ASSERT_EQ(0 , static_cast <int >(errno))
81+ #endif
82+
83+ #ifdef LIBC_TARGET_ARCH_IS_GPU
84+ #define ASSERT_ERRNO_FAILURE ()
85+ #else
7386#define ASSERT_ERRNO_FAILURE () ASSERT_NE(0 , static_cast <int >(errno))
87+ #endif
7488
7589// Integration tests are compiled with -ffreestanding which stops treating
7690// the main function as a non-overloadable special function. Hence, we use a
Original file line number Diff line number Diff line change 1616// Define macro to validate the value stored in the errno and restore it
1717// to zero.
1818
19+ #ifdef LIBC_TARGET_ARCH_IS_GPU
20+ #define ASSERT_ERRNO_EQ (VAL )
21+ #else
1922#define ASSERT_ERRNO_EQ (VAL ) \
2023 do { \
2124 ASSERT_EQ (VAL, static_cast <int >(libc_errno)); \
2225 libc_errno = 0 ; \
2326 } while (0 )
27+ #endif
28+
29+ #ifdef LIBC_TARGET_ARCH_IS_GPU
30+ #define ASSERT_ERRNO_SUCCESS ()
31+ #else
2432#define ASSERT_ERRNO_SUCCESS () ASSERT_EQ(0 , static_cast <int >(libc_errno))
33+ #endif
34+
35+ #ifdef LIBC_TARGET_ARCH_IS_GPU
36+ #define ASSERT_ERRNO_FAILURE ()
37+ #else
2538#define ASSERT_ERRNO_FAILURE () \
2639 do { \
2740 ASSERT_NE (0 , static_cast <int >(libc_errno)); \
2841 libc_errno = 0 ; \
2942 } while (0 )
43+ #endif
3044
3145namespace LIBC_NAMESPACE_DECL {
3246namespace testing {
You can’t perform that action at this time.
0 commit comments