mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-26 05:18:46 +00:00
Reland "[libc] Add {,r}index"
Differential Revision: https://reviews.llvm.org/D147464
This commit is contained in:
parent
0beeadf203
commit
9c7a370505
@ -33,6 +33,7 @@ set(TARGET_LIBC_ENTRYPOINTS
|
||||
libc.src.string.bcmp
|
||||
libc.src.string.bcopy
|
||||
libc.src.string.bzero
|
||||
libc.src.string.index
|
||||
libc.src.string.memccpy
|
||||
libc.src.string.memchr
|
||||
libc.src.string.memcmp
|
||||
@ -41,6 +42,7 @@ set(TARGET_LIBC_ENTRYPOINTS
|
||||
libc.src.string.mempcpy
|
||||
libc.src.string.memrchr
|
||||
libc.src.string.memset
|
||||
libc.src.string.rindex
|
||||
libc.src.string.stpcpy
|
||||
libc.src.string.stpncpy
|
||||
libc.src.string.strcasecmp
|
||||
|
@ -24,6 +24,7 @@ set(TARGET_LIBC_ENTRYPOINTS
|
||||
libc.src.string.bcmp
|
||||
libc.src.string.bcopy
|
||||
libc.src.string.bzero
|
||||
libc.src.string.index
|
||||
libc.src.string.memccpy
|
||||
libc.src.string.memchr
|
||||
libc.src.string.memcmp
|
||||
@ -32,6 +33,7 @@ set(TARGET_LIBC_ENTRYPOINTS
|
||||
libc.src.string.mempcpy
|
||||
libc.src.string.memrchr
|
||||
libc.src.string.memset
|
||||
libc.src.string.rindex
|
||||
libc.src.string.stpcpy
|
||||
libc.src.string.stpncpy
|
||||
libc.src.string.strcasecmp
|
||||
|
@ -33,6 +33,7 @@ set(TARGET_LIBC_ENTRYPOINTS
|
||||
libc.src.string.bcmp
|
||||
libc.src.string.bcopy
|
||||
libc.src.string.bzero
|
||||
libc.src.string.index
|
||||
libc.src.string.memccpy
|
||||
libc.src.string.memchr
|
||||
libc.src.string.memcmp
|
||||
@ -41,6 +42,7 @@ set(TARGET_LIBC_ENTRYPOINTS
|
||||
libc.src.string.mempcpy
|
||||
libc.src.string.memrchr
|
||||
libc.src.string.memset
|
||||
libc.src.string.rindex
|
||||
libc.src.string.stpcpy
|
||||
libc.src.string.stpncpy
|
||||
libc.src.string.strcasecmp
|
||||
|
@ -33,6 +33,7 @@ set(TARGET_LIBC_ENTRYPOINTS
|
||||
libc.src.string.bcmp
|
||||
libc.src.string.bcopy
|
||||
libc.src.string.bzero
|
||||
libc.src.string.index
|
||||
libc.src.string.memccpy
|
||||
libc.src.string.memchr
|
||||
libc.src.string.memcmp
|
||||
@ -41,6 +42,7 @@ set(TARGET_LIBC_ENTRYPOINTS
|
||||
libc.src.string.mempcpy
|
||||
libc.src.string.memrchr
|
||||
libc.src.string.memset
|
||||
libc.src.string.rindex
|
||||
libc.src.string.stpcpy
|
||||
libc.src.string.stpncpy
|
||||
libc.src.string.strcasecmp
|
||||
|
@ -39,6 +39,16 @@ def BsdExtensions : StandardSpec<"BSDExtensions"> {
|
||||
RetValSpec<IntType>,
|
||||
[ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>, ArgSpec<SizeTType>]
|
||||
>,
|
||||
FunctionSpec<
|
||||
"index",
|
||||
RetValSpec<CharPtr>,
|
||||
[ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
|
||||
>,
|
||||
FunctionSpec<
|
||||
"rindex",
|
||||
RetValSpec<CharPtr>,
|
||||
[ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
|
||||
>,
|
||||
]
|
||||
>;
|
||||
|
||||
|
@ -31,6 +31,16 @@ add_entrypoint_object(
|
||||
bcopy.h
|
||||
)
|
||||
|
||||
add_entrypoint_object(
|
||||
index
|
||||
SRCS
|
||||
index.cpp
|
||||
HDRS
|
||||
index.h
|
||||
DEPENDS
|
||||
.string_utils
|
||||
)
|
||||
|
||||
add_entrypoint_object(
|
||||
memccpy
|
||||
SRCS
|
||||
@ -67,6 +77,16 @@ add_entrypoint_object(
|
||||
memrchr.h
|
||||
)
|
||||
|
||||
add_entrypoint_object(
|
||||
rindex
|
||||
SRCS
|
||||
rindex.cpp
|
||||
HDRS
|
||||
rindex.h
|
||||
DEPENDS
|
||||
.string_utils
|
||||
)
|
||||
|
||||
add_entrypoint_object(
|
||||
stpcpy
|
||||
SRCS
|
||||
|
@ -14,6 +14,23 @@ add_libc_unittest(
|
||||
LibcMemoryHelpers
|
||||
)
|
||||
|
||||
add_header_library(
|
||||
strchr_test_support
|
||||
HDRS
|
||||
StrchrTest.h
|
||||
)
|
||||
|
||||
add_libc_unittest(
|
||||
index_test
|
||||
SUITE
|
||||
libc_string_unittests
|
||||
SRCS
|
||||
index_test.cpp
|
||||
DEPENDS
|
||||
libc.src.string.index
|
||||
.strchr_test_support
|
||||
)
|
||||
|
||||
add_libc_unittest(
|
||||
memccpy_test
|
||||
SUITE
|
||||
@ -54,6 +71,17 @@ add_libc_unittest(
|
||||
libc.src.string.memrchr
|
||||
)
|
||||
|
||||
add_libc_unittest(
|
||||
rindex_test
|
||||
SUITE
|
||||
libc_string_unittests
|
||||
SRCS
|
||||
rindex_test.cpp
|
||||
DEPENDS
|
||||
libc.src.string.rindex
|
||||
.strchr_test_support
|
||||
)
|
||||
|
||||
add_libc_unittest(
|
||||
stpcpy_test
|
||||
SUITE
|
||||
@ -84,12 +112,6 @@ add_libc_unittest(
|
||||
libc.src.string.strcat
|
||||
)
|
||||
|
||||
add_header_library(
|
||||
strchr_test_support
|
||||
HDRS
|
||||
StrchrTest.h
|
||||
)
|
||||
|
||||
add_libc_unittest(
|
||||
strchr_test
|
||||
SUITE
|
||||
|
Loading…
x
Reference in New Issue
Block a user