Skip to content
Snippets Groups Projects
Commit 4769646a authored by Manos Koukoutos's avatar Manos Koukoutos
Browse files

Add test for new inlining

parent 07c88199
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ class InliningSuite extends LeonTestSuiteWithProgram with helpers.ExpressionsDSL ...@@ -20,7 +20,7 @@ class InliningSuite extends LeonTestSuiteWithProgram with helpers.ExpressionsDSL
| |
|} """.stripMargin, |} """.stripMargin,
""" |import leon.lang._ """|import leon.lang._
|import leon.annotation._ |import leon.annotation._
| |
|object InlineBad { |object InlineBad {
...@@ -30,6 +30,21 @@ class InliningSuite extends LeonTestSuiteWithProgram with helpers.ExpressionsDSL ...@@ -30,6 +30,21 @@ class InliningSuite extends LeonTestSuiteWithProgram with helpers.ExpressionsDSL
| |
| def bar(a: BigInt) = foo(a) | def bar(a: BigInt) = foo(a)
| |
|}""".stripMargin,
"""|import leon.lang._
|import leon.annotation._
|
|object InlineGood2 {
|
| @inline
| def foo(a: BigInt) = true
|
| @inline
| def bar(a: BigInt) = foo(a)
|
| def baz(a: BigInt) = bar(a)
|
|}""".stripMargin |}""".stripMargin
) )
...@@ -45,4 +60,9 @@ class InliningSuite extends LeonTestSuiteWithProgram with helpers.ExpressionsDSL ...@@ -45,4 +60,9 @@ class InliningSuite extends LeonTestSuiteWithProgram with helpers.ExpressionsDSL
fail(s"Resultig body should be a call to 'foo', got '$b'") fail(s"Resultig body should be a call to 'foo', got '$b'")
} }
} }
test("Double Inlining") { implicit fix =>
assert(funDef("InlineGood2.baz").fullBody == BooleanLiteral(true), "Inlined function invocation not inlined in turn?")
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment