restructured control flow tests

This commit is contained in:
Svetlana Isakova
2014-03-04 19:00:18 +04:00
parent fe349da4d5
commit ec47821567
85 changed files with 317 additions and 203 deletions
@@ -0,0 +1,995 @@
== t1 ==
fun t1() {
try {
1
} finally {
2
}
}
---------------------
L0:
<START>
mark({ try { 1 } finally { 2 } })
mark(try { 1 } finally { 2 })
jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 })]
mark({ 1 })
r(1)
jmp(L3 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
L2 [onExceptionToFinallyBlock]:
L4 [start finally]:
mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
r(2)
L5 [finish finally]:
jmp(error) NEXT:[<ERROR>]
L3 [skipFinallyToErrorBlock]:
mark({ 2 }) PREV:[jmp(L3 [skipFinallyToErrorBlock])]
r(2)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t2 ==
fun t2() {
try {
1
if (2 > 3) {
return
}
} finally {
2
}
}
---------------------
L0:
<START>
mark({ try { 1 if (2 > 3) { return } } finally { 2 } })
mark(try { 1 if (2 > 3) { return } } finally { 2 })
jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { return } })]
mark({ 1 if (2 > 3) { return } })
r(1)
mark(if (2 > 3) { return })
mark(2 > 3)
r(2)
r(3)
call(>, compareTo)
jf(L3) NEXT:[read (Unit), mark({ return })]
mark({ return })
L4 [start finally]:
mark({ 2 })
r(2)
L5 [finish finally]:
ret L1 NEXT:[<END>]
- jmp(L6) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[]
L3:
read (Unit) PREV:[jf(L3)]
L6:
jmp(L7 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
L2 [onExceptionToFinallyBlock]:
mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
r(2)
jmp(error) NEXT:[<ERROR>]
L7 [skipFinallyToErrorBlock]:
mark({ 2 }) PREV:[jmp(L7 [skipFinallyToErrorBlock])]
r(2)
L1:
<END> NEXT:[<SINK>] PREV:[ret L1, r(2)]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t3 ==
fun t3() {
try {
1
@{ () ->
if (2 > 3) {
return@
}
}
} finally {
2
}
}
---------------------
L0:
<START>
mark({ try { 1 @{ () -> if (2 > 3) { return@ } } } finally { 2 } })
mark(try { 1 @{ () -> if (2 > 3) { return@ } } } finally { 2 })
jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 @{ () -> if (2 > 3) { return@ } } })]
mark({ 1 @{ () -> if (2 > 3) { return@ } } })
r(1)
mark(@{ () -> if (2 > 3) { return@ } })
mark({ () -> if (2 > 3) { return@ } })
jmp?(L3) NEXT:[r({ () -> if (2 > 3) { return@ } }), d({ () -> if (2 > 3) { return@ } })]
d({ () -> if (2 > 3) { return@ } }) NEXT:[<SINK>]
L3:
r({ () -> if (2 > 3) { return@ } }) PREV:[jmp?(L3)]
jmp(L8 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
L2 [onExceptionToFinallyBlock]:
L9 [start finally]:
mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
r(2)
L10 [finish finally]:
jmp(error) NEXT:[<ERROR>]
L8 [skipFinallyToErrorBlock]:
mark({ 2 }) PREV:[jmp(L8 [skipFinallyToErrorBlock])]
r(2)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>, d({ () -> if (2 > 3) { return@ } })]
L4:
<START>
mark(if (2 > 3) { return@ })
mark(if (2 > 3) { return@ })
mark(2 > 3)
r(2)
r(3)
call(>, compareTo)
jf(L6) NEXT:[read (Unit), mark({ return@ })]
mark({ return@ })
ret L5 NEXT:[<END>]
- jmp(L7) NEXT:[<END>] PREV:[]
L6:
read (Unit) PREV:[jf(L6)]
L5:
L7:
<END> NEXT:[<SINK>] PREV:[ret L5, read (Unit)]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== anonymous_0 ==
{ () ->
if (2 > 3) {
return@
}
}
---------------------
L4:
<START>
mark(if (2 > 3) { return@ })
mark(if (2 > 3) { return@ })
mark(2 > 3)
r(2)
r(3)
call(>, compareTo)
jf(L6) NEXT:[read (Unit), mark({ return@ })]
mark({ return@ })
ret L5 NEXT:[<END>]
- jmp(L7) NEXT:[<END>] PREV:[]
L6:
read (Unit) PREV:[jf(L6)]
L5:
L7:
<END> NEXT:[<SINK>] PREV:[ret L5, read (Unit)]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t4 ==
fun t4() {
@{ () ->
try {
1
if (2 > 3) {
return@
}
} finally {
2
}
}
}
---------------------
L0:
<START>
mark({ @{ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } } })
mark(@{ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } })
mark({ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } })
jmp?(L2) NEXT:[r({ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } }), d({ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } })]
d({ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } }) NEXT:[<SINK>]
L2:
r({ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } }) PREV:[jmp?(L2)]
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>, d({ () -> try { 1 if (2 > 3) { return@ } } finally { 2 } })]
L3:
<START>
mark(try { 1 if (2 > 3) { return@ } } finally { 2 })
mark(try { 1 if (2 > 3) { return@ } } finally { 2 })
jmp?(L5 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { return@ } })]
mark({ 1 if (2 > 3) { return@ } })
r(1)
mark(if (2 > 3) { return@ })
mark(2 > 3)
r(2)
r(3)
call(>, compareTo)
jf(L6) NEXT:[read (Unit), mark({ return@ })]
mark({ return@ })
L7 [start finally]:
mark({ 2 })
r(2)
L8 [finish finally]:
ret L4 NEXT:[<END>]
- jmp(L9) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[]
L6:
read (Unit) PREV:[jf(L6)]
L9:
jmp(L10 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
L5 [onExceptionToFinallyBlock]:
mark({ 2 }) PREV:[jmp?(L5 [onExceptionToFinallyBlock])]
r(2)
jmp(error) NEXT:[<ERROR>]
L10 [skipFinallyToErrorBlock]:
mark({ 2 }) PREV:[jmp(L10 [skipFinallyToErrorBlock])]
r(2)
L4:
<END> NEXT:[<SINK>] PREV:[ret L4, r(2)]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== anonymous_1 ==
{ () ->
try {
1
if (2 > 3) {
return@
}
} finally {
2
}
}
---------------------
L3:
<START>
mark(try { 1 if (2 > 3) { return@ } } finally { 2 })
mark(try { 1 if (2 > 3) { return@ } } finally { 2 })
jmp?(L5 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { return@ } })]
mark({ 1 if (2 > 3) { return@ } })
r(1)
mark(if (2 > 3) { return@ })
mark(2 > 3)
r(2)
r(3)
call(>, compareTo)
jf(L6) NEXT:[read (Unit), mark({ return@ })]
mark({ return@ })
L7 [start finally]:
mark({ 2 })
r(2)
L8 [finish finally]:
ret L4 NEXT:[<END>]
- jmp(L9) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[]
L6:
read (Unit) PREV:[jf(L6)]
L9:
jmp(L10 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
L5 [onExceptionToFinallyBlock]:
mark({ 2 }) PREV:[jmp?(L5 [onExceptionToFinallyBlock])]
r(2)
jmp(error) NEXT:[<ERROR>]
L10 [skipFinallyToErrorBlock]:
mark({ 2 }) PREV:[jmp(L10 [skipFinallyToErrorBlock])]
r(2)
L4:
<END> NEXT:[<SINK>] PREV:[ret L4, r(2)]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t5 ==
fun t5() {
@ while(true) {
try {
1
if (2 > 3) {
break @
}
} finally {
2
}
}
}
---------------------
L0:
<START>
mark({ @ while(true) { try { 1 if (2 > 3) { break @ } } finally { 2 } } })
mark(@ while(true) { try { 1 if (2 > 3) { break @ } } finally { 2 } })
mark(while(true) { try { 1 if (2 > 3) { break @ } } finally { 2 } })
L2 [loop entry point]:
L5 [condition entry point]:
r(true) PREV:[mark(while(true) { try { 1 if (2 > 3) { break @ } } finally { 2 } }), jmp(L2 [loop entry point])]
L4 [body entry point]:
mark({ try { 1 if (2 > 3) { break @ } } finally { 2 } })
mark(try { 1 if (2 > 3) { break @ } } finally { 2 })
jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { break @ } })]
mark({ 1 if (2 > 3) { break @ } })
r(1)
mark(if (2 > 3) { break @ })
mark(2 > 3)
r(2)
r(3)
call(>, compareTo)
jf(L7) NEXT:[read (Unit), mark({ break @ })]
mark({ break @ })
L8 [start finally]:
mark({ 2 })
r(2)
L9 [finish finally]:
jmp(L3 [loop exit point]) NEXT:[read (Unit)]
- jmp(L10) NEXT:[jmp(L11 [skipFinallyToErrorBlock])] PREV:[]
L7:
read (Unit) PREV:[jf(L7)]
L10:
jmp(L11 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
L6 [onExceptionToFinallyBlock]:
mark({ 2 }) PREV:[jmp?(L6 [onExceptionToFinallyBlock])]
r(2)
jmp(error) NEXT:[<ERROR>]
L11 [skipFinallyToErrorBlock]:
mark({ 2 }) PREV:[jmp(L11 [skipFinallyToErrorBlock])]
r(2)
jmp(L2 [loop entry point]) NEXT:[r(true)]
L3 [loop exit point]:
read (Unit) PREV:[jmp(L3 [loop exit point])]
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t6 ==
fun t6() {
try {
@ while(true) {
1
if (2 > 3) {
break @
}
}
5
} finally {
2
}
}
---------------------
L0:
<START>
mark({ try { @ while(true) { 1 if (2 > 3) { break @ } } 5 } finally { 2 } })
mark(try { @ while(true) { 1 if (2 > 3) { break @ } } 5 } finally { 2 })
jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ @ while(true) { 1 if (2 > 3) { break @ } } 5 })]
mark({ @ while(true) { 1 if (2 > 3) { break @ } } 5 })
mark(@ while(true) { 1 if (2 > 3) { break @ } })
mark(while(true) { 1 if (2 > 3) { break @ } })
L3 [loop entry point]:
L6 [condition entry point]:
r(true) PREV:[mark(while(true) { 1 if (2 > 3) { break @ } }), jmp(L3 [loop entry point])]
L5 [body entry point]:
mark({ 1 if (2 > 3) { break @ } })
r(1)
mark(if (2 > 3) { break @ })
mark(2 > 3)
r(2)
r(3)
call(>, compareTo)
jf(L7) NEXT:[read (Unit), mark({ break @ })]
mark({ break @ })
jmp(L4 [loop exit point]) NEXT:[read (Unit)]
- jmp(L8) NEXT:[jmp(L3 [loop entry point])] PREV:[]
L7:
read (Unit) PREV:[jf(L7)]
L8:
jmp(L3 [loop entry point]) NEXT:[r(true)]
L4 [loop exit point]:
read (Unit) PREV:[jmp(L4 [loop exit point])]
r(5)
jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
L2 [onExceptionToFinallyBlock]:
L10 [start finally]:
mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
r(2)
L11 [finish finally]:
jmp(error) NEXT:[<ERROR>]
L9 [skipFinallyToErrorBlock]:
mark({ 2 }) PREV:[jmp(L9 [skipFinallyToErrorBlock])]
r(2)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t7 ==
fun t7() {
try {
@ while(true) {
1
if (2 > 3) {
break @
}
}
} finally {
2
}
}
---------------------
L0:
<START>
mark({ try { @ while(true) { 1 if (2 > 3) { break @ } } } finally { 2 } })
mark(try { @ while(true) { 1 if (2 > 3) { break @ } } } finally { 2 })
jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ @ while(true) { 1 if (2 > 3) { break @ } } })]
mark({ @ while(true) { 1 if (2 > 3) { break @ } } })
mark(@ while(true) { 1 if (2 > 3) { break @ } })
mark(while(true) { 1 if (2 > 3) { break @ } })
L3 [loop entry point]:
L6 [condition entry point]:
r(true) PREV:[mark(while(true) { 1 if (2 > 3) { break @ } }), jmp(L3 [loop entry point])]
L5 [body entry point]:
mark({ 1 if (2 > 3) { break @ } })
r(1)
mark(if (2 > 3) { break @ })
mark(2 > 3)
r(2)
r(3)
call(>, compareTo)
jf(L7) NEXT:[read (Unit), mark({ break @ })]
mark({ break @ })
jmp(L4 [loop exit point]) NEXT:[read (Unit)]
- jmp(L8) NEXT:[jmp(L3 [loop entry point])] PREV:[]
L7:
read (Unit) PREV:[jf(L7)]
L8:
jmp(L3 [loop entry point]) NEXT:[r(true)]
L4 [loop exit point]:
read (Unit) PREV:[jmp(L4 [loop exit point])]
jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
L2 [onExceptionToFinallyBlock]:
L10 [start finally]:
mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
r(2)
L11 [finish finally]:
jmp(error) NEXT:[<ERROR>]
L9 [skipFinallyToErrorBlock]:
mark({ 2 }) PREV:[jmp(L9 [skipFinallyToErrorBlock])]
r(2)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t8 ==
fun t8(a : Int) {
@ for (i in 1..a) {
try {
1
if (2 > 3) {
continue @
}
} finally {
2
}
}
}
---------------------
L0:
<START>
v(a : Int)
w(a)
mark({ @ for (i in 1..a) { try { 1 if (2 > 3) { continue @ } } finally { 2 } } })
mark(@ for (i in 1..a) { try { 1 if (2 > 3) { continue @ } } finally { 2 } })
mark(for (i in 1..a) { try { 1 if (2 > 3) { continue @ } } finally { 2 } })
mark(1..a)
r(1)
r(a)
call(.., rangeTo)
v(i)
w(i)
L3:
jmp?(L2) NEXT:[read (Unit), mark({ try { 1 if (2 > 3) { continue @ } } finally { 2 } })]
L4 [loop entry point]:
L5 [body entry point]:
mark({ try { 1 if (2 > 3) { continue @ } } finally { 2 } }) PREV:[jmp?(L2), jmp(L4 [loop entry point]), jmp?(L4 [loop entry point])]
mark(try { 1 if (2 > 3) { continue @ } } finally { 2 })
jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { continue @ } })]
mark({ 1 if (2 > 3) { continue @ } })
r(1)
mark(if (2 > 3) { continue @ })
mark(2 > 3)
r(2)
r(3)
call(>, compareTo)
jf(L7) NEXT:[read (Unit), mark({ continue @ })]
mark({ continue @ })
L8 [start finally]:
mark({ 2 })
r(2)
L9 [finish finally]:
jmp(L4 [loop entry point]) NEXT:[mark({ try { 1 if (2 > 3) { continue @ } } finally { 2 } })]
- jmp(L10) NEXT:[jmp(L11 [skipFinallyToErrorBlock])] PREV:[]
L7:
read (Unit) PREV:[jf(L7)]
L10:
jmp(L11 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
L6 [onExceptionToFinallyBlock]:
mark({ 2 }) PREV:[jmp?(L6 [onExceptionToFinallyBlock])]
r(2)
jmp(error) NEXT:[<ERROR>]
L11 [skipFinallyToErrorBlock]:
mark({ 2 }) PREV:[jmp(L11 [skipFinallyToErrorBlock])]
r(2)
jmp?(L4 [loop entry point]) NEXT:[mark({ try { 1 if (2 > 3) { continue @ } } finally { 2 } }), read (Unit)]
L2:
read (Unit) PREV:[jmp?(L2), jmp?(L4 [loop entry point])]
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t9 ==
fun t9(a : Int) {
try {
@ for (i in 1..a) {
1
if (2 > 3) {
continue @
}
}
5
} finally {
2
}
}
---------------------
L0:
<START>
v(a : Int)
w(a)
mark({ try { @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } 5 } finally { 2 } })
mark(try { @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } 5 } finally { 2 })
jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } 5 })]
mark({ @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } 5 })
mark(@ for (i in 1..a) { 1 if (2 > 3) { continue @ } })
mark(for (i in 1..a) { 1 if (2 > 3) { continue @ } })
mark(1..a)
r(1)
r(a)
call(.., rangeTo)
v(i)
w(i)
L4:
jmp?(L3) NEXT:[read (Unit), mark({ 1 if (2 > 3) { continue @ } })]
L5 [loop entry point]:
L6 [body entry point]:
mark({ 1 if (2 > 3) { continue @ } }) PREV:[jmp?(L3), jmp(L5 [loop entry point]), jmp?(L5 [loop entry point])]
r(1)
mark(if (2 > 3) { continue @ })
mark(2 > 3)
r(2)
r(3)
call(>, compareTo)
jf(L7) NEXT:[read (Unit), mark({ continue @ })]
mark({ continue @ })
jmp(L5 [loop entry point]) NEXT:[mark({ 1 if (2 > 3) { continue @ } })]
- jmp(L8) NEXT:[jmp?(L5 [loop entry point])] PREV:[]
L7:
read (Unit) PREV:[jf(L7)]
L8:
jmp?(L5 [loop entry point]) NEXT:[mark({ 1 if (2 > 3) { continue @ } }), read (Unit)]
L3:
read (Unit) PREV:[jmp?(L3), jmp?(L5 [loop entry point])]
r(5)
jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
L2 [onExceptionToFinallyBlock]:
L10 [start finally]:
mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
r(2)
L11 [finish finally]:
jmp(error) NEXT:[<ERROR>]
L9 [skipFinallyToErrorBlock]:
mark({ 2 }) PREV:[jmp(L9 [skipFinallyToErrorBlock])]
r(2)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t10 ==
fun t10(a : Int) {
try {
@ for (i in 1..a) {
1
if (2 > 3) {
continue @
}
}
} finally {
2
}
}
---------------------
L0:
<START>
v(a : Int)
w(a)
mark({ try { @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } } finally { 2 } })
mark(try { @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } } finally { 2 })
jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } })]
mark({ @ for (i in 1..a) { 1 if (2 > 3) { continue @ } } })
mark(@ for (i in 1..a) { 1 if (2 > 3) { continue @ } })
mark(for (i in 1..a) { 1 if (2 > 3) { continue @ } })
mark(1..a)
r(1)
r(a)
call(.., rangeTo)
v(i)
w(i)
L4:
jmp?(L3) NEXT:[read (Unit), mark({ 1 if (2 > 3) { continue @ } })]
L5 [loop entry point]:
L6 [body entry point]:
mark({ 1 if (2 > 3) { continue @ } }) PREV:[jmp?(L3), jmp(L5 [loop entry point]), jmp?(L5 [loop entry point])]
r(1)
mark(if (2 > 3) { continue @ })
mark(2 > 3)
r(2)
r(3)
call(>, compareTo)
jf(L7) NEXT:[read (Unit), mark({ continue @ })]
mark({ continue @ })
jmp(L5 [loop entry point]) NEXT:[mark({ 1 if (2 > 3) { continue @ } })]
- jmp(L8) NEXT:[jmp?(L5 [loop entry point])] PREV:[]
L7:
read (Unit) PREV:[jf(L7)]
L8:
jmp?(L5 [loop entry point]) NEXT:[mark({ 1 if (2 > 3) { continue @ } }), read (Unit)]
L3:
read (Unit) PREV:[jmp?(L3), jmp?(L5 [loop entry point])]
jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
L2 [onExceptionToFinallyBlock]:
L10 [start finally]:
mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
r(2)
L11 [finish finally]:
jmp(error) NEXT:[<ERROR>]
L9 [skipFinallyToErrorBlock]:
mark({ 2 }) PREV:[jmp(L9 [skipFinallyToErrorBlock])]
r(2)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t11 ==
fun t11() {
try {
return 1
}
finally {
return 2
}
}
---------------------
L0:
<START>
mark({ try { return 1 } finally { return 2 } })
mark(try { return 1 } finally { return 2 })
jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ return 2 }), mark({ return 1 })]
mark({ return 1 })
r(1)
L3 [start finally]:
mark({ return 2 })
r(2)
ret(*) L1 NEXT:[<END>]
L4 [finish finally]:
- ret(*) L1 NEXT:[<END>] PREV:[]
- jmp(L5 [skipFinallyToErrorBlock]) NEXT:[mark({ return 2 })] PREV:[]
L2 [onExceptionToFinallyBlock]:
mark({ return 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
r(2)
ret(*) L1 NEXT:[<END>]
- jmp(error) NEXT:[<ERROR>] PREV:[]
L5 [skipFinallyToErrorBlock]:
- mark({ return 2 }) PREV:[]
- r(2) PREV:[]
- ret(*) L1 PREV:[]
L1:
<END> NEXT:[<SINK>] PREV:[ret(*) L1, ret(*) L1]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t12 ==
fun t12() : Int {
try {
return 1
}
finally {
doSmth(3)
}
}
---------------------
L0:
<START>
mark({ try { return 1 } finally { doSmth(3) } })
mark(try { return 1 } finally { doSmth(3) })
jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ doSmth(3) }), mark({ return 1 })]
mark({ return 1 })
r(1)
L3 [start finally]:
mark({ doSmth(3) })
mark(doSmth(3))
r(3)
call(doSmth, doSmth)
L4 [finish finally]:
ret(*) L1 NEXT:[<END>]
- jmp(L5 [skipFinallyToErrorBlock]) NEXT:[mark({ doSmth(3) })] PREV:[]
L2 [onExceptionToFinallyBlock]:
mark({ doSmth(3) }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
mark(doSmth(3))
r(3)
call(doSmth, doSmth)
jmp(error) NEXT:[<ERROR>]
L5 [skipFinallyToErrorBlock]:
- mark({ doSmth(3) }) PREV:[]
- mark(doSmth(3)) PREV:[]
- r(3) PREV:[]
- call(doSmth, doSmth) PREV:[]
L1:
<END> NEXT:[<SINK>] PREV:[ret(*) L1]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t13 ==
fun t13() : Int {
try {
return 1
}
catch (e: UnsupportedOperationException) {
doSmth(2)
}
finally {
doSmth(3)
}
}
---------------------
L0:
<START>
mark({ try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } finally { doSmth(3) } })
mark(try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } finally { doSmth(3) })
jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])]
jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ doSmth(3) }), mark({ return 1 })]
mark({ return 1 })
r(1)
L4 [start finally]:
mark({ doSmth(3) })
mark(doSmth(3))
r(3)
call(doSmth, doSmth)
L5 [finish finally]:
ret(*) L1 NEXT:[<END>]
- jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[]
L2 [onException]:
v(e: UnsupportedOperationException) PREV:[jmp?(L2 [onException])]
w(e)
mark({ doSmth(2) })
mark(doSmth(2))
r(2)
call(doSmth, doSmth)
jmp(L6 [afterCatches])
L6 [afterCatches]:
jmp(L7 [skipFinallyToErrorBlock]) NEXT:[mark({ doSmth(3) })]
L3 [onExceptionToFinallyBlock]:
mark({ doSmth(3) }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])]
mark(doSmth(3))
r(3)
call(doSmth, doSmth)
jmp(error) NEXT:[<ERROR>]
L7 [skipFinallyToErrorBlock]:
mark({ doSmth(3) }) PREV:[jmp(L7 [skipFinallyToErrorBlock])]
mark(doSmth(3))
r(3)
call(doSmth, doSmth)
L1:
<END> NEXT:[<SINK>] PREV:[ret(*) L1, call(doSmth, doSmth)]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t14 ==
fun t14() : Int {
try {
return 1
}
catch (e: UnsupportedOperationException) {
doSmth(2)
}
}
---------------------
L0:
<START>
mark({ try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } })
mark(try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) })
jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), mark({ return 1 })]
mark({ return 1 })
r(1)
ret(*) L1 NEXT:[<END>]
- jmp(L3 [afterCatches]) NEXT:[<END>] PREV:[]
L2 [onException]:
v(e: UnsupportedOperationException) PREV:[jmp?(L2 [onException])]
w(e)
mark({ doSmth(2) })
mark(doSmth(2))
r(2)
call(doSmth, doSmth)
jmp(L3 [afterCatches])
L1:
L3 [afterCatches]:
<END> NEXT:[<SINK>] PREV:[ret(*) L1, jmp(L3 [afterCatches])]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t15 ==
fun t15() : Int {
try {
return 1
}
catch (e: UnsupportedOperationException) {
return 2
}
finally {
doSmth(3)
}
}
---------------------
L0:
<START>
mark({ try { return 1 } catch (e: UnsupportedOperationException) { return 2 } finally { doSmth(3) } })
mark(try { return 1 } catch (e: UnsupportedOperationException) { return 2 } finally { doSmth(3) })
jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])]
jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ doSmth(3) }), mark({ return 1 })]
mark({ return 1 })
r(1)
L4 [start finally]:
mark({ doSmth(3) })
mark(doSmth(3))
r(3)
call(doSmth, doSmth)
L5 [finish finally]:
ret(*) L1 NEXT:[<END>]
- jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[]
L2 [onException]:
v(e: UnsupportedOperationException) PREV:[jmp?(L2 [onException])]
w(e)
mark({ return 2 })
r(2)
mark({ doSmth(3) })
mark(doSmth(3))
r(3)
call(doSmth, doSmth)
ret(*) L1 NEXT:[<END>]
- jmp(L6 [afterCatches]) PREV:[]
L6 [afterCatches]:
- jmp(L7 [skipFinallyToErrorBlock]) NEXT:[mark({ doSmth(3) })] PREV:[]
L3 [onExceptionToFinallyBlock]:
mark({ doSmth(3) }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])]
mark(doSmth(3))
r(3)
call(doSmth, doSmth)
jmp(error) NEXT:[<ERROR>]
L7 [skipFinallyToErrorBlock]:
- mark({ doSmth(3) }) PREV:[]
- mark(doSmth(3)) PREV:[]
- r(3) PREV:[]
- call(doSmth, doSmth) PREV:[]
L1:
<END> NEXT:[<SINK>] PREV:[ret(*) L1, ret(*) L1]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t16 ==
fun t16() : Int {
try {
doSmth(1)
}
catch (e: UnsupportedOperationException) {
return 2
}
finally {
doSmth(3)
}
}
---------------------
L0:
<START>
mark({ try { doSmth(1) } catch (e: UnsupportedOperationException) { return 2 } finally { doSmth(3) } })
mark(try { doSmth(1) } catch (e: UnsupportedOperationException) { return 2 } finally { doSmth(3) })
jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])]
jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ doSmth(3) }), mark({ doSmth(1) })]
mark({ doSmth(1) })
mark(doSmth(1))
r(1)
call(doSmth, doSmth)
jmp(L4 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])]
L2 [onException]:
v(e: UnsupportedOperationException) PREV:[jmp?(L2 [onException])]
w(e)
mark({ return 2 })
r(2)
L5 [start finally]:
mark({ doSmth(3) })
mark(doSmth(3))
r(3)
call(doSmth, doSmth)
L6 [finish finally]:
ret(*) L1 NEXT:[<END>]
- jmp(L4 [afterCatches]) PREV:[]
L4 [afterCatches]:
jmp(L7 [skipFinallyToErrorBlock]) NEXT:[mark({ doSmth(3) })] PREV:[jmp(L4 [afterCatches])]
L3 [onExceptionToFinallyBlock]:
mark({ doSmth(3) }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])]
mark(doSmth(3))
r(3)
call(doSmth, doSmth)
jmp(error) NEXT:[<ERROR>]
L7 [skipFinallyToErrorBlock]:
mark({ doSmth(3) }) PREV:[jmp(L7 [skipFinallyToErrorBlock])]
mark(doSmth(3))
r(3)
call(doSmth, doSmth)
L1:
<END> NEXT:[<SINK>] PREV:[ret(*) L1, call(doSmth, doSmth)]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== doSmth ==
fun doSmth(i: Int) {
}
---------------------
L0:
<START>
v(i: Int)
w(i)
mark({ })
read (Unit)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
@@ -0,0 +1,191 @@
fun t1() {
try {
1
} finally {
2
}
}
fun t2() {
try {
1
if (2 > 3) {
return
}
} finally {
2
}
}
fun t3() {
try {
1
@{ () ->
if (2 > 3) {
return@
}
}
} finally {
2
}
}
fun t4() {
@{ () ->
try {
1
if (2 > 3) {
return@
}
} finally {
2
}
}
}
fun t5() {
@ while(true) {
try {
1
if (2 > 3) {
break @
}
} finally {
2
}
}
}
fun t6() {
try {
@ while(true) {
1
if (2 > 3) {
break @
}
}
5
} finally {
2
}
}
fun t7() {
try {
@ while(true) {
1
if (2 > 3) {
break @
}
}
} finally {
2
}
}
fun t8(a : Int) {
@ for (i in 1..a) {
try {
1
if (2 > 3) {
continue @
}
} finally {
2
}
}
}
fun t9(a : Int) {
try {
@ for (i in 1..a) {
1
if (2 > 3) {
continue @
}
}
5
} finally {
2
}
}
fun t10(a : Int) {
try {
@ for (i in 1..a) {
1
if (2 > 3) {
continue @
}
}
} finally {
2
}
}
fun t11() {
try {
return 1
}
finally {
return 2
}
}
fun t12() : Int {
try {
return 1
}
finally {
doSmth(3)
}
}
fun t13() : Int {
try {
return 1
}
catch (e: UnsupportedOperationException) {
doSmth(2)
}
finally {
doSmth(3)
}
}
fun t14() : Int {
try {
return 1
}
catch (e: UnsupportedOperationException) {
doSmth(2)
}
}
fun t15() : Int {
try {
return 1
}
catch (e: UnsupportedOperationException) {
return 2
}
finally {
doSmth(3)
}
}
fun t16() : Int {
try {
doSmth(1)
}
catch (e: UnsupportedOperationException) {
return 2
}
finally {
doSmth(3)
}
}
fun doSmth(i: Int) {
}
@@ -0,0 +1,335 @@
== doSmth ==
fun doSmth() {}
---------------------
L0:
<START>
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== doSmth1 ==
fun doSmth1() {}
---------------------
L0:
<START>
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== doSmth2 ==
fun doSmth2() {}
---------------------
L0:
<START>
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== cond ==
fun cond() {}
---------------------
L0:
<START>
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== testCopy1 ==
fun testCopy1() : Int {
try {
doSmth()
}
catch (e: NullPointerException) {
doSmth1()
}
catch (e: Exception) {
doSmth2()
}
finally {
return 1
}
}
---------------------
L0:
<START>
mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 } })
mark(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 })
jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])]
jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ return 1 }), mark({ doSmth() })]
mark({ doSmth() })
mark(doSmth())
call(doSmth, doSmth)
jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])]
L2 [onException]:
jmp?(L5 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L2 [onException])]
v(e: NullPointerException)
w(e)
mark({ doSmth1() })
mark(doSmth1())
call(doSmth1, doSmth1)
jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])]
L5 [catch 0]:
v(e: Exception) PREV:[jmp?(L5 [catch 0])]
w(e)
mark({ doSmth2() })
mark(doSmth2())
call(doSmth2, doSmth2)
jmp(L4 [afterCatches])
L4 [afterCatches]:
jmp(L6 [skipFinallyToErrorBlock]) NEXT:[mark({ return 1 })] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches]), jmp(L4 [afterCatches])]
L3 [onExceptionToFinallyBlock]:
L7 [start finally]:
mark({ return 1 }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])]
r(1)
ret(*) L1 NEXT:[<END>]
L8 [finish finally]:
- jmp(error) NEXT:[<ERROR>] PREV:[]
L6 [skipFinallyToErrorBlock]:
mark({ return 1 }) PREV:[jmp(L6 [skipFinallyToErrorBlock])]
r(1)
ret(*) L1
L1:
<END> NEXT:[<SINK>] PREV:[ret(*) L1, ret(*) L1]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== testCopy2 ==
fun testCopy2() {
while (cond()) {
try {
doSmth()
}
catch (e: NullPointerException) {
doSmth1()
}
catch (e: Exception) {
doSmth2()
}
finally {
if (cond()) return
else continue
}
}
}
---------------------
L0:
<START>
mark({ while (cond()) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } } })
mark(while (cond()) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } })
L2 [loop entry point]:
L5 [condition entry point]:
mark(cond()) PREV:[mark(while (cond()) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } }), jmp(L2 [loop entry point]), jmp(L2 [loop entry point])]
call(cond, cond)
jf(L3 [loop exit point]) NEXT:[read (Unit), mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } })]
L4 [body entry point]:
mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } })
mark(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue })
jmp?(L6 [onException]) NEXT:[jmp?(L9 [catch 0]), jmp?(L7 [onExceptionToFinallyBlock])]
jmp?(L7 [onExceptionToFinallyBlock]) NEXT:[mark({ if (cond()) return else continue }), mark({ doSmth() })]
mark({ doSmth() })
mark(doSmth())
call(doSmth, doSmth)
jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])]
L6 [onException]:
jmp?(L9 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L6 [onException])]
v(e: NullPointerException)
w(e)
mark({ doSmth1() })
mark(doSmth1())
call(doSmth1, doSmth1)
jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])]
L9 [catch 0]:
v(e: Exception) PREV:[jmp?(L9 [catch 0])]
w(e)
mark({ doSmth2() })
mark(doSmth2())
call(doSmth2, doSmth2)
jmp(L8 [afterCatches])
L8 [afterCatches]:
jmp(L10 [skipFinallyToErrorBlock]) NEXT:[mark({ if (cond()) return else continue })] PREV:[jmp(L8 [afterCatches]), jmp(L8 [afterCatches]), jmp(L8 [afterCatches])]
L7 [onExceptionToFinallyBlock]:
L11 [start finally]:
mark({ if (cond()) return else continue }) PREV:[jmp?(L7 [onExceptionToFinallyBlock])]
mark(if (cond()) return else continue)
mark(cond())
call(cond, cond)
jf(L12) NEXT:[jmp(L2 [loop entry point]), ret L1]
ret L1 NEXT:[<END>]
- jmp(L13) NEXT:[jmp(error)] PREV:[]
L12:
jmp(L2 [loop entry point]) NEXT:[mark(cond())] PREV:[jf(L12)]
L13:
L14 [finish finally]:
- jmp(error) NEXT:[<ERROR>] PREV:[]
L10 [skipFinallyToErrorBlock]:
mark({ if (cond()) return else continue }) PREV:[jmp(L10 [skipFinallyToErrorBlock])]
mark(if (cond()) return else continue)
mark(cond())
call(cond, cond)
jf(copy L12) NEXT:[jmp(L2 [loop entry point]), ret L1]
ret L1 NEXT:[<END>]
- jmp(copy L13) NEXT:[jmp(L2 [loop entry point])] PREV:[]
jmp(L2 [loop entry point]) NEXT:[mark(cond())] PREV:[jf(copy L12)]
- jmp(L2 [loop entry point]) NEXT:[mark(cond())] PREV:[]
L3 [loop exit point]:
read (Unit) PREV:[jf(L3 [loop exit point])]
L1:
<END> NEXT:[<SINK>] PREV:[ret L1, ret L1, read (Unit)]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== testCopy3 ==
fun testCopy3() {
try {
doSmth()
}
catch (e: NullPointerException) {
doSmth1()
}
catch (e: Exception) {
doSmth2()
}
finally {
while (cond());
}
}
---------------------
L0:
<START>
mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); } })
mark(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); })
jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])]
jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ while (cond()); }), mark({ doSmth() })]
mark({ doSmth() })
mark(doSmth())
call(doSmth, doSmth)
jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])]
L2 [onException]:
jmp?(L5 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L2 [onException])]
v(e: NullPointerException)
w(e)
mark({ doSmth1() })
mark(doSmth1())
call(doSmth1, doSmth1)
jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])]
L5 [catch 0]:
v(e: Exception) PREV:[jmp?(L5 [catch 0])]
w(e)
mark({ doSmth2() })
mark(doSmth2())
call(doSmth2, doSmth2)
jmp(L4 [afterCatches])
L4 [afterCatches]:
jmp(L6 [skipFinallyToErrorBlock]) NEXT:[mark({ while (cond()); })] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches]), jmp(L4 [afterCatches])]
L3 [onExceptionToFinallyBlock]:
L7 [start finally]:
mark({ while (cond()); }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])]
mark(while (cond()))
L8 [loop entry point]:
L11 [condition entry point]:
mark(cond()) PREV:[mark(while (cond())), jmp(L8 [loop entry point])]
call(cond, cond)
jf(L9 [loop exit point]) NEXT:[read (Unit), jmp(L8 [loop entry point])]
L10 [body entry point]:
jmp(L8 [loop entry point]) NEXT:[mark(cond())]
L9 [loop exit point]:
read (Unit) PREV:[jf(L9 [loop exit point])]
L12 [finish finally]:
jmp(error) NEXT:[<ERROR>]
L6 [skipFinallyToErrorBlock]:
mark({ while (cond()); }) PREV:[jmp(L6 [skipFinallyToErrorBlock])]
mark(while (cond()))
mark(cond()) PREV:[mark(while (cond())), jmp(copy L8 [loop entry point])]
call(cond, cond)
jf(copy L9 [loop exit point]) NEXT:[read (Unit), jmp(copy L8 [loop entry point])]
jmp(copy L8 [loop entry point]) NEXT:[mark(cond())]
read (Unit) PREV:[jf(copy L9 [loop exit point])]
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== doTestCopy4 ==
fun doTestCopy4(list: List<String>?) : Int {
try {
doSmth()
}
finally {
if(list != null) {
}
}
}
---------------------
L0:
<START>
v(list: List<String>?)
w(list)
mark({ try { doSmth() } finally { if(list != null) { } } })
mark(try { doSmth() } finally { if(list != null) { } })
jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ if(list != null) { } }), mark({ doSmth() })]
mark({ doSmth() })
mark(doSmth())
call(doSmth, doSmth)
jmp(L3 [skipFinallyToErrorBlock]) NEXT:[mark({ if(list != null) { } })]
L2 [onExceptionToFinallyBlock]:
L4 [start finally]:
mark({ if(list != null) { } }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
mark(if(list != null) { })
mark(list != null)
r(list)
r(null)
call(!=, equals)
jf(L5) NEXT:[read (Unit), mark({ })]
mark({ })
read (Unit)
jmp(L6) NEXT:[jmp(error)]
L5:
read (Unit) PREV:[jf(L5)]
L6:
L7 [finish finally]:
jmp(error) NEXT:[<ERROR>] PREV:[jmp(L6), read (Unit)]
L3 [skipFinallyToErrorBlock]:
mark({ if(list != null) { } }) PREV:[jmp(L3 [skipFinallyToErrorBlock])]
mark(if(list != null) { })
mark(list != null)
r(list)
r(null)
call(!=, equals)
jf(copy L5) NEXT:[read (Unit), mark({ })]
mark({ })
read (Unit)
jmp(copy L6) NEXT:[<END>]
read (Unit) PREV:[jf(copy L5)]
L1:
<END> NEXT:[<SINK>] PREV:[jmp(copy L6), read (Unit)]
error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
@@ -0,0 +1,62 @@
fun doSmth() {}
fun doSmth1() {}
fun doSmth2() {}
fun cond() {}
fun testCopy1() : Int {
try {
doSmth()
}
catch (e: NullPointerException) {
doSmth1()
}
catch (e: Exception) {
doSmth2()
}
finally {
return 1
}
}
fun testCopy2() {
while (cond()) {
try {
doSmth()
}
catch (e: NullPointerException) {
doSmth1()
}
catch (e: Exception) {
doSmth2()
}
finally {
if (cond()) return
else continue
}
}
}
fun testCopy3() {
try {
doSmth()
}
catch (e: NullPointerException) {
doSmth1()
}
catch (e: Exception) {
doSmth2()
}
finally {
while (cond());
}
}
fun doTestCopy4(list: List<String>?) : Int {
try {
doSmth()
}
finally {
if(list != null) {
}
}
}
@@ -0,0 +1,51 @@
== t1 ==
fun t1() {
for (i in 1..2) {
doSmth(i)
}
}
---------------------
L0:
<START>
mark({ for (i in 1..2) { doSmth(i) } })
mark(for (i in 1..2) { doSmth(i) })
mark(1..2)
r(1)
r(2)
call(.., rangeTo)
v(i)
w(i)
L3:
jmp?(L2) NEXT:[read (Unit), mark({ doSmth(i) })]
L4 [loop entry point]:
L5 [body entry point]:
mark({ doSmth(i) }) PREV:[jmp?(L2), jmp?(L4 [loop entry point])]
mark(doSmth(i))
r(i)
call(doSmth, doSmth)
jmp?(L4 [loop entry point]) NEXT:[mark({ doSmth(i) }), read (Unit)]
L2:
read (Unit) PREV:[jmp?(L2), jmp?(L4 [loop entry point])]
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== doSmth ==
fun doSmth(i: Int) {}
---------------------
L0:
<START>
v(i: Int)
w(i)
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
@@ -0,0 +1,7 @@
fun t1() {
for (i in 1..2) {
doSmth(i)
}
}
fun doSmth(i: Int) {}
@@ -0,0 +1,128 @@
== t1 ==
fun t1(b: Boolean) {
var u: String
if (b) {
u = "s"
}
doSmth(u)
var r: String
if (b) {
r = "s"
}
else {
r = "t"
}
doSmth(r)
}
---------------------
L0:
<START>
v(b: Boolean)
w(b)
mark({ var u: String if (b) { u = "s" } doSmth(u) var r: String if (b) { r = "s" } else { r = "t" } doSmth(r) })
v(var u: String)
mark(if (b) { u = "s" })
r(b)
jf(L2) NEXT:[read (Unit), mark({ u = "s" })]
mark({ u = "s" })
mark("s")
r("s")
w(u)
jmp(L3) NEXT:[mark(doSmth(u))]
L2:
read (Unit) PREV:[jf(L2)]
L3:
mark(doSmth(u)) PREV:[jmp(L3), read (Unit)]
r(u)
call(doSmth, doSmth)
v(var r: String)
mark(if (b) { r = "s" } else { r = "t" })
r(b)
jf(L4) NEXT:[mark({ r = "t" }), mark({ r = "s" })]
mark({ r = "s" })
mark("s")
r("s")
w(r)
jmp(L5) NEXT:[mark(doSmth(r))]
L4:
mark({ r = "t" }) PREV:[jf(L4)]
mark("t")
r("t")
w(r)
L5:
mark(doSmth(r)) PREV:[jmp(L5), w(r)]
r(r)
call(doSmth, doSmth)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== t2 ==
fun t2(b: Boolean) {
val i = 3
if (b) {
return;
}
doSmth(i)
if (i is Int) {
return;
}
}
---------------------
L0:
<START>
v(b: Boolean)
w(b)
mark({ val i = 3 if (b) { return; } doSmth(i) if (i is Int) { return; } })
v(val i = 3)
r(3)
w(i)
mark(if (b) { return; })
r(b)
jf(L2) NEXT:[read (Unit), mark({ return; })]
mark({ return; })
ret L1 NEXT:[<END>]
- jmp(L3) NEXT:[mark(doSmth(i))] PREV:[]
L2:
read (Unit) PREV:[jf(L2)]
L3:
mark(doSmth(i))
r(i)
call(doSmth, doSmth)
mark(if (i is Int) { return; })
mark(i is Int)
r(i)
jf(L4) NEXT:[read (Unit), mark({ return; })]
mark({ return; })
ret L1 NEXT:[<END>]
- jmp(L5) NEXT:[<END>] PREV:[]
L4:
read (Unit) PREV:[jf(L4)]
L1:
L5:
<END> NEXT:[<SINK>] PREV:[ret L1, ret L1, read (Unit)]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== doSmth ==
fun doSmth(s: String) {}
---------------------
L0:
<START>
v(s: String)
w(s)
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
@@ -0,0 +1,31 @@
fun t1(b: Boolean) {
var u: String
if (b) {
u = "s"
}
doSmth(u)
var r: String
if (b) {
r = "s"
}
else {
r = "t"
}
doSmth(r)
}
fun t2(b: Boolean) {
val i = 3
if (b) {
return;
}
doSmth(i)
if (i is Int) {
return;
}
}
fun doSmth(s: String) {}
@@ -0,0 +1,60 @@
== main ==
fun main() {
while(1 > 0) {
2
}
}
---------------------
L0:
<START>
mark({ while(1 > 0) { 2 } })
mark(while(1 > 0) { 2 })
L2 [loop entry point]:
L5 [condition entry point]:
mark(1 > 0) PREV:[mark(while(1 > 0) { 2 }), jmp(L2 [loop entry point])]
r(1)
r(0)
call(>, compareTo)
jf(L3 [loop exit point]) NEXT:[read (Unit), mark({ 2 })]
L4 [body entry point]:
mark({ 2 })
r(2)
jmp(L2 [loop entry point]) NEXT:[mark(1 > 0)]
L3 [loop exit point]:
read (Unit) PREV:[jf(L3 [loop exit point])]
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== dowhile ==
fun dowhile() {
do {return}
while(1 > 0)
}
---------------------
L0:
<START>
mark({ do {return} while(1 > 0) })
mark(do {return} while(1 > 0))
L2 [loop entry point]:
L4 [body entry point]:
mark({return})
ret L1 NEXT:[<END>]
L5 [condition entry point]:
- mark(1 > 0) PREV:[]
- r(1) PREV:[]
- r(0) PREV:[]
- call(>, compareTo) PREV:[]
- jt(L2 [loop entry point]) NEXT:[read (Unit), mark({return})] PREV:[]
L3 [loop exit point]:
- read (Unit) PREV:[]
L1:
<END> NEXT:[<SINK>] PREV:[ret L1]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
@@ -0,0 +1,10 @@
fun main() {
while(1 > 0) {
2
}
}
fun dowhile() {
do {return}
while(1 > 0)
}
@@ -0,0 +1,29 @@
== illegalWhenBlock ==
fun illegalWhenBlock(a: Any): Any {
when(a) {
is Int -> return a
}
}
---------------------
L0:
<START>
v(a: Any)
w(a)
mark({ when(a) { is Int -> return a } })
mark(when(a) { is Int -> return a })
r(a)
mark(is Int -> return a)
jmp?(L4) NEXT:[<END>, r(a)]
L3:
r(a)
ret(*) L1 NEXT:[<END>]
- jmp(L2) PREV:[]
L1:
L2:
L4:
<END> NEXT:[<SINK>] PREV:[jmp?(L4), ret(*) L1]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
@@ -0,0 +1,5 @@
fun illegalWhenBlock(a: Any): Any {
when(a) {
is Int -> return a
}
}