[IR] add testdata for irJsText

This commit is contained in:
Zalim Bashorov
2020-11-10 15:50:58 +03:00
committed by teamcityserver
parent 68b17fe55b
commit cdc74304c7
27 changed files with 516 additions and 0 deletions
@@ -0,0 +1,12 @@
fun test1(d: dynamic): String {
return d /*~> Any */.toString()
}
fun test2(d: dynamic): Int {
return d /*~> Any */.hashCode()
}
fun test3(d: dynamic): Boolean {
return d /*~> Any */.equals(other = 42)
}
@@ -0,0 +1,15 @@
fun testArrayAccess1(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testArrayAccess2(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testArrayAccess3(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
@@ -0,0 +1,10 @@
fun testArrayAssignment(d: dynamic) {
error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testArrayAssignmentFake(d: dynamic) {
error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
@@ -0,0 +1,13 @@
fun testArrayAugmentedAssignment(d: dynamic) {
error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
@@ -0,0 +1,11 @@
fun testArrayIncrementDecrement(d: dynamic) {
val t1: dynamic = error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
val t2: dynamic = error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
val t3: dynamic = error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
val t4: dynamic = error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
@@ -0,0 +1,20 @@
fun testEqeq(d: dynamic): Boolean {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testExclEq(d: dynamic): Boolean {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testEqeqeq(d: dynamic): Boolean {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testExclEqeq(d: dynamic): Boolean {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
@@ -0,0 +1,10 @@
fun testAndAnd(d: dynamic): Boolean {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testOrOr(d: dynamic): Boolean {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
@@ -0,0 +1,25 @@
fun testBinaryPlus(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testBinaryMinus(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testMul(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testDiv(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testMod(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
@@ -0,0 +1,20 @@
fun testLess(d: dynamic): Boolean {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testLessOrEqual(d: dynamic): Boolean {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testGreater(d: dynamic): Boolean {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testGreaterOrEqual(d: dynamic): Boolean {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
@@ -0,0 +1,21 @@
fun test1(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun test2(d: dynamic): dynamic {
return { // BLOCK
val tmp0_safe_receiver: dynamic = d
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
true -> error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
}
}
fun test3(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
@@ -0,0 +1,10 @@
fun test(d: dynamic): dynamic {
return { // BLOCK
val tmp0_elvis_lhs: dynamic = d
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> "other"
true -> tmp0_elvis_lhs
}
}
}
@@ -0,0 +1,4 @@
fun test(d: dynamic): dynamic {
return CHECK_NOT_NULL<dynamic>(arg0 = d)
}
@@ -0,0 +1,10 @@
fun test1(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun test2(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
@@ -0,0 +1,16 @@
fun test1(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicMemberExpressionImpl */
}
fun test2(d: dynamic): dynamic {
return { // BLOCK
val tmp0_safe_receiver: dynamic = d
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
true -> error("") /* ERROR: unsupported element type: IrDynamicMemberExpressionImpl */
}
}
}
@@ -0,0 +1,16 @@
fun testMemberAssignment(d: dynamic) {
error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testSafeMemberAssignment(d: dynamic) {
{ // BLOCK
val tmp0_safe_receiver: dynamic = d
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null /*~> Unit */
true -> error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
}
}
@@ -0,0 +1,56 @@
fun testAugmentedMemberAssignment(d: dynamic) {
error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testSafeAugmentedMemberAssignment(d: dynamic) {
{ // BLOCK
val tmp0_safe_receiver: dynamic = d
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null /*~> Unit */
true -> error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
}
{ // BLOCK
val tmp1_safe_receiver: dynamic = d
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null /*~> Unit */
true -> error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
}
{ // BLOCK
val tmp2_safe_receiver: dynamic = d
when {
EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null /*~> Unit */
true -> error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
}
{ // BLOCK
val tmp3_safe_receiver: dynamic = d
when {
EQEQ(arg0 = tmp3_safe_receiver, arg1 = null) -> null /*~> Unit */
true -> error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
}
{ // BLOCK
val tmp4_safe_receiver: dynamic = d
when {
EQEQ(arg0 = tmp4_safe_receiver, arg1 = null) -> null /*~> Unit */
true -> error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
}
}
@@ -0,0 +1,46 @@
fun testMemberIncrementDecrement(d: dynamic) {
val t1: dynamic = error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
val t2: dynamic = error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
val t3: dynamic = error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
val t4: dynamic = error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testSafeMemberIncrementDecrement(d: dynamic) {
val t1: dynamic = { // BLOCK
val tmp0_safe_receiver: dynamic = d
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
true -> error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
}
val t2: dynamic = { // BLOCK
val tmp1_safe_receiver: dynamic = d
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
true -> error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
}
val t3: dynamic = { // BLOCK
val tmp2_safe_receiver: dynamic = d
when {
EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null
true -> error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
}
val t4: dynamic = { // BLOCK
val tmp3_safe_receiver: dynamic = d
when {
EQEQ(arg0 = tmp3_safe_receiver, arg1 = null) -> null
true -> error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
}
}
@@ -0,0 +1,15 @@
fun testUnaryMinus(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testUnaryPlus(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun testExcl(d: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
@@ -0,0 +1,14 @@
fun test1(d: dynamic): Int {
return when {
d is String -> d /*~> String */.<get-length>()
true -> -1
}
}
fun test2(d: dynamic): Int {
return when {
d is Array<*> -> d /*~> Array<out Any?> */.<get-size>()
true -> -1
}
}
@@ -0,0 +1,25 @@
val d: dynamic
field = 1
get
val p: Int
field = <get-d>() /*~> Int */
get
fun test1(d: dynamic): Int {
return d /*~> Int */
}
fun test2(d: dynamic): Any {
return d /*~> Any */
}
fun test3(d: dynamic): Any? {
return d
}
fun test4(d: dynamic): String {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
/*~> String */
}
@@ -0,0 +1,42 @@
val d1: dynamic
field = 1
get
val p: Int
field = 1
get
var d2: dynamic
field = <get-p>()
get
set
fun withDynamic(d: dynamic): dynamic {
return d
}
fun test1(s: String) {
withDynamic(d = s)
}
fun test2(a: Any) {
val d: dynamic = a
}
fun test3(a: Any?) {
val d: dynamic = a
}
fun test4(a: Any, s: String, na: Any?) {
var d: dynamic = <get-p>()
d = a
d = na
d = s
}
fun test5(a: Any, s: String, na: Any?) {
<set-d2>(<set-?> = a)
<set-d2>(<set-?> = na)
<set-d2>(<set-?> = s)
}
@@ -0,0 +1,37 @@
fun invoke() {
}
fun test1(a: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun test2(a: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun test3(a: dynamic, b: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun test4(a: dynamic, b: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun test5(a: dynamic, b: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun test6(a: dynamic, b: dynamic): dynamic {
return error("") /* ERROR: unsupported element type: IrDynamicOperatorExpressionImpl */
}
fun test7(a: dynamic) {
return invoke()
}
+37
View File
@@ -0,0 +1,37 @@
package events
open external class internal {
external constructor() /* primary */
open external class EventEmitterP : internal {
external constructor() /* primary */
}
open external class EventEmitterS : internal {
external constructor(a: Any)
}
external object NestedExternalObject : internal {
private external constructor() /* primary */
}
external enum class NestedExternalEnum : Enum<NestedExternalEnum> {
private external constructor() /* primary */
A = NestedExternalEnum()
B = NestedExternalEnum()
fun values(): Array<NestedExternalEnum> /* Synthetic body for ENUM_VALUES */
fun valueOf(value: String): NestedExternalEnum /* Synthetic body for ENUM_VALUEOF */
}
external interface NestedExternalInterface {
}
}
@@ -0,0 +1,28 @@
package foo
open external class A {
external constructor() /* primary */
fun foo(): String
}
open external class B : A {
external constructor() /* primary */
fun bar(): String
}
class C : B {
constructor() /* primary */ {
super/*B*/()
/* <init>() */
}
}
fun box(): String {
val c: C = C()
return "OK"
}
@@ -0,0 +1 @@
/* ERROR: unsupported element type: IrScriptImpl */
+1
View File
@@ -0,0 +1 @@
/* ERROR: unsupported element type: IrScriptImpl */
@@ -0,0 +1 @@
/* ERROR: unsupported element type: IrScriptImpl */