| // RUN: %empty-directory(%t) |
| |
| // Check if SIL printing+parsing of a clang imported function works. |
| |
| // 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 |
| // RUN: %FileCheck < %t/test.sil %s |
| // 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 |
| |
| // CHECK: sil shared [serializable] [clang c_inline_func] @c_inline_func : $@convention(c) (Int32) -> Int32 |
| |
| // CHECK-IR-LABEL: define{{.*}} i32 @"$S4test6testit1xs5Int32VAE_tF"(i32) |
| // CHECK-IR: = add {{.*}}, 27 |
| // CHECK-IR: ret |
| |
| public func testit(x: Int32) -> Int32 { |
| return c_inline_func(x) |
| } |