functional: add mntent test
[libc-test.git] / src / regression / regex-negated-range.c
blob50db523842402401c4f86e42e99e93db921617f0
1 // negated overlapping ranges in a regex bracket
2 // were not handled correctly by tre
3 #include <regex.h>
4 #include "test.h"
6 int main(void)
8 char buf[200];
9 regex_t r;
10 int n;
12 n = regcomp(&r, "[^aa-z]", 0);
13 if (n) {
14 regerror(n, &r, buf, sizeof buf);
15 t_error("regcomp returned %d (%s)\n", n, buf);
18 n = regexec(&r, "k", 0, 0, 0);
19 if (n != REG_NOMATCH) {
20 regerror(n, &r, buf, sizeof buf);
21 t_error("regexec(/[^aa-z]/ ~ \"k\") returned %d (%s), wanted REG_NOMATCH\n",
22 n, buf);
25 return t_status;