1570af302Sopenharmony_ci// commit 39dfd58417ef642307d90306e1c7e50aaec5a35c 2015-03-20
2570af302Sopenharmony_ci// backslash followed by high byte should be parsed as a normal sequence
3570af302Sopenharmony_ci#include <locale.h>
4570af302Sopenharmony_ci#include <regex.h>
5570af302Sopenharmony_ci#include "test.h"
6570af302Sopenharmony_ci
7570af302Sopenharmony_ciint main(void)
8570af302Sopenharmony_ci{
9570af302Sopenharmony_ci	char buf[200];
10570af302Sopenharmony_ci	regex_t r;
11570af302Sopenharmony_ci	int n;
12570af302Sopenharmony_ci
13570af302Sopenharmony_ci	setlocale(LC_CTYPE, "C.UTF-8");
14570af302Sopenharmony_ci
15570af302Sopenharmony_ci	// illegal sequence (not U+00FC)
16570af302Sopenharmony_ci	n = regcomp(&r, "\\\xfc", 0);
17570af302Sopenharmony_ci	if (n != REG_BADPAT) {
18570af302Sopenharmony_ci		regerror(n, &r, buf, sizeof buf);
19570af302Sopenharmony_ci		t_error("regcomp(\\\\\\xfc) returned %d (%s) wanted REG_BADPAT\n", n, buf);
20570af302Sopenharmony_ci	}
21570af302Sopenharmony_ci
22570af302Sopenharmony_ci	return t_status;
23570af302Sopenharmony_ci}
24