JS: create new common directory for all generated tests, migrate several tests there

This commit is contained in:
Alexey Andreev
2016-08-26 16:44:48 +03:00
parent 34a57f863b
commit 2bf0199959
321 changed files with 2123 additions and 2001 deletions
+27
View File
@@ -0,0 +1,27 @@
package foo
// CHECK_CONTAINS_NO_CALLS: add
internal data class IntPair(public var fst: Int, public var snd: Int) {
inline public fun getFst(): Int { return fst }
inline public fun setFst(v: Int) { fst = v }
inline public fun getSnd(): Int { return this.snd }
inline public fun setSnd(v: Int) { this.snd = v }
}
internal fun add(p: IntPair, toFst: Int, toSnd: Int) {
val fst = p.getFst()
p.setFst(fst + toFst)
val snd = p.getSnd()
p.setSnd(snd + toSnd)
}
fun box(): String {
val p = IntPair(0, 0)
add(p, 1, 2)
assertEquals(IntPair(1, 2), p)
return "OK"
}