2014-10-11 11:56:25 -04:00
|
|
|
# This test is run only when JIT support is available. It checks JIT complete
|
|
|
|
# and partial modes, and things that are different with JIT.
|
2014-10-06 13:28:42 -04:00
|
|
|
|
2014-10-11 11:56:25 -04:00
|
|
|
#pattern jitverify
|
2014-10-06 13:28:42 -04:00
|
|
|
|
2014-10-11 11:56:25 -04:00
|
|
|
# JIT does not support this pattern (callout at start of condition).
|
2014-10-06 13:28:42 -04:00
|
|
|
|
|
|
|
/(?(?C1)(?=a)a)/I
|
|
|
|
|
2014-10-11 11:56:25 -04:00
|
|
|
# Check that an infinite recursion loop is caught.
|
2014-10-06 13:28:42 -04:00
|
|
|
|
2014-10-11 11:56:25 -04:00
|
|
|
/(?(R)a*(?1)|((?R))b)/
|
2014-10-06 13:28:42 -04:00
|
|
|
aaaabcde
|
|
|
|
|
2014-10-11 11:56:25 -04:00
|
|
|
/abcd/I
|
2014-10-06 13:28:42 -04:00
|
|
|
abcd
|
|
|
|
xyz
|
|
|
|
|
2015-01-26 09:57:27 -05:00
|
|
|
/(*NO_JIT)abcd/I
|
|
|
|
abcd
|
|
|
|
xyz
|
|
|
|
|
2014-10-06 13:28:42 -04:00
|
|
|
/abcd/
|
|
|
|
abcd
|
|
|
|
ab\=ps
|
|
|
|
ab\=ph
|
|
|
|
xyz
|
|
|
|
|
2014-11-02 10:34:31 -05:00
|
|
|
/abcd/jitfast
|
|
|
|
abcd
|
|
|
|
ab\=ps
|
|
|
|
ab\=ph
|
|
|
|
xyz
|
|
|
|
|
2014-10-06 13:28:42 -04:00
|
|
|
/abcd/jit=1
|
|
|
|
abcd
|
|
|
|
ab\=ps
|
|
|
|
ab\=ph
|
|
|
|
xyz
|
|
|
|
xyz\=ps
|
|
|
|
|
2014-11-02 10:34:31 -05:00
|
|
|
/abcd/jit=1,jitfast
|
|
|
|
abcd
|
|
|
|
ab\=ps
|
|
|
|
ab\=ph
|
|
|
|
xyz
|
|
|
|
xyz\=ps
|
|
|
|
|
2014-10-06 13:28:42 -04:00
|
|
|
/abcd/jit=2
|
|
|
|
abcd
|
|
|
|
ab\=ps
|
|
|
|
ab\=ph
|
|
|
|
xyz
|
|
|
|
|
2014-11-02 10:34:31 -05:00
|
|
|
/abcd/jit=2,jitfast
|
|
|
|
abcd
|
|
|
|
ab\=ps
|
|
|
|
ab\=ph
|
|
|
|
xyz
|
|
|
|
|
2014-10-06 13:28:42 -04:00
|
|
|
/abcd/jit=3
|
|
|
|
abcd
|
|
|
|
ab\=ps
|
|
|
|
ab\=ph
|
|
|
|
xyz
|
|
|
|
|
|
|
|
/abcd/jit=4
|
|
|
|
abcd
|
|
|
|
ab\=ps
|
|
|
|
ab\=ph
|
|
|
|
xyz
|
|
|
|
|
|
|
|
/abcd/jit=5
|
|
|
|
abcd
|
|
|
|
ab\=ps
|
|
|
|
ab\=ph
|
|
|
|
xyz
|
|
|
|
|
|
|
|
/abcd/jit=6
|
|
|
|
abcd
|
|
|
|
ab\=ps
|
|
|
|
ab\=ph
|
|
|
|
xyz
|
|
|
|
|
|
|
|
/abcd/jit=7
|
|
|
|
abcd
|
|
|
|
ab\=ps
|
|
|
|
ab\=ph
|
|
|
|
xyz
|
|
|
|
|
|
|
|
/abcd/I,jit=2
|
|
|
|
|
|
|
|
/(*NO_START_OPT)a(*:m)b/mark
|
|
|
|
a
|
|
|
|
|
|
|
|
/^12345678abcd/m
|
|
|
|
12345678abcd
|
2014-10-11 11:56:25 -04:00
|
|
|
|
|
|
|
# Limits tests that give different output with JIT.
|
|
|
|
|
|
|
|
/(a+)*zz/I
|
|
|
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits
|
|
|
|
aaaaaaaaaaaaaz\=find_limits
|
|
|
|
|
|
|
|
!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
|
|
|
|
/* this is a C style comment */\=find_limits
|
|
|
|
|
|
|
|
/^(?>a)++/
|
|
|
|
aa\=find_limits
|
|
|
|
aaaaaaaaa\=find_limits
|
|
|
|
|
|
|
|
/(a)(?1)++/
|
|
|
|
aa\=find_limits
|
|
|
|
aaaaaaaaa\=find_limits
|
|
|
|
|
|
|
|
/a(?:.)*?a/ims
|
|
|
|
abbbbbbbbbbbbbbbbbbbbba\=find_limits
|
|
|
|
|
|
|
|
/a(?:.(*THEN))*?a/ims
|
|
|
|
abbbbbbbbbbbbbbbbbbbbba\=find_limits
|
2014-10-06 13:28:42 -04:00
|
|
|
|
2014-10-11 11:56:25 -04:00
|
|
|
/a(?:.(*THEN:ABC))*?a/ims
|
|
|
|
abbbbbbbbbbbbbbbbbbbbba\=find_limits
|
|
|
|
|
|
|
|
/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
|
|
|
|
aabbccddee\=find_limits
|
|
|
|
|
|
|
|
/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
|
|
|
|
aabbccddee\=find_limits
|
|
|
|
|
|
|
|
/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
|
|
|
|
aabbccddee\=find_limits
|
|
|
|
|
2014-11-02 10:34:31 -05:00
|
|
|
/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/jitfast
|
|
|
|
aabbccddee\=find_limits
|
|
|
|
aabbccddee\=jitstack=1
|
|
|
|
|
2014-10-11 11:56:25 -04:00
|
|
|
/(a+)*zz/
|
|
|
|
aaaaaaaaaaaaaz
|
|
|
|
aaaaaaaaaaaaaz\=match_limit=3000
|
|
|
|
|
|
|
|
/(*LIMIT_MATCH=3000)(a+)*zz/I
|
|
|
|
aaaaaaaaaaaaaz
|
|
|
|
aaaaaaaaaaaaaz\=match_limit=60000
|
|
|
|
|
|
|
|
/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
|
|
|
|
aaaaaaaaaaaaaz
|
|
|
|
|
|
|
|
/(*LIMIT_MATCH=60000)(a+)*zz/I
|
|
|
|
aaaaaaaaaaaaaz
|
|
|
|
aaaaaaaaaaaaaz\=match_limit=3000
|
|
|
|
|
|
|
|
# These three have infinitely nested recursions.
|
|
|
|
|
|
|
|
/((?2))((?1))/
|
|
|
|
abc
|
|
|
|
|
|
|
|
/((?(R2)a+|(?1)b))/
|
|
|
|
aaaabcde
|
|
|
|
|
|
|
|
/(?(R)a*(?1)|((?R))b)/
|
|
|
|
aaaabcde
|
|
|
|
|
2014-11-02 10:34:31 -05:00
|
|
|
# Invalid options disable JIT when called via pcre2_match(), causing the
|
|
|
|
# match to happen via the interpreter, but for fast JIT invalid options are
|
|
|
|
# ignored, so an unanchored match happens.
|
|
|
|
|
2015-01-23 11:51:47 -05:00
|
|
|
/abcd/
|
2014-11-02 10:34:31 -05:00
|
|
|
abcd\=anchored
|
|
|
|
fail abcd\=anchored
|
|
|
|
|
|
|
|
/abcd/jitfast
|
|
|
|
abcd\=anchored
|
|
|
|
succeed abcd\=anchored
|
|
|
|
|
2015-01-23 11:51:47 -05:00
|
|
|
# Push/pop does not lose the JIT information, though jitverify applies only to
|
|
|
|
# compilation, but serializing (save/load) discards JIT data completely.
|
|
|
|
|
|
|
|
/^abc\Kdef/info,push
|
|
|
|
#pop jitverify
|
|
|
|
abcdef
|
|
|
|
|
|
|
|
/^abc\Kdef/info,push
|
|
|
|
#save testsaved1
|
|
|
|
#load testsaved1
|
|
|
|
#pop jitverify
|
|
|
|
abcdef
|
|
|
|
|
|
|
|
#load testsaved1
|
|
|
|
#pop jit,jitverify
|
|
|
|
abcdef
|
|
|
|
|
2014-10-11 11:56:25 -04:00
|
|
|
# End of testinput16
|