Skip to content
Snippets Groups Projects
Commit 88981f32 authored by Regis Blanc's avatar Regis Blanc
Browse files

more testing

parent 82f39668
No related branches found
No related tags found
No related merge requests found
import leon.lang._
object NestedFunParamsMutation1 {
def f(): Int = {
def g(a: Array[Int]): Unit = {
require(a.length > 0)
a(0) = 10
}
val a = Array(1,2,3,4)
g(a)
a(0)
} ensuring(_ == 10)
}
import leon.lang._
object NestedFunParamsMutation2 {
def f(): Int = {
def g(a: Array[Int]): Unit = {
require(a.length > 0)
a(0) = 10
}
def h(a: Array[Int]): Unit = {
require(a.length > 0)
g(a)
}
val a = Array(1,2,3,4)
h(a)
a(0)
} ensuring(_ == 10)
}
/* Copyright 2009-2015 EPFL, Lausanne */
object ArrayAliasing10 {
def foo(): Int = {
val a = Array.fill(5)(0)
def rec(): Array[Int] = {
def nestedRec(): Array[Int] = {
a
}
nestedRec()
}
val b = rec()
b(0)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment