File tree Expand file tree Collapse file tree 2 files changed +50
-1
lines changed Expand file tree Collapse file tree 2 files changed +50
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ SILFunction *SILFunctionBuilder::getOrCreateFunction(
32
32
if (auto fn = mod.lookUpFunction (name)) {
33
33
assert (fn->getLoweredFunctionType () == type);
34
34
assert (stripExternalFromLinkage (fn->getLinkage ()) ==
35
- stripExternalFromLinkage (linkage));
35
+ stripExternalFromLinkage (linkage) || mod. getOptions (). EmbeddedSwift );
36
36
return fn;
37
37
}
38
38
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %{python} %utils/split_file.py -o %t %s
3
+
4
+ // RUN: %target-swift-frontend -emit-module -o %t/Module.swiftmodule %t/Module.swift -enable-experimental-feature Embedded
5
+ // RUN: %target-swift-frontend -emit-ir %t/Main.swift -I%t -enable-experimental-feature Embedded
6
+
7
+ // RUN: %target-swift-frontend -O -emit-module -o %t/Module.swiftmodule %t/Module.swift -enable-experimental-feature Embedded
8
+ // RUN: %target-swift-frontend -O -emit-ir %t/Main.swift -I%t -enable-experimental-feature Embedded
9
+
10
+ // RUN: %target-swift-frontend -Osize -emit-module -o %t/Module.swiftmodule %t/Module.swift -enable-experimental-feature Embedded
11
+ // RUN: %target-swift-frontend -Osize -emit-ir %t/Main.swift -I%t -enable-experimental-feature Embedded
12
+
13
+ // REQUIRES: swift_in_compiler
14
+ // REQUIRES: VENDOR=apple
15
+ // REQUIRES: OS=macosx
16
+
17
+ // BEGIN Module.swift
18
+
19
+ public func bar< R> ( count: Int , _ body: ( UnsafeMutableBufferPointer < Int > ) -> R ) -> R {
20
+ let pointer = UnsafeMutablePointer < Int > ( bitPattern: 42 ) !
21
+ let inoutBufferPointer = UnsafeMutableBufferPointer ( start: pointer, count: count)
22
+ return body ( inoutBufferPointer)
23
+ }
24
+
25
+ public func foo< R> ( _ body: ( ) -> R ) -> R {
26
+ bar ( count: 10 ) { p in
27
+ body ( )
28
+ }
29
+ }
30
+
31
+ public func module_func( ) {
32
+ foo {
33
+ return 0
34
+ }
35
+ }
36
+
37
+ // BEGIN Main.swift
38
+
39
+ import Module
40
+
41
+ public func test( ) {
42
+ module_func ( )
43
+ }
44
+
45
+ public func client_func( ) {
46
+ foo {
47
+ return 0
48
+ }
49
+ }
You can’t perform that action at this time.
0 commit comments