]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/codegen/switch.go
cmd/compile: use cache in front of convI2I
[gostls13.git] / test / codegen / switch.go
index b0186ba5b7c1eb0c73ccb26325d031b62f027300..4103bf5297b5364f2b9f3701a5cde5e5ec5a52f3 100644 (file)
@@ -125,6 +125,10 @@ type I interface {
 type J interface {
        bar()
 }
+type IJ interface {
+       I
+       J
+}
 
 // use a runtime call for type switches to interface types.
 func interfaceSwitch(x any) int {
@@ -148,3 +152,9 @@ func interfaceCast(x any) int {
        }
        return 5
 }
+
+func interfaceConv(x IJ) I {
+       // amd64:`CALL\truntime.typeAssert`,`MOVL\t16\(.*\)`,`MOVQ\t8\(.*\)(.*\*1)`
+       // arm64:`CALL\truntime.typeAssert`,`LDAR`,`MOVWU`,`MOVD\t\(R.*\)\(R.*\)`
+       return x
+}