@@ -51,53 +51,53 @@ class ArrayApplyOptTest extends DottyBytecodeTest {
51
51
@ Test def testArrayApplyBoolean = {
52
52
val init = List (Op (DUP ), Op (ICONST_0 ), Op (ICONST_1 ), Op (BASTORE ), Op (DUP ), Op (ICONST_1 ), Op (ICONST_0 ), Op (BASTORE ))
53
53
test(" Array(true, false)" , newArray2Opcodes(T_BOOLEAN , init))
54
- test(" IArray(true, false)" , newArray2Opcodes(T_BOOLEAN , init :+ TypeOp ( CHECKCAST , " [Z " ) ))
54
+ test(" IArray(true, false)" , newArray2Opcodes(T_BOOLEAN , init))
55
55
}
56
56
57
57
@ Test def testArrayApplyByte = {
58
58
val init = List (Op (DUP ), Op (ICONST_0 ), Op (ICONST_1 ), Op (BASTORE ), Op (DUP ), Op (ICONST_1 ), Op (ICONST_2 ), Op (BASTORE ))
59
- test(" Array[Byte](1 , 2)" , newArray2Opcodes(T_BYTE , init))
60
- test(" IArray[Byte](1 , 2)" , newArray2Opcodes(T_BYTE , init :+ TypeOp ( CHECKCAST , " [B " ) ))
59
+ test(" Array(1: Byte , 2: Byte )" , newArray2Opcodes(T_BYTE , init))
60
+ test(" IArray(1: Byte , 2: Byte )" , newArray2Opcodes(T_BYTE , init))
61
61
}
62
62
63
63
@ Test def testArrayApplyShort = {
64
64
val init = List (Op (DUP ), Op (ICONST_0 ), Op (ICONST_1 ), Op (SASTORE ), Op (DUP ), Op (ICONST_1 ), Op (ICONST_2 ), Op (SASTORE ))
65
- test(" Array[Short](1 , 2)" , newArray2Opcodes(T_SHORT , init))
66
- test(" IArray[Short](1 , 2)" , newArray2Opcodes(T_SHORT , init :+ TypeOp ( CHECKCAST , " [S " ) ))
65
+ test(" Array(1: Short , 2: Short )" , newArray2Opcodes(T_SHORT , init))
66
+ test(" IArray(1: Short , 2: Short )" , newArray2Opcodes(T_SHORT , init))
67
67
}
68
68
69
69
@ Test def testArrayApplyInt = {
70
70
val init = List (Op (DUP ), Op (ICONST_0 ), Op (ICONST_1 ), Op (IASTORE ), Op (DUP ), Op (ICONST_1 ), Op (ICONST_2 ), Op (IASTORE ))
71
71
test(" Array(1, 2)" , newArray2Opcodes(T_INT , init))
72
- test(" IArray(1, 2)" , newArray2Opcodes(T_INT , init :+ TypeOp ( CHECKCAST , " [I " ) ))
72
+ test(" IArray(1, 2)" , newArray2Opcodes(T_INT , init))
73
73
74
- val init2 = List (Op (DUP ), Op (ICONST_0 ), Field (GETSTATIC , " Foo$" , " MODULE$" , " LFoo$;" ), Invoke (INVOKEVIRTUAL , " Foo$" , " t" , " ()I" , false ), Op (IASTORE ), Op (DUP ), Op (ICONST_1 ), Field (GETSTATIC , " Foo$" , " MODULE$" , " LFoo$;" ), Invoke (INVOKEVIRTUAL , " Foo$" , " t" , " ()I" , false ), Op (IASTORE ))
75
- test(""" Array[T](t, t)""" , newArray2Opcodes(T_INT , init2))
76
- test(""" IArray[T](t, t)""" , newArray2Opcodes(T_INT , init2 :+ TypeOp ( CHECKCAST , " [I " ) ))
74
+ val init2 = List (Op (DUP ), Op (ICONST_0 ), Field (GETSTATIC , " Foo$" , " MODULE$" , " LFoo$;" ), Invoke (INVOKEVIRTUAL , " Foo$" , " t" , " ()I" , false ), Op (IASTORE ), Op (DUP ), Op (ICONST_1 ), Field (GETSTATIC , " Foo$" , " MODULE$" , " LFoo$;" ), Invoke (INVOKEVIRTUAL , " Foo$" , " t" , " ()I" , false ), Op (IASTORE ), TypeOp ( CHECKCAST , " [I " ) )
75
+ test(""" Array[T](t, t): Array[T] """ , newArray2Opcodes(T_INT , init2))
76
+ test(""" IArray[T](t, t): IArray[T] """ , newArray2Opcodes(T_INT , init2))
77
77
}
78
78
79
79
@ Test def testArrayApplyLong = {
80
80
val init = List (Op (DUP ), Op (ICONST_0 ), Ldc (LDC , 2 ), Op (LASTORE ), Op (DUP ), Op (ICONST_1 ), Ldc (LDC , 3 ), Op (LASTORE ))
81
81
test(" Array(2L, 3L)" , newArray2Opcodes(T_LONG , init))
82
- test(" IArray(2L, 3L)" , newArray2Opcodes(T_LONG , init :+ TypeOp ( CHECKCAST , " [J " ) ))
82
+ test(" IArray(2L, 3L)" , newArray2Opcodes(T_LONG , init))
83
83
}
84
84
85
85
@ Test def testArrayApplyFloat = {
86
86
val init = List (Op (DUP ), Op (ICONST_0 ), Ldc (LDC , 2.1f ), Op (FASTORE ), Op (DUP ), Op (ICONST_1 ), Ldc (LDC , 3.1f ), Op (FASTORE ))
87
87
test(" Array(2.1f, 3.1f)" , newArray2Opcodes(T_FLOAT , init))
88
- test(" IArray(2.1f, 3.1f)" , newArray2Opcodes(T_FLOAT , init :+ TypeOp ( CHECKCAST , " [F " ) ))
88
+ test(" IArray(2.1f, 3.1f)" , newArray2Opcodes(T_FLOAT , init))
89
89
}
90
90
91
91
@ Test def testArrayApplyDouble = {
92
92
val init = List (Op (DUP ), Op (ICONST_0 ), Ldc (LDC , 2.2d ), Op (DASTORE ), Op (DUP ), Op (ICONST_1 ), Ldc (LDC , 3.2d ), Op (DASTORE ))
93
93
test(" Array(2.2d, 3.2d)" , newArray2Opcodes(T_DOUBLE , init))
94
- test(" IArray(2.2d, 3.2d)" , newArray2Opcodes(T_DOUBLE , init :+ TypeOp ( CHECKCAST , " [D " ) ))
94
+ test(" IArray(2.2d, 3.2d)" , newArray2Opcodes(T_DOUBLE , init))
95
95
}
96
96
97
97
@ Test def testArrayApplyChar = {
98
98
val init = List (Op (DUP ), Op (ICONST_0 ), IntOp (BIPUSH , 120 ), Op (CASTORE ), Op (DUP ), Op (ICONST_1 ), IntOp (BIPUSH , 121 ), Op (CASTORE ))
99
99
test(" Array('x', 'y')" , newArray2Opcodes(T_CHAR , init))
100
- test(" IArray('x', 'y')" , newArray2Opcodes(T_CHAR , init :+ TypeOp ( CHECKCAST , " [C " ) ))
100
+ test(" IArray('x', 'y')" , newArray2Opcodes(T_CHAR , init))
101
101
}
102
102
103
103
@ Test def testArrayApplyUnit = {
0 commit comments