/[pcre]/code/trunk/pcre_jit_test.c
ViewVC logotype

Diff of /code/trunk/pcre_jit_test.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1451 by zherczeg, Wed Jan 1 15:15:09 2014 UTC revision 1452 by zherczeg, Tue Jan 28 16:07:52 2014 UTC
# Line 392  static struct regression_test_case regre Line 392  static struct regression_test_case regre
392          { PCRE_MULTILINE | PCRE_NEWLINE_CRLF, 0, "\\W{0,2}[^#]{3}", "\r\n#....." },          { PCRE_MULTILINE | PCRE_NEWLINE_CRLF, 0, "\\W{0,2}[^#]{3}", "\r\n#....." },
393          { PCRE_MULTILINE | PCRE_NEWLINE_CR, 0, "\\W{0,2}[^#]{3}", "\r\n#....." },          { PCRE_MULTILINE | PCRE_NEWLINE_CR, 0, "\\W{0,2}[^#]{3}", "\r\n#....." },
394          { PCRE_MULTILINE | PCRE_NEWLINE_CRLF, 0, "\\W{1,3}[^#]", "\r\n##...." },          { PCRE_MULTILINE | PCRE_NEWLINE_CRLF, 0, "\\W{1,3}[^#]", "\r\n##...." },
395            { MUA | PCRE_NO_UTF8_CHECK, 1, "^.a", "\n\x80\nxa" },
396            { MUA, 1, "^", "\r\n" },
397            { PCRE_MULTILINE | PCRE_NEWLINE_CRLF, 1 | F_NOMATCH, "^", "\r\n" },
398            { PCRE_MULTILINE | PCRE_NEWLINE_CRLF, 1, "^", "\r\na" },
399    
400          /* Any character except newline or any newline. */          /* Any character except newline or any newline. */
401          { PCRE_NEWLINE_CRLF, 0, ".", "\r" },          { PCRE_NEWLINE_CRLF, 0, ".", "\r" },
# Line 650  static struct regression_test_case regre Line 654  static struct regression_test_case regre
654          { PCRE_MULTILINE | PCRE_UTF8 | PCRE_NEWLINE_CRLF | PCRE_FIRSTLINE, 0 | F_NOMATCH | F_PROPERTY, "\\p{Any}{4}|a", "\r\na" },          { PCRE_MULTILINE | PCRE_UTF8 | PCRE_NEWLINE_CRLF | PCRE_FIRSTLINE, 0 | F_NOMATCH | F_PROPERTY, "\\p{Any}{4}|a", "\r\na" },
655          { PCRE_MULTILINE | PCRE_UTF8 | PCRE_NEWLINE_CRLF | PCRE_FIRSTLINE, 1, ".", "\r\n" },          { PCRE_MULTILINE | PCRE_UTF8 | PCRE_NEWLINE_CRLF | PCRE_FIRSTLINE, 1, ".", "\r\n" },
656          { PCRE_FIRSTLINE | PCRE_NEWLINE_LF | PCRE_DOTALL, 0 | F_NOMATCH, "ab.", "ab" },          { PCRE_FIRSTLINE | PCRE_NEWLINE_LF | PCRE_DOTALL, 0 | F_NOMATCH, "ab.", "ab" },
657            { MUA | PCRE_FIRSTLINE, 1 | F_NOMATCH, "^[a-d0-9]", "\nxx\nd" },
658    
659          /* Recurse. */          /* Recurse. */
660          { MUA, 0, "(a)(?1)", "aa" },          { MUA, 0, "(a)(?1)", "aa" },
# Line 980  static int convert_utf8_to_utf16(const c Line 985  static int convert_utf8_to_utf16(const c
985                  if (offsetmap)                  if (offsetmap)
986                          *offsetmap++ = (int)(iptr - (unsigned char*)input);                          *offsetmap++ = (int)(iptr - (unsigned char*)input);
987    
988                  if (!(*iptr & 0x80))                  if (*iptr < 0xc0)
989                          c = *iptr++;                          c = *iptr++;
990                  else if (!(*iptr & 0x20)) {                  else if (!(*iptr & 0x20)) {
991                          c = ((iptr[0] & 0x1f) << 6) | (iptr[1] & 0x3f);                          c = ((iptr[0] & 0x1f) << 6) | (iptr[1] & 0x3f);
# Line 1052  static int convert_utf8_to_utf32(const c Line 1057  static int convert_utf8_to_utf32(const c
1057                  if (offsetmap)                  if (offsetmap)
1058                          *offsetmap++ = (int)(iptr - (unsigned char*)input);                          *offsetmap++ = (int)(iptr - (unsigned char*)input);
1059    
1060                  if (!(*iptr & 0x80))                  if (*iptr < 0xc0)
1061                          c = *iptr++;                          c = *iptr++;
1062                  else if (!(*iptr & 0x20)) {                  else if (!(*iptr & 0x20)) {
1063                          c = ((iptr[0] & 0x1f) << 6) | (iptr[1] & 0x3f);                          c = ((iptr[0] & 0x1f) << 6) | (iptr[1] & 0x3f);
# Line 1326  static int regression_tests(void) Line 1331  static int regression_tests(void)
1331                          if ((counter & 0x1) != 0) {                          if ((counter & 0x1) != 0) {
1332                                  setstack8(extra8);                                  setstack8(extra8);
1333                                  return_value8[0] = pcre_exec(re8, extra8, current->input, strlen(current->input), current->start_offset & OFFSET_MASK,                                  return_value8[0] = pcre_exec(re8, extra8, current->input, strlen(current->input), current->start_offset & OFFSET_MASK,
1334                                          current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector8_1, 32);                                          current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector8_1, 32);
1335                          } else                          } else
1336                                  return_value8[0] = pcre_jit_exec(re8, extra8, current->input, strlen(current->input), current->start_offset & OFFSET_MASK,                                  return_value8[0] = pcre_jit_exec(re8, extra8, current->input, strlen(current->input), current->start_offset & OFFSET_MASK,
1337                                          current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector8_1, 32, getstack8());                                          current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector8_1, 32, getstack8());
1338                          memset(&dummy_extra8, 0, sizeof(pcre_extra));                          memset(&dummy_extra8, 0, sizeof(pcre_extra));
1339                          dummy_extra8.flags = PCRE_EXTRA_MARK;                          dummy_extra8.flags = PCRE_EXTRA_MARK;
1340                          if (current->start_offset & F_STUDY) {                          if (current->start_offset & F_STUDY) {
# Line 1338  static int regression_tests(void) Line 1343  static int regression_tests(void)
1343                          }                          }
1344                          dummy_extra8.mark = &mark8_2;                          dummy_extra8.mark = &mark8_2;
1345                          return_value8[1] = pcre_exec(re8, &dummy_extra8, current->input, strlen(current->input), current->start_offset & OFFSET_MASK,                          return_value8[1] = pcre_exec(re8, &dummy_extra8, current->input, strlen(current->input), current->start_offset & OFFSET_MASK,
1346                                  current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector8_2, 32);                                  current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector8_2, 32);
1347                  }                  }
1348  #endif  #endif
1349    
# Line 1360  static int regression_tests(void) Line 1365  static int regression_tests(void)
1365                          if ((counter & 0x1) != 0) {                          if ((counter & 0x1) != 0) {
1366                                  setstack16(extra16);                                  setstack16(extra16);
1367                                  return_value16[0] = pcre16_exec(re16, extra16, regtest_buf16, length16, current->start_offset & OFFSET_MASK,                                  return_value16[0] = pcre16_exec(re16, extra16, regtest_buf16, length16, current->start_offset & OFFSET_MASK,
1368                                          current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector16_1, 32);                                          current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector16_1, 32);
1369                          } else                          } else
1370                                  return_value16[0] = pcre16_jit_exec(re16, extra16, regtest_buf16, length16, current->start_offset & OFFSET_MASK,                                  return_value16[0] = pcre16_jit_exec(re16, extra16, regtest_buf16, length16, current->start_offset & OFFSET_MASK,
1371                                          current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector16_1, 32, getstack16());                                          current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector16_1, 32, getstack16());
1372                          memset(&dummy_extra16, 0, sizeof(pcre16_extra));                          memset(&dummy_extra16, 0, sizeof(pcre16_extra));
1373                          dummy_extra16.flags = PCRE_EXTRA_MARK;                          dummy_extra16.flags = PCRE_EXTRA_MARK;
1374                          if (current->start_offset & F_STUDY) {                          if (current->start_offset & F_STUDY) {
# Line 1372  static int regression_tests(void) Line 1377  static int regression_tests(void)
1377                          }                          }
1378                          dummy_extra16.mark = &mark16_2;                          dummy_extra16.mark = &mark16_2;
1379                          return_value16[1] = pcre16_exec(re16, &dummy_extra16, regtest_buf16, length16, current->start_offset & OFFSET_MASK,                          return_value16[1] = pcre16_exec(re16, &dummy_extra16, regtest_buf16, length16, current->start_offset & OFFSET_MASK,
1380                                  current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector16_2, 32);                                  current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector16_2, 32);
1381                  }                  }
1382  #endif  #endif
1383    
# Line 1394  static int regression_tests(void) Line 1399  static int regression_tests(void)
1399                          if ((counter & 0x1) != 0) {                          if ((counter & 0x1) != 0) {
1400                                  setstack32(extra32);                                  setstack32(extra32);
1401                                  return_value32[0] = pcre32_exec(re32, extra32, regtest_buf32, length32, current->start_offset & OFFSET_MASK,                                  return_value32[0] = pcre32_exec(re32, extra32, regtest_buf32, length32, current->start_offset & OFFSET_MASK,
1402                                          current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector32_1, 32);                                          current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector32_1, 32);
1403                          } else                          } else
1404                                  return_value32[0] = pcre32_jit_exec(re32, extra32, regtest_buf32, length32, current->start_offset & OFFSET_MASK,                                  return_value32[0] = pcre32_jit_exec(re32, extra32, regtest_buf32, length32, current->start_offset & OFFSET_MASK,
1405                                          current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector32_1, 32, getstack32());                                          current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector32_1, 32, getstack32());
1406                          memset(&dummy_extra32, 0, sizeof(pcre32_extra));                          memset(&dummy_extra32, 0, sizeof(pcre32_extra));
1407                          dummy_extra32.flags = PCRE_EXTRA_MARK;                          dummy_extra32.flags = PCRE_EXTRA_MARK;
1408                          if (current->start_offset & F_STUDY) {                          if (current->start_offset & F_STUDY) {
# Line 1406  static int regression_tests(void) Line 1411  static int regression_tests(void)
1411                          }                          }
1412                          dummy_extra32.mark = &mark32_2;                          dummy_extra32.mark = &mark32_2;
1413                          return_value32[1] = pcre32_exec(re32, &dummy_extra32, regtest_buf32, length32, current->start_offset & OFFSET_MASK,                          return_value32[1] = pcre32_exec(re32, &dummy_extra32, regtest_buf32, length32, current->start_offset & OFFSET_MASK,
1414                                  current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector32_2, 32);                                  current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector32_2, 32);
1415                  }                  }
1416  #endif  #endif
1417    

Legend:
Removed from v.1451  
changed lines
  Added in v.1452

  ViewVC Help
Powered by ViewVC 1.1.5