File tree Expand file tree Collapse file tree 3 files changed +30
-6
lines changed Expand file tree Collapse file tree 3 files changed +30
-6
lines changed Original file line number Diff line number Diff line change
1
+ @_inlineable public func testit( x: Int32 ) -> Int32 {
2
+ return c_inline_func ( x)
3
+ }
Original file line number Diff line number Diff line change 2
2
3
3
// Check if SIL printing+parsing of a clang imported function works.
4
4
5
- // RUN: %target-swift-frontend -parse-as-library -module-name=test -emit-sil %s -import-objc-header %S/Inputs/static_inline.h -o %t/test .sil
6
- // RUN: %FileCheck < %t/test .sil %s
7
- // RUN: %target-swift-frontend -parse-as-library -module-name=test -O -emit-ir %t/test .sil -import-objc-header %S/Inputs/static_inline.h | %FileCheck --check-prefix=CHECK-IR %s
5
+ // RUN: %target-swift-frontend -parse-as-library -module-name=static_inline -emit-sil %S/Inputs/static_inline.swift -import-objc-header %S/Inputs/static_inline.h -o %t/static_inline .sil
6
+ // RUN: %FileCheck < %t/static_inline .sil %s
7
+ // RUN: %target-swift-frontend -parse-as-library -module-name=static_inline -O -emit-ir %t/static_inline .sil -import-objc-header %S/Inputs/static_inline.h | %FileCheck --check-prefix=CHECK-IR %s
8
8
9
9
// CHECK: sil shared [serializable] [clang c_inline_func] @c_inline_func : $@convention(c) (Int32) -> Int32
10
10
11
- // CHECK-IR-LABEL: define{{.*}} i32 @"$S4test6testit1xs5Int32VAE_tF "(i32)
11
+ // CHECK-IR-LABEL: define{{.*}} i32 @"$S13static_inline6testit1xs5Int32VAE_tF "(i32)
12
12
// CHECK-IR: = add {{.*}}, 27
13
13
// CHECK-IR: ret
14
14
15
- public func testit( x: Int32 ) -> Int32 {
16
- return c_inline_func ( x)
15
+ import static_inline
16
+
17
+ public func mytest( x: Int32 ) -> Int32 {
18
+ return testit ( x: x)
17
19
}
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+
3
+ // Try serialization of clang-generated functions.
4
+
5
+ // RUN: %target-swift-frontend -parse-as-library -module-name=static_inline -emit-module %S/Inputs/static_inline.swift -import-objc-header %S/Inputs/static_inline.h -o %t/static_inline.swiftmodule
6
+ // RUN: %target-swift-frontend -module-name test -O -emit-sil %s -I %t | %FileCheck %s
7
+ // RUN: %target-swift-frontend -module-name test -O -emit-ir %s -I %t | %FileCheck --check-prefix=CHECK-IR %s
8
+
9
+ // CHECK: sil shared_external [clang c_inline_func] @c_inline_func : $@convention(c) (Int32) -> Int32
10
+
11
+ // CHECK-IR-LABEL: define{{.*}} i32 @"$S4test6mytest1xs5Int32VAE_tF"(i32)
12
+ // CHECK-IR: = add {{.*}}, 27
13
+ // CHECK-IR: ret
14
+
15
+ import static_inline
16
+
17
+ public func mytest( x: Int32 ) -> Int32 {
18
+ return testit ( x: x)
19
+ }
You can’t perform that action at this time.
0 commit comments