As reported in D96348 <https://reviews.llvm.org/D96348>, the
`Posix/regex_startend.cpp` test `FAIL`s on Solaris because
`REG_STARTEND` isn't defined. It's a BSD extension not present everywhere.
E.g. AIX doesn't have it, too.
Fixed by wrapping the test in `#ifdef REG_STARTEND`.
Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and
`x86_64-pc-linux-gnu`.
Differential Revision: https://reviews.llvm.org/D98425
#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];
printf("Successful test\n");
return 0;
}
+#else
+int main(void) {
+ return 0;
+}
+#endif