Skip to content

Commit 20604d4

Browse files
committed
[embedded] Merge two related tests, add a TODO about adding executable tests
1 parent 350107e commit 20604d4

File tree

2 files changed

+22
-40
lines changed

2 files changed

+22
-40
lines changed

test/embedded/array-builtins-no-stdlib.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-swift-emit-ir %s -parse-stdlib -module-name Swift -enable-experimental-feature Embedded -target arm64e-apple-none | %FileCheck %s
22

3+
// TODO: these builtins in embedded Swift have a completely different IRGen, we need executable tests for them.
4+
35
class MyClass {}
46

57
struct MyStruct {
@@ -19,6 +21,26 @@ public func foo(x: Builtin.RawPointer, y: Builtin.RawPointer, count: Builtin.Wor
1921
Builtin.destroyArray(MyStruct.self, x, count)
2022
}
2123

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+
2244
// No runtime calls should be present.
2345
// CHECK-NOT: @swift_arrayInitWithCopy
2446
// CHECK-NOT: @swift_arrayInitWithTakeNoAlias

test/embedded/array-builtins2-no-stdlib.swift

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)