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(
3232 if (auto fn = mod.lookUpFunction (name)) {
3333 assert (fn->getLoweredFunctionType () == type);
3434 assert (stripExternalFromLinkage (fn->getLinkage ()) ==
35- stripExternalFromLinkage (linkage));
35+ stripExternalFromLinkage (linkage) || mod. getOptions (). EmbeddedSwift );
3636 return fn;
3737 }
3838
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