A million element byte array segfaults

This commit is contained in:
Alexander Gorshenev
2016-11-28 18:03:43 +03:00
committed by alexander-gorshenev
parent 725512ad96
commit 5627688390
2 changed files with 18 additions and 0 deletions
+6
View File
@@ -419,4 +419,10 @@ task array_list1(type: RunKonanTest) {
goldValue = "OK\n"
source = "runtime/collections/array_list1.kt"
}
/*
task moderately_large_array(type: RunKonanTest) {
goldValue = "OK\n"
source = "runtime/collections/moderately_large_array.kt"
}
*/
@@ -0,0 +1,12 @@
fun main(args: Array<String>) {
val a = ByteArray(1000000)
var sum = 0
for (b in a) {
sum += b
}
println(sum)
}