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

adapt tests to new array features

parent 6226db69
Branches
Tags
No related merge requests found
/* Copyright 2009-2015 EPFL, Lausanne */
object Array2 {
def foo(): Int = {
val a = Array.fill(5)(5)
val b = a
b(3)
}
}
/* Copyright 2009-2015 EPFL, Lausanne */
object Array3 {
def foo(): Int = {
val a = Array.fill(5)(5)
if(a.length > 2)
a(1) = 2
else
0
0
}
}
/* Copyright 2009-2015 EPFL, Lausanne */
object Array5 {
def foo(a: Array[Int]): Int = {
a(2) = 4
a(2)
}
}
// vim: set ts=4 sw=4 et:
/* Copyright 2009-2015 EPFL, Lausanne */
object Array6 {
def foo(): Int = {
val a = Array.fill(5)(5)
var b = a
b(0)
}
}
/* Copyright 2009-2015 EPFL, Lausanne */
object Array7 {
def foo(): Int = {
val a = Array.fill(5)(5)
var b = a
b(0)
}
}
/* Copyright 2009-2015 EPFL, Lausanne */
object Array8 {
object ArrayAliasing6 {
def foo(a: Array[Int]): Array[Int] = {
a
......
/* Copyright 2009-2015 EPFL, Lausanne */
object Array4 {
object ArrayAliasing7 {
def foo(a: Array[Int]): Int = {
def foo(a: Array[Int]): Array[Int] = {
val b = a
b(3)
b
}
}
/* Copyright 2009-2015 EPFL, Lausanne */
object Array9 {
object ArrayAliasing8 {
def foo(a: Array[Int]): Int = {
def rec(): Array[Int] = {
......
/* Copyright 2009-2015 EPFL, Lausanne */
object Array10 {
object ArrayAliasing9 {
def foo(): Int = {
val a = Array.fill(5)(0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment