[K/N] Protect filecheck tests for KT-53261 from DCE.
This commit is contained in:
committed by
Space Team
parent
f434228244
commit
a8cec11772
@@ -3,8 +3,42 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
import kotlin.native.concurrent.*
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
fun main(arr: Array<String>) {
|
||||
println(arr[0].toInt() + 1)
|
||||
println(arr.size.toByte() == arr[0].toByte())
|
||||
println(arr.size.toUByte() == arr[0].toUByte())
|
||||
println(arr.size.toShort() == arr[0].toShort())
|
||||
println(arr.size.toUShort() == arr[0].toUShort())
|
||||
println(arr.size.toInt() == arr[0].toInt())
|
||||
println(arr.size.toUInt() == arr[0].toUInt())
|
||||
println(arr.size.toLong() == arr[0].toLong())
|
||||
println(arr.size.toULong() == arr[0].toULong())
|
||||
println(arr.size.toFloat() == arr[0].toFloat())
|
||||
println(arr.size.toDouble() == arr[0].toDouble())
|
||||
println(Char(arr.size) == arr[0][0])
|
||||
println((arr.size == 1) == (arr[0] == "1")) // Boolean
|
||||
|
||||
memScoped {
|
||||
val var1: IntVar = alloc()
|
||||
val var2: IntVar = alloc()
|
||||
println(var1.ptr.rawValue == var2.ptr.rawValue)
|
||||
}
|
||||
|
||||
println(Result.success(arr.size) == Result.success(arr[0].toInt()))
|
||||
println(vectorOf(arr.size, arr.size, arr.size, arr.size) == vectorOf(arr[0].toInt(), arr[0].toInt(), arr[0].toInt(), arr[0].toInt()))
|
||||
|
||||
val w1 = Worker.start()
|
||||
val w2 = Worker.start()
|
||||
println(w1 == w2)
|
||||
|
||||
val f1 = w1.requestTermination()
|
||||
val f2 = w2.requestTermination()
|
||||
println(f1 == f2)
|
||||
|
||||
f1.result
|
||||
f2.result
|
||||
}
|
||||
// CHECK-NOT: {{call|invoke}} i64 @"kfun:kotlin#<Long-unbox>
|
||||
// CHECK-NOT: {{call|invoke}} i64 @"kfun:kotlin#<ULong-unbox>
|
||||
|
||||
@@ -3,7 +3,13 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
fun main(arr: Array<String>) {
|
||||
println(arr[0].toInt() + 1)
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
// CHECK-LABEL: define zeroext i1 @"kfun:kotlinx.cinterop.CPointer#equals(kotlin.Any?){}kotlin.Boolean"(i8* %0, %struct.ObjHeader* %1)
|
||||
// CHECK: call i8* @"kfun:kotlinx.cinterop#<CPointer-unbox>(kotlin.Any?){}kotlinx.cinterop.CPointer<-1:0>?"
|
||||
|
||||
fun main() = memScoped {
|
||||
val var1: IntVar = alloc()
|
||||
val var2: IntVar = alloc()
|
||||
println(var1.ptr == var2.ptr)
|
||||
}
|
||||
// CHECK: {{call|invoke}} i8* @"kfun:kotlinx.cinterop#<CPointer-unbox>
|
||||
|
||||
+8
-3
@@ -3,7 +3,12 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
fun main(arr: Array<String>) {
|
||||
println(arr[0].toInt() + 1)
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
// CHECK-LABEL: define i8* @"kfun:kotlinx.cinterop#interpretOpaquePointed(kotlin.native.internal.NativePtr){}kotlinx.cinterop.NativePointed"(i8* %0)
|
||||
// CHECK: call i8* @"kfun:kotlinx.cinterop#<NativePointed-unbox>(kotlin.Any?){}kotlinx.cinterop.NativePointed?"
|
||||
|
||||
fun main() = memScoped {
|
||||
val var1: NativePointed = alloc(4, 4)
|
||||
println(interpretOpaquePointed(var1.rawPtr))
|
||||
}
|
||||
// CHECK: {{call|invoke}} i8* @"kfun:kotlinx.cinterop#<NativePointed-unbox>
|
||||
|
||||
+10
-3
@@ -3,7 +3,14 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
fun main(arr: Array<String>) {
|
||||
println(arr[0].toInt() + 1)
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
// CHECK-LABEL: define zeroext i1 @"kfun:kotlin.native.internal.NonNullNativePtr#equals(kotlin.Any?){}kotlin.Boolean"(i8* %0, %struct.ObjHeader* %1)
|
||||
// CHECK: call i8* @"kfun:kotlin.native.internal#<NonNullNativePtr-unbox>(kotlin.Any?){}kotlin.native.internal.NonNullNativePtr?"
|
||||
|
||||
fun main() = memScoped {
|
||||
val var1: IntVar = alloc()
|
||||
val var2: IntVar = alloc()
|
||||
@Suppress("INVISIBLE_MEMBER")
|
||||
println(var1.ptr.value as Any == var2.ptr.value as Any)
|
||||
}
|
||||
// CHECK: {{call|invoke}} i8* @"kfun:kotlin.native.internal#<NonNullNativePtr-unbox>
|
||||
|
||||
@@ -3,7 +3,15 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
fun main(arr: Array<String>) {
|
||||
println(arr[0].toInt() + 1)
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
// CHECK-LABEL: define zeroext i1 @"kfun:kotlinx.cinterop.StableRef#equals(kotlin.Any?){}kotlin.Boolean"(i8* %0, %struct.ObjHeader* %1)
|
||||
// CHECK: call i8* @"kfun:kotlinx.cinterop#<StableRef-unbox>(kotlin.Any?){}kotlinx.cinterop.StableRef<-1:0>?"
|
||||
|
||||
fun main() {
|
||||
val ref1 = StableRef.create(Any())
|
||||
val ref2 = StableRef.create(Any())
|
||||
println(ref1 == ref2)
|
||||
ref2.dispose()
|
||||
ref1.dispose()
|
||||
}
|
||||
// CHECK: {{call|invoke}} i8* @"kfun:kotlinx.cinterop#<StableRef-unbox>
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
fun main(arr: Array<String>) {
|
||||
println(arr[0].toInt() + 1)
|
||||
// CHECK-LABEL: define zeroext i1 @"kfun:kotlin.UByteArray#equals(kotlin.Any?){}kotlin.Boolean"(%struct.ObjHeader* %0, %struct.ObjHeader* %1)
|
||||
// CHECK: call %struct.ObjHeader* @"kfun:kotlin#<UByteArray-unbox>(kotlin.Any?){}kotlin.UByteArray?"
|
||||
|
||||
fun main() {
|
||||
val arr1 = UByteArray(10) { it.toUByte() }
|
||||
val arr2 = UByteArray(10) { (it / 2).toUByte() }
|
||||
println(arr1 == arr2)
|
||||
}
|
||||
// CHECK: {{call|invoke}} %struct.ObjHeader* @"kfun:kotlin#<UByteArray-unbox>
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
fun main(arr: Array<String>) {
|
||||
println(arr[0].toInt() + 1)
|
||||
// CHECK-LABEL: define zeroext i1 @"kfun:kotlin.UIntArray#equals(kotlin.Any?){}kotlin.Boolean"(%struct.ObjHeader* %0, %struct.ObjHeader* %1)
|
||||
// CHECK: call %struct.ObjHeader* @"kfun:kotlin#<UIntArray-unbox>(kotlin.Any?){}kotlin.UIntArray?"
|
||||
|
||||
fun main() {
|
||||
val arr1 = UIntArray(10) { it.toUInt() }
|
||||
val arr2 = UIntArray(10) { (it / 2).toUInt() }
|
||||
println(arr1 == arr2)
|
||||
}
|
||||
// CHECK: {{call|invoke}} %struct.ObjHeader* @"kfun:kotlin#<UIntArray-unbox>
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
fun main(arr: Array<String>) {
|
||||
println(arr[0].toInt() + 1)
|
||||
// CHECK-LABEL: define zeroext i1 @"kfun:kotlin.ULongArray#equals(kotlin.Any?){}kotlin.Boolean"(%struct.ObjHeader* %0, %struct.ObjHeader* %1)
|
||||
// CHECK: call %struct.ObjHeader* @"kfun:kotlin#<ULongArray-unbox>(kotlin.Any?){}kotlin.ULongArray?"
|
||||
|
||||
fun main() {
|
||||
val arr1 = ULongArray(10) { it.toULong() }
|
||||
val arr2 = ULongArray(10) { (it / 2).toULong() }
|
||||
println(arr1 == arr2)
|
||||
}
|
||||
// CHECK: {{call|invoke}} %struct.ObjHeader* @"kfun:kotlin#<ULongArray-unbox>
|
||||
|
||||
+7
-3
@@ -3,7 +3,11 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
fun main(arr: Array<String>) {
|
||||
println(arr[0].toInt() + 1)
|
||||
// CHECK-LABEL: define zeroext i1 @"kfun:kotlin.UShortArray#equals(kotlin.Any?){}kotlin.Boolean"(%struct.ObjHeader* %0, %struct.ObjHeader* %1)
|
||||
// CHECK: call %struct.ObjHeader* @"kfun:kotlin#<UShortArray-unbox>(kotlin.Any?){}kotlin.UShortArray?"
|
||||
|
||||
fun main() {
|
||||
val arr1 = UShortArray(10) { it.toUShort() }
|
||||
val arr2 = UShortArray(10) { (it / 2).toUShort() }
|
||||
println(arr1 == arr2)
|
||||
}
|
||||
// CHECK: {{call|invoke}} %struct.ObjHeader* @"kfun:kotlin#<UShortArray-unbox>
|
||||
|
||||
+5
-8
@@ -3,15 +3,12 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
|
||||
// CHECK-LABEL: define zeroext i1 @"kfun:C#equals(kotlin.Any?){}kotlin.Boolean"(%struct.ObjHeader* %0, %struct.ObjHeader* %1)
|
||||
// CHECK: call %struct.ObjHeader* @"kfun:#<C-unbox>(kotlin.Any?){}C?"
|
||||
value class C(val x: Any)
|
||||
val c = C(42)
|
||||
// Note: <C-unbox> is also called from bridges for equals, hashCode and toString.
|
||||
|
||||
fun main() {
|
||||
println(c.x)
|
||||
println(C(42) == C(13))
|
||||
}
|
||||
// CHECK: {{call|invoke}} %struct.ObjHeader* @"kfun:#<C-unbox>
|
||||
|
||||
// Note: <C-unbox> is called from IR of generated methods like
|
||||
// FUN BRIDGE_METHOD(target=FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals
|
||||
// FUN BRIDGE_METHOD(target=FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode
|
||||
// FUN BRIDGE_METHOD(target=FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString
|
||||
|
||||
Reference in New Issue
Block a user