1570af302Sopenharmony_ci// negated overlapping ranges in a regex bracket 2570af302Sopenharmony_ci// were not handled correctly by tre 3570af302Sopenharmony_ci#include <regex.h> 4570af302Sopenharmony_ci#include "test.h" 5570af302Sopenharmony_ci 6570af302Sopenharmony_ciint main(void) 7570af302Sopenharmony_ci{ 8570af302Sopenharmony_ci char buf[200]; 9570af302Sopenharmony_ci regex_t r; 10570af302Sopenharmony_ci int n; 11570af302Sopenharmony_ci 12570af302Sopenharmony_ci n = regcomp(&r, "[^aa-z]", 0); 13570af302Sopenharmony_ci if (n) { 14570af302Sopenharmony_ci regerror(n, &r, buf, sizeof buf); 15570af302Sopenharmony_ci t_error("regcomp returned %d (%s)\n", n, buf); 16570af302Sopenharmony_ci } 17570af302Sopenharmony_ci 18570af302Sopenharmony_ci n = regexec(&r, "k", 0, 0, 0); 19570af302Sopenharmony_ci if (n != REG_NOMATCH) { 20570af302Sopenharmony_ci regerror(n, &r, buf, sizeof buf); 21570af302Sopenharmony_ci t_error("regexec(/[^aa-z]/ ~ \"k\") returned %d (%s), wanted REG_NOMATCH\n", 22570af302Sopenharmony_ci n, buf); 23570af302Sopenharmony_ci } 24570af302Sopenharmony_ci 25570af302Sopenharmony_ci return t_status; 26570af302Sopenharmony_ci} 27