Do not print trailing whitespace in test data

This commit is contained in:
Andrey Breslav
2013-12-04 14:38:23 +04:00
parent 87879ba654
commit 853ebe3436
39 changed files with 1081 additions and 1077 deletions
@@ -16,30 +16,30 @@ class AnonymousInitializers() {
}
---------------------
L0:
<START>
v(val k = 34)
r(34)
w(k)
v(val i: Int)
mark({ $i = 12 })
r(12)
w($i)
<START>
v(val k = 34)
r(34)
w(k)
v(val i: Int)
mark({ $i = 12 })
r(12)
w($i)
v(val j: Int get() = 20)
jmp?(L2) NEXT:[mark({ $i = 13 }), d(get() = 20)]
d(get() = 20) NEXT:[<SINK>]
d(get() = 20) NEXT:[<SINK>]
L2:
mark({ $i = 13 }) PREV:[jmp?(L2)]
r(13)
w($i)
r(13)
w($i)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>, d(get() = 20)]
L3:
<START>
r(20)
r(20)
L4:
<END> NEXT:[<SINK>]
error:
@@ -52,7 +52,7 @@ get() = 20
---------------------
L3:
<START>
r(20)
r(20)
L4:
<END> NEXT:[<SINK>]
error:
+29 -29
View File
@@ -10,37 +10,37 @@ fun foo() {
}
---------------------
L0:
<START>
<START>
mark({ val a = Array<Int> 3 a[10] = 4 2 a[10] 100 a[10] += 1 })
v(val a = Array<Int>)
mark(Array<Int>)
call(Array, <init>)
w(a)
r(3)
mark(a[10])
r(a)
r(10)
r(4)
call(a[10], set)
r(2)
mark(a[10])
r(a)
r(10)
call(a[10], get)
r(100)
mark(a[10] += 1)
mark(a[10])
r(a)
r(10)
call(a[10], get)
r(1)
call(+=, plus)
r(a)
r(10)
r(1)
call(a[10], set)
v(val a = Array<Int>)
mark(Array<Int>)
call(Array, <init>)
w(a)
r(3)
mark(a[10])
r(a)
r(10)
r(4)
call(a[10], set)
r(2)
mark(a[10])
r(a)
r(10)
call(a[10], get)
r(100)
mark(a[10] += 1)
mark(a[10])
r(a)
r(10)
call(a[10], get)
r(1)
call(+=, plus)
r(a)
r(10)
r(1)
call(a[10], set)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
+36 -36
View File
@@ -4,10 +4,10 @@ class Test {
}
---------------------
L0:
<START>
<START>
v(var x : Int;)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -29,50 +29,50 @@ fun assignments() : Unit {
}
---------------------
L0:
<START>
<START>
mark({ var x = 1 x = 2 x += 2 x = if (true) 1 else 2 val y = true && false val z = false && true val t = Test(); t.x = 1 })
v(var x = 1)
r(1)
w(x)
r(2)
w(x)
mark(x += 2)
r(x)
r(2)
call(+=, plus)
w(x)
mark(if (true) 1 else 2)
r(true)
jf(L2) NEXT:[r(2), r(1)]
r(1)
jmp(L3) NEXT:[w(x)]
v(var x = 1)
r(1)
w(x)
r(2)
w(x)
mark(x += 2)
r(x)
r(2)
call(+=, plus)
w(x)
mark(if (true) 1 else 2)
r(true)
jf(L2) NEXT:[r(2), r(1)]
r(1)
jmp(L3) NEXT:[w(x)]
L2:
r(2) PREV:[jf(L2)]
L3:
w(x) PREV:[jmp(L3), r(2)]
v(val y = true && false)
r(true)
jf(L4) NEXT:[r(true && false), r(false)]
r(false)
v(val y = true && false)
r(true)
jf(L4) NEXT:[r(true && false), r(false)]
r(false)
L4:
r(true && false) PREV:[jf(L4), r(false)]
w(y)
v(val z = false && true)
r(false)
jf(L5) NEXT:[r(false && true), r(true)]
r(true)
w(y)
v(val z = false && true)
r(false)
jf(L5) NEXT:[r(false && true), r(true)]
r(true)
L5:
r(false && true) PREV:[jf(L5), r(true)]
w(z)
v(val t = Test())
mark(Test())
call(Test, <init>)
w(t)
r(1)
r(t)
w(t.x)
w(z)
v(val t = Test())
mark(Test())
call(Test, <init>)
w(t)
r(1)
r(t)
w(t.x)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
+59 -59
View File
@@ -18,54 +18,54 @@ fun f(a : Boolean) : Unit {
}
---------------------
L0:
<START>
v(a : Boolean)
w(a)
<START>
v(a : Boolean)
w(a)
mark({ 1 a 2.toLong() foo(a, 3) genfun<Any>() flfun {1} 3.equals(4) 3 equals 4 1 + 2 a && true a || false })
r(1)
r(a)
mark(2.toLong())
mark(toLong())
r(2)
call(toLong, toLong)
mark(foo(a, 3))
r(a)
r(3)
call(foo, foo)
mark(genfun<Any>())
call(genfun, genfun)
mark(flfun {1})
mark({1})
jmp?(L2) NEXT:[r({1}), d({1})]
d({1}) NEXT:[<SINK>]
r(1)
r(a)
mark(2.toLong())
mark(toLong())
r(2)
call(toLong, toLong)
mark(foo(a, 3))
r(a)
r(3)
call(foo, foo)
mark(genfun<Any>())
call(genfun, genfun)
mark(flfun {1})
mark({1})
jmp?(L2) NEXT:[r({1}), d({1})]
d({1}) NEXT:[<SINK>]
L2:
r({1}) PREV:[jmp?(L2)]
call(flfun, flfun)
mark(3.equals(4))
mark(equals(4))
r(3)
r(4)
call(equals, equals)
mark(3 equals 4)
r(3)
r(4)
call(equals, equals)
mark(1 + 2)
r(1)
r(2)
call(+, plus)
r(a)
jf(L5) NEXT:[r(a && true), r(true)]
r(true)
call(flfun, flfun)
mark(3.equals(4))
mark(equals(4))
r(3)
r(4)
call(equals, equals)
mark(3 equals 4)
r(3)
r(4)
call(equals, equals)
mark(1 + 2)
r(1)
r(2)
call(+, plus)
r(a)
jf(L5) NEXT:[r(a && true), r(true)]
r(true)
L5:
r(a && true) PREV:[jf(L5), r(true)]
r(a)
jt(L6) NEXT:[r(false), r(a || false)]
r(false)
r(a)
jt(L6) NEXT:[r(false), r(a || false)]
r(false)
L6:
r(a || false) PREV:[jt(L6), r(false)]
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -73,9 +73,9 @@ sink:
L3:
<START>
mark(1)
r(1)
r(1)
L4:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -87,9 +87,9 @@ sink:
L3:
<START>
mark(1)
r(1)
r(1)
L4:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -99,15 +99,15 @@ sink:
fun foo(a : Boolean, b : Int) : Unit {}
---------------------
L0:
<START>
<START>
v(a : Boolean)
w(a)
v(b : Int)
w(b)
mark({})
read (Unit)
w(a)
v(b : Int)
w(b)
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -117,11 +117,11 @@ sink:
fun genfun<T>() : Unit {}
---------------------
L0:
<START>
mark({})
<START>
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -131,13 +131,13 @@ sink:
fun flfun(f : () -> Any) : Unit {}
---------------------
L0:
<START>
<START>
v(f : () -> Any)
w(f)
mark({})
read (Unit)
w(f)
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -16,13 +16,13 @@ sink:
val a = Delegate()
---------------------
L0:
<START>
v(val a = Delegate())
mark(Delegate())
<START>
v(val a = Delegate())
mark(Delegate())
call(Delegate, <init>)
w(a)
w(a)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -32,11 +32,11 @@ sink:
val b by a
---------------------
L0:
<START>
<START>
v(val b by a)
r(a)
r(a)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -2,11 +2,11 @@
fun empty() {}
---------------------
L0:
<START>
mark({})
<START>
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -4,13 +4,13 @@ fun fail() : Nothing {
}
---------------------
L0:
<START>
<START>
mark({ throw java.lang.RuntimeException() })
mark(throw java.lang.RuntimeException())
mark(java.lang.RuntimeException())
mark(RuntimeException())
call(RuntimeException, <init>)
throw (throw java.lang.RuntimeException()) NEXT:[<ERROR>]
mark(throw java.lang.RuntimeException())
mark(java.lang.RuntimeException())
mark(RuntimeException())
call(RuntimeException, <init>)
throw (throw java.lang.RuntimeException()) NEXT:[<ERROR>]
L1:
<END> NEXT:[<SINK>] PREV:[]
error:
File diff suppressed because it is too large Load Diff
+124 -124
View File
@@ -2,11 +2,11 @@
fun doSmth() {}
---------------------
L0:
<START>
mark({})
<START>
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -16,11 +16,11 @@ sink:
fun doSmth1() {}
---------------------
L0:
<START>
mark({})
<START>
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -30,11 +30,11 @@ sink:
fun doSmth2() {}
---------------------
L0:
<START>
mark({})
<START>
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -44,11 +44,11 @@ sink:
fun cond() {}
---------------------
L0:
<START>
mark({})
<START>
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -71,43 +71,43 @@ fun testCopy1() : Int {
}
---------------------
L0:
<START>
<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])]
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])]
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])
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>]
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
r(1)
ret(*) L1
L1:
<END> NEXT:[<SINK>] PREV:[ret(*) L1, ret(*) L1]
error:
@@ -135,48 +135,48 @@ fun testCopy2() {
}
---------------------
L0:
<START>
<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 } })
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 } })]
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])]
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])]
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])
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>]
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)]
@@ -185,11 +185,11 @@ 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>]
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:[]
@@ -219,57 +219,57 @@ fun testCopy3() {
}
---------------------
L0:
<START>
<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])]
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])]
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])
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()))
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])]
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())]
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>]
jmp(error) NEXT:[<ERROR>]
L6 [skipFinallyToErrorBlock]:
mark({ while (cond()); }) PREV:[jmp(L6 [skipFinallyToErrorBlock])]
mark(while (cond()))
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())]
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>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[jmp(error)]
sink:
@@ -287,28 +287,28 @@ fun doTestCopy4(list: List<String>?) : Int {
}
---------------------
L0:
<START>
v(list: List<String>?)
w(list)
<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) { } })]
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(list != null, equals)
jf(L5) NEXT:[read (Unit), mark({ })]
mark({ })
read (Unit)
jmp(L6) NEXT:[jmp(error)]
mark(if(list != null) { })
mark(list != null)
r(list)
r(null)
call(list != null, equals)
jf(L5) NEXT:[read (Unit), mark({ })]
mark({ })
read (Unit)
jmp(L6) NEXT:[jmp(error)]
L5:
read (Unit) PREV:[jf(L5)]
L6:
@@ -316,15 +316,15 @@ 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(list != null, equals)
jf(copy L5) NEXT:[read (Unit), mark({ })]
mark({ })
read (Unit)
jmp(copy L6) NEXT:[<END>]
mark(if(list != null) { })
mark(list != null)
r(list)
r(null)
call(list != null, 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)]
+19 -19
View File
@@ -6,28 +6,28 @@ fun t1() {
}
---------------------
L0:
<START>
<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)
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) })]
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)]
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>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -37,13 +37,13 @@ sink:
fun doSmth(i: Int) {}
---------------------
L0:
<START>
v(i: Int)
w(i)
mark({})
<START>
v(i: Int)
w(i)
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
+54 -54
View File
@@ -17,45 +17,45 @@ fun t1(b: Boolean) {
}
---------------------
L0:
<START>
v(b: Boolean)
w(b)
<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))]
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))]
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)
mark("t")
r("t")
w(r)
L5:
mark(doSmth(r)) PREV:[jmp(L5), w(r)]
r(r)
call(doSmth, doSmth)
r(r)
call(doSmth, doSmth)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -74,31 +74,31 @@ fun t2(b: Boolean) {
}
---------------------
L0:
<START>
v(b: Boolean)
w(b)
<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>]
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>]
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)]
@@ -114,13 +114,13 @@ sink:
fun doSmth(s: String) {}
---------------------
L0:
<START>
<START>
v(s: String)
w(s)
mark({})
read (Unit)
w(s)
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
+35 -35
View File
@@ -18,67 +18,67 @@ fun lazyBooleans(a : Boolean, b : Boolean) : Unit {
}
---------------------
L0:
<START>
v(a : Boolean)
w(a)
v(b : Boolean)
w(b)
<START>
v(a : Boolean)
w(a)
v(b : Boolean)
w(b)
mark({ if (a) { 1 } else { 2 } 3 if (a && b) 5 else 6 7 if (a || b) 8 else 9 10 if (a) 11 12 if (a) else 13 14 })
mark(if (a) { 1 } else { 2 })
r(a)
jf(L2) NEXT:[mark({ 2 }), mark({ 1 })]
mark({ 1 })
r(1)
jmp(L3) NEXT:[r(3)]
mark(if (a) { 1 } else { 2 })
r(a)
jf(L2) NEXT:[mark({ 2 }), mark({ 1 })]
mark({ 1 })
r(1)
jmp(L3) NEXT:[r(3)]
L2:
mark({ 2 }) PREV:[jf(L2)]
r(2)
r(2)
L3:
r(3) PREV:[jmp(L3), r(2)]
mark(if (a && b) 5 else 6)
r(a)
jf(L4) NEXT:[jf(L5), r(b)]
r(b)
mark(if (a && b) 5 else 6)
r(a)
jf(L4) NEXT:[jf(L5), r(b)]
r(b)
L4:
jf(L5) NEXT:[r(6), r(5)] PREV:[jf(L4), r(b)]
r(5)
jmp(L6) NEXT:[r(7)]
r(5)
jmp(L6) NEXT:[r(7)]
L5:
r(6) PREV:[jf(L5)]
L6:
r(7) PREV:[jmp(L6), r(6)]
mark(if (a || b) 8 else 9)
r(a)
jt(L7) NEXT:[r(b), jf(L8)]
r(b)
mark(if (a || b) 8 else 9)
r(a)
jt(L7) NEXT:[r(b), jf(L8)]
r(b)
L7:
jf(L8) NEXT:[r(9), r(8)] PREV:[jt(L7), r(b)]
r(8)
jmp(L9) NEXT:[r(10)]
r(8)
jmp(L9) NEXT:[r(10)]
L8:
r(9) PREV:[jf(L8)]
L9:
r(10) PREV:[jmp(L9), r(9)]
mark(if (a) 11)
r(a)
jf(L10) NEXT:[read (Unit), r(11)]
r(11)
jmp(L11) NEXT:[r(12)]
mark(if (a) 11)
r(a)
jf(L10) NEXT:[read (Unit), r(11)]
r(11)
jmp(L11) NEXT:[r(12)]
L10:
read (Unit) PREV:[jf(L10)]
L11:
r(12) PREV:[jmp(L11), read (Unit)]
mark(if (a) else 13)
r(a)
jf(L12) NEXT:[r(13), read (Unit)]
read (Unit)
jmp(L13) NEXT:[r(14)]
mark(if (a) else 13)
r(a)
jf(L12) NEXT:[r(13), read (Unit)]
read (Unit)
jmp(L13) NEXT:[r(14)]
L12:
r(13) PREV:[jf(L12)]
L13:
r(14) PREV:[jmp(L13), r(13)]
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -18,12 +18,12 @@ class C() {
}
---------------------
L0:
<START>
<START>
v(val a: Int = 1)
r(1)
w(a)
r(1)
w(a)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -33,13 +33,13 @@ sink:
fun doSmth(i: Int) {}
---------------------
L0:
<START>
v(i: Int)
w(i)
mark({})
<START>
v(i: Int)
w(i)
mark({})
read (Unit)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -56,18 +56,18 @@ fun test1() {
}
---------------------
L0:
<START>
<START>
mark({ val a = object { val x : Int { $x = 1 } } })
v(val a = object { val x : Int { $x = 1 } })
mark(object { val x : Int { $x = 1 } })
v(val x : Int)
mark({ $x = 1 })
r(1)
w($x)
r(object { val x : Int { $x = 1 } })
w(a)
v(val a = object { val x : Int { $x = 1 } })
mark(object { val x : Int { $x = 1 } })
v(val x : Int)
mark({ $x = 1 })
r(1)
w($x)
r(object { val x : Int { $x = 1 } })
w(a)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -82,13 +82,13 @@ object O {
}
---------------------
L0:
<START>
v(val x : Int)
<START>
v(val x : Int)
mark({ $x = 1 })
r(1)
w($x)
r(1)
w($x)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -103,20 +103,20 @@ fun test2() {
}
---------------------
L0:
<START>
<START>
mark({ val b = 1 val a = object { val x = b } })
v(val b = 1)
r(1)
w(b)
v(val a = object { val x = b })
mark(object { val x = b })
v(val x = b)
r(b)
w(x)
r(object { val x = b })
w(a)
v(val b = 1)
r(1)
w(b)
v(val a = object { val x = b })
mark(object { val x = b })
v(val x = b)
r(b)
w(x)
r(object { val x = b })
w(a)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -133,29 +133,29 @@ fun test3() {
}
---------------------
L0:
<START>
<START>
mark({ val a = object { val y : Int fun inner_bar() { y = 10 } } })
v(val a = object { val y : Int fun inner_bar() { y = 10 } })
mark(object { val y : Int fun inner_bar() { y = 10 } })
v(val y : Int)
v(val a = object { val y : Int fun inner_bar() { y = 10 } })
mark(object { val y : Int fun inner_bar() { y = 10 } })
v(val y : Int)
jmp?(L2) NEXT:[r(object { val y : Int fun inner_bar() { y = 10 } }), d(fun inner_bar() { y = 10 })]
d(fun inner_bar() { y = 10 }) NEXT:[<SINK>]
d(fun inner_bar() { y = 10 }) NEXT:[<SINK>]
L2:
r(object { val y : Int fun inner_bar() { y = 10 } }) PREV:[jmp?(L2)]
w(a)
w(a)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>, d(fun inner_bar() { y = 10 })]
L3:
<START>
<START>
mark({ y = 10 })
r(10)
w(y)
r(10)
w(y)
L4:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -167,12 +167,12 @@ fun inner_bar() {
}
---------------------
L3:
<START>
<START>
mark({ y = 10 })
r(10)
w(y)
r(10)
w(y)
L4:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -193,33 +193,33 @@ fun test4() {
}
---------------------
L0:
<START>
<START>
mark({ val a = object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } } })
v(val a = object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } })
mark(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } })
v(val x : Int)
v(val y : Int)
mark({ $x = 1 })
r(1)
w($x)
v(val a = object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } })
mark(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } })
v(val x : Int)
v(val y : Int)
mark({ $x = 1 })
r(1)
w($x)
jmp?(L2) NEXT:[r(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }), d(fun ggg() { y = 10 })]
d(fun ggg() { y = 10 }) NEXT:[<SINK>]
d(fun ggg() { y = 10 }) NEXT:[<SINK>]
L2:
r(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }) PREV:[jmp?(L2)]
w(a)
w(a)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>, d(fun ggg() { y = 10 })]
L3:
<START>
<START>
mark({ y = 10 })
r(10)
w(y)
r(10)
w(y)
L4:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -231,12 +231,12 @@ fun ggg() {
}
---------------------
L3:
<START>
<START>
mark({ y = 10 })
r(10)
w(y)
r(10)
w(y)
L4:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -259,48 +259,48 @@ fun test5() {
}
---------------------
L0:
<START>
<START>
mark({ val a = object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } } })
v(val a = object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } })
mark(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } })
v(var x = 1)
r(1)
w(x)
mark({ $x = 2 })
r(2)
w($x)
jmp?(L2) NEXT:[jmp?(L5), d(fun foo() { x = 3 })]
d(fun foo() { x = 3 }) NEXT:[<SINK>]
v(val a = object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } })
mark(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } })
v(var x = 1)
r(1)
w(x)
mark({ $x = 2 })
r(2)
w($x)
jmp?(L2) NEXT:[jmp?(L5), d(fun foo() { x = 3 })]
d(fun foo() { x = 3 }) NEXT:[<SINK>]
L2:
jmp?(L5) NEXT:[r(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }), d(fun bar() { x = 4 })] PREV:[jmp?(L2)]
d(fun bar() { x = 4 }) NEXT:[<SINK>]
d(fun bar() { x = 4 }) NEXT:[<SINK>]
L5:
r(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }) PREV:[jmp?(L5)]
w(a)
w(a)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>, d(fun foo() { x = 3 }), d(fun bar() { x = 4 })]
L3:
<START>
<START>
mark({ x = 3 })
r(3)
w(x)
r(3)
w(x)
L4:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
L6:
<START>
<START>
mark({ x = 4 })
r(4)
w(x)
r(4)
w(x)
L7:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -312,12 +312,12 @@ fun foo() {
}
---------------------
L3:
<START>
<START>
mark({ x = 3 })
r(3)
w(x)
r(3)
w(x)
L4:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -329,12 +329,12 @@ fun bar() {
}
---------------------
L6:
<START>
<START>
mark({ x = 4 })
r(4)
w(x)
r(4)
w(x)
L7:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
+14 -14
View File
@@ -20,22 +20,22 @@ fun test(c: C) {
}
---------------------
L0:
<START>
v(c: C)
w(c)
<START>
v(c: C)
w(c)
mark({ val (a, b) = c val d = 1 })
r(c)
v(a)
call(a, component1)
w(a)
v(b)
call(b, component2)
w(b)
v(val d = 1)
r(1)
w(d)
r(c)
v(a)
call(a, component1)
w(a)
v(b)
call(b, component2)
w(b)
v(val d = 1)
r(1)
w(d)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -18,10 +18,10 @@ class B : A {
}
---------------------
L0:
<START>
<START>
unsupported(DELEGATOR_SUPER_CLASS : A)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -34,22 +34,22 @@ fun foo(b: B) : Int {
}
---------------------
L0:
<START>
v(b: B)
w(b)
<START>
v(b: B)
w(b)
mark({ val o = object : A by b {} return o.foo() })
v(val o = object : A by b {})
mark(object : A by b {})
r(b)
r(object : A by b {})
w(o)
mark(o.foo())
mark(foo())
r(o)
call(foo, foo)
ret(*) L1
v(val o = object : A by b {})
mark(object : A by b {})
r(b)
r(object : A by b {})
w(o)
mark(o.foo())
mark(foo())
r(o)
call(foo, foo)
ret(*) L1
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -6,24 +6,24 @@ fun main() {
}
---------------------
L0:
<START>
<START>
mark({ while(1 > 0) { 2 } })
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 })]
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)]
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>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -36,13 +36,13 @@ fun dowhile() {
}
---------------------
L0:
<START>
<START>
mark({ do {return} while(1 > 0) })
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>]
mark({return})
ret L1 NEXT:[<END>]
L5 [condition entry point]:
- mark(1 > 0) PREV:[]
- r(1) PREV:[]
@@ -4,13 +4,13 @@ fun blockAndAndMismatch() : Boolean {
}
---------------------
L0:
<START>
<START>
mark({ false || (return false) })
r(false)
r(false)
jt(L2) NEXT:[mark((return false)), r(false || (return false))]
mark((return false))
r(false)
ret(*) L1 NEXT:[<END>]
mark((return false))
r(false)
ret(*) L1 NEXT:[<END>]
L2:
r(false || (return false)) PREV:[jt(L2)]
L1:
@@ -3,7 +3,7 @@ fun short() = 1
---------------------
L0:
<START>
r(1)
r(1)
L1:
<END> NEXT:[<SINK>]
error:
@@ -18,19 +18,19 @@ fun test(ab: Ab) {
}
---------------------
L0:
<START>
v(ab: Ab)
w(ab)
mark({ ab.getArray()[1] })
mark(ab.getArray()[1])
mark(ab.getArray())
mark(getArray())
r(ab)
call(getArray, getArray)
r(1)
<START>
v(ab: Ab)
w(ab)
mark({ ab.getArray()[1] })
mark(ab.getArray()[1])
mark(ab.getArray())
mark(getArray())
r(ab)
call(getArray, getArray)
r(1)
call(ab.getArray()[1], get)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
+9 -9
View File
@@ -4,17 +4,17 @@ fun foo(a: Array<Int>) {
}
---------------------
L0:
<START>
v(a: Array<Int>)
w(a)
<START>
v(a: Array<Int>)
w(a)
mark({ a[1] = 2 })
mark(a[1])
r(a)
r(1)
r(2)
call(a[1], set)
mark(a[1])
r(a)
r(1)
r(2)
call(a[1], set)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -4,23 +4,23 @@ fun foo(a: Array<Int>) {
}
---------------------
L0:
<START>
v(a: Array<Int>)
w(a)
<START>
v(a: Array<Int>)
w(a)
mark({ a[0] += 1 })
mark(a[0] += 1)
mark(a[0])
r(a)
r(0)
call(a[0], get)
r(1)
call(+=, plus)
r(a)
r(0)
r(1)
call(a[0], set)
mark(a[0] += 1)
mark(a[0])
r(a)
r(0)
call(a[0], get)
r(1)
call(+=, plus)
r(a)
r(0)
r(1)
call(a[0], set)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -4,14 +4,14 @@ fun Int.bar(c: C) {
}
---------------------
L0:
<START>
v(c: C)
w(c)
mark({ this = c })
r(c)
<START>
v(c: C)
w(c)
mark({ this = c })
r(c)
unsupported(BINARY_EXPRESSION : this = c)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -9,22 +9,22 @@ class C {
}
---------------------
L0:
<START>
<START>
v(val a: Int get() = 1)
jmp?(L2) NEXT:[mark({ $a }), d(get() = 1)]
d(get() = 1) NEXT:[<SINK>]
d(get() = 1) NEXT:[<SINK>]
L2:
mark({ $a }) PREV:[jmp?(L2)]
r($a)
r($a)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>, d(get() = 1)]
L3:
<START>
r(1)
r(1)
L4:
<END> NEXT:[<SINK>]
error:
@@ -37,7 +37,7 @@ get() = 1
---------------------
L3:
<START>
r(1)
r(1)
L4:
<END> NEXT:[<SINK>]
error:
@@ -5,12 +5,12 @@ fun test() {
}
---------------------
L0:
<START>
<START>
mark({ throw Exception() test() })
mark(throw Exception())
mark(Exception())
call(Exception, <init>)
throw (throw Exception()) NEXT:[<ERROR>]
mark(throw Exception())
mark(Exception())
call(Exception, <init>)
throw (throw Exception()) NEXT:[<ERROR>]
- mark(test()) PREV:[]
- call(test, test) PREV:[]
L1:
@@ -4,9 +4,9 @@ fun foo() {
}
---------------------
L0:
<START>
<START>
mark({ return ?: null })
ret L1 NEXT:[<END>]
ret L1 NEXT:[<END>]
- jt(L2) NEXT:[r(null), <END>] PREV:[]
- r(null) PREV:[]
L1:
@@ -4,13 +4,13 @@ fun test() {
}
---------------------
L0:
<START>
<START>
mark({ "${throw Exception()} ${1}" })
mark("${throw Exception()} ${1}")
mark(throw Exception())
mark(Exception())
call(Exception, <init>)
throw (throw Exception()) NEXT:[<ERROR>]
mark("${throw Exception()} ${1}")
mark(throw Exception())
mark(Exception())
call(Exception, <init>)
throw (throw Exception()) NEXT:[<ERROR>]
- r(1) PREV:[]
- r("${throw Exception()} ${1}") PREV:[]
L1:
+14 -14
View File
@@ -5,21 +5,21 @@ fun foo(a: Int, b: Int) {
}
---------------------
L0:
<START>
v(a: Int)
w(a)
v(b: Int)
w(b)
<START>
v(a: Int)
w(a)
v(b: Int)
w(b)
mark({ if (a == b) { } })
mark(if (a == b) { })
mark(a == b)
r(a)
r(b)
call(a == b, equals)
jf(L2) NEXT:[read (Unit), mark({ })]
mark({ })
read (Unit)
jmp(L3) NEXT:[<END>]
mark(if (a == b) { })
mark(a == b)
r(a)
r(b)
call(a == b, equals)
jf(L2) NEXT:[read (Unit), mark({ })]
mark({ })
read (Unit)
jmp(L3) NEXT:[<END>]
L2:
read (Unit) PREV:[jf(L2)]
L1:
@@ -4,16 +4,16 @@ fun invoke(f: () -> Unit) {
}
---------------------
L0:
<START>
v(f: () -> Unit)
w(f)
mark({ (f)() })
mark((f)())
mark((f))
r(f)
<START>
v(f: () -> Unit)
w(f)
mark({ (f)() })
mark((f)())
mark((f))
r(f)
call((f), <for expression (f)>)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -5,17 +5,17 @@ fun foo() {
}
---------------------
L0:
<START>
<START>
mark({ var i = 1 i++ })
v(var i = 1)
r(1)
w(i)
mark(i++)
r(i)
call(++, inc)
w(i)
v(var i = 1)
r(1)
w(i)
mark(i++)
r(i)
call(++, inc)
w(i)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
+7 -7
View File
@@ -4,15 +4,15 @@ fun foo(f: () -> Unit) {
}
---------------------
L0:
<START>
<START>
v(f: () -> Unit)
w(f)
mark({ f() })
mark(f())
r(f)
call(f, invoke)
w(f)
mark({ f() })
mark(f())
r(f)
call(f, invoke)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -5,18 +5,18 @@ fun foo(x: Int) {
}
---------------------
L0:
<START>
v(x: Int)
w(x)
<START>
v(x: Int)
w(x)
mark({ val (a, b) = x a })
r(x)
v(a)
w(a)
v(b)
w(b)
r(a)
r(x)
v(a)
w(a)
v(b)
w(b)
r(a)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
+14 -14
View File
@@ -4,21 +4,21 @@ fun neq(a: Int, b: Int) {
}
---------------------
L0:
<START>
v(a: Int)
w(a)
v(b: Int)
w(b)
<START>
v(a: Int)
w(a)
v(b: Int)
w(b)
mark({ if (a != b) {} })
mark(if (a != b) {})
mark(a != b)
r(a)
r(b)
call(a != b, equals)
jf(L2) NEXT:[read (Unit), mark({})]
mark({})
read (Unit)
jmp(L3) NEXT:[<END>]
mark(if (a != b) {})
mark(a != b)
r(a)
r(b)
call(a != b, equals)
jf(L2) NEXT:[read (Unit), mark({})]
mark({})
read (Unit)
jmp(L3) NEXT:[<END>]
L2:
read (Unit) PREV:[jf(L2)]
L1:
@@ -4,15 +4,15 @@ fun test(s: String?) {
}
---------------------
L0:
<START>
v(s: String?)
w(s)
<START>
v(s: String?)
w(s)
mark({ s?.length })
mark(s?.length)
r(s)
r(length)
mark(s?.length)
r(s)
r(length)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -6,17 +6,17 @@ fun illegalWhenBlock(a: Any): Any {
}
---------------------
L0:
<START>
v(a: Any)
w(a)
<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)]
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>]
r(a)
ret(*) L1 NEXT:[<END>]
- jmp(L2) PREV:[]
L1:
L2:
@@ -4,13 +4,13 @@ fun Function0<Unit>.foo() {
}
---------------------
L0:
<START>
mark({ this() })
mark(this())
r(this)
<START>
mark({ this() })
mark(this())
r(this)
call(this, <for expression this>)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -4,11 +4,11 @@ fun <T> foo() {
}
---------------------
L0:
<START>
mark({ T })
<START>
mark({ T })
error(T, No resolved call)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -4,17 +4,17 @@ fun test(a: Any) {
}
---------------------
L0:
<START>
v(a: Any)
w(a)
mark({ a.foo() })
mark(a.foo())
mark(foo())
<START>
v(a: Any)
w(a)
mark({ a.foo() })
mark(a.foo())
mark(foo())
error(foo, No resolved call)
error(foo, No resolved call)
r(a)
r(a)
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -4,25 +4,25 @@ fun foo() {
}
---------------------
L0:
<START>
<START>
mark({ {} })
mark({})
mark({})
jmp?(L2) NEXT:[r({}), d({})]
d({}) NEXT:[<SINK>]
d({}) NEXT:[<SINK>]
L2:
r({}) PREV:[jmp?(L2)]
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>, d({})]
L3:
<START>
mark()
<START>
mark()
read (Unit)
L4:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -32,11 +32,11 @@ sink:
{}
---------------------
L3:
<START>
mark()
<START>
mark()
read (Unit)
L4:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
@@ -18,6 +18,7 @@ package org.jetbrains.jet.cfg;
import com.google.common.collect.Sets;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.ConfigurationKind;
@@ -234,20 +235,23 @@ public abstract class AbstractControlFlowTest extends KotlinTestWithEnvironment
}
}
out.append(formatInstruction(instruction, maxLength, remainedAfterPostProcessInstructions));
StringBuilder line = new StringBuilder();
line.append(formatInstruction(instruction, maxLength, remainedAfterPostProcessInstructions));
// Only print NEXT and PREV if the values are non-trivial
Instruction next = i == instructions.size() - 1 ? null : instructions.get(i + 1);
Collection<Instruction> nextInstructions = instruction.getNextInstructions();
if (!sameContents(next, nextInstructions)) {
out.append(" NEXT:").append(String.format("%1$-" + maxNextLength + "s", formatInstructionList(nextInstructions)));
line.append(" NEXT:").append(String.format("%1$-" + maxNextLength + "s", formatInstructionList(nextInstructions)));
}
Instruction prev = i == 0 ? null : instructions.get(i - 1);
Collection<Instruction> previousInstructions = instruction.getPreviousInstructions();
if (!sameContents(prev, previousInstructions)) {
out.append(" PREV:").append(formatInstructionList(previousInstructions));
line.append(" PREV:").append(formatInstructionList(previousInstructions));
}
out.append(StringUtil.trimTrailing(line.toString()));
out.append("\n");
}
for (PseudocodeImpl local : locals) {