[PATCH] D98425: [sanitizer_common][test] Handle missing REG_STARTEND in Posix/regex_startend.cpp

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 17 01:56:54 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG3b8b5d1f22f2: [sanitizer_common][test] Handle missing REG_STARTEND in Posix/regex_startend.cpp (authored by ro).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98425/new/

https://reviews.llvm.org/D98425

Files:
  compiler-rt/test/sanitizer_common/TestCases/Posix/regex_startend.cpp


Index: compiler-rt/test/sanitizer_common/TestCases/Posix/regex_startend.cpp
===================================================================
--- compiler-rt/test/sanitizer_common/TestCases/Posix/regex_startend.cpp
+++ compiler-rt/test/sanitizer_common/TestCases/Posix/regex_startend.cpp
@@ -14,6 +14,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+/// REG_STARTEND is a BSD extension not supported everywhere.
+#ifdef REG_STARTEND
 void test_matched(const regex_t *preg, const char *string, size_t start,
                   size_t end, const char *expected) {
   regmatch_t match[1];
@@ -59,3 +61,8 @@
   printf("Successful test\n");
   return 0;
 }
+#else
+int main(void) {
+  return 0;
+}
+#endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98425.331180.patch
Type: text/x-patch
Size: 704 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210317/c54484ca/attachment.bin>


More information about the llvm-commits mailing list