1
1
// RUN: %target-swift-emit-ir %s -parse-stdlib -module-name Swift -enable-experimental-feature Embedded -target arm64e-apple-none | %FileCheck %s
2
2
3
+ // TODO: these builtins in embedded Swift have a completely different IRGen, we need executable tests for them.
4
+
3
5
class MyClass { }
4
6
5
7
struct MyStruct {
@@ -19,6 +21,26 @@ public func foo(x: Builtin.RawPointer, y: Builtin.RawPointer, count: Builtin.Wor
19
21
Builtin . destroyArray ( MyStruct . self, x, count)
20
22
}
21
23
24
+ public func bar( x: Builtin . RawPointer , y: Builtin . RawPointer , count: Builtin . Word ) {
25
+ var s = MyGenericStruct < MyStruct > ( )
26
+ s. foo ( x: x, y: y, count: count)
27
+ }
28
+
29
+ public struct MyGenericStruct < T> {
30
+ public func foo( x: Builtin . RawPointer , y: Builtin . RawPointer , count: Builtin . Word ) {
31
+ Builtin . copyArray ( T . self, x, y, count)
32
+ Builtin . copyArray ( T . self, x, y, count)
33
+ Builtin . takeArrayNoAlias ( T . self, x, y, count)
34
+ Builtin . takeArrayFrontToBack ( T . self, x, y, count)
35
+ Builtin . takeArrayBackToFront ( T . self, x, y, count)
36
+ Builtin . assignCopyArrayNoAlias ( T . self, x, y, count)
37
+ Builtin . assignCopyArrayFrontToBack ( T . self, x, y, count)
38
+ Builtin . assignCopyArrayBackToFront ( T . self, x, y, count)
39
+ Builtin . assignTakeArray ( T . self, x, y, count)
40
+ Builtin . destroyArray ( T . self, x, count)
41
+ }
42
+ }
43
+
22
44
// No runtime calls should be present.
23
45
// CHECK-NOT: @swift_arrayInitWithCopy
24
46
// CHECK-NOT: @swift_arrayInitWithTakeNoAlias
0 commit comments