mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
While the comment is correct to state that this won't enable any new optimizations with -Onone, it does enable IRGen's lazy function emission, which is important for 'reasync' functions, which we don't want to emit at all even at -Onone. This fixes debug stdlib builds with the new reasync versions of the &&, || and ?? operators.
20 lines
884 B
Swift
20 lines
884 B
Swift
// RUN: %empty-directory(%t)
|
|
|
|
// Check if SIL printing+parsing of a clang imported function works.
|
|
|
|
// RUN: %target-swift-frontend -parse-as-library -module-name=static_inline -emit-sil %S/Inputs/static_inline.swift -enable-objc-interop -import-objc-header %S/Inputs/static_inline.h -o %t/static_inline.sil
|
|
// RUN: %FileCheck < %t/static_inline.sil %s
|
|
// RUN: %target-swift-frontend -parse-as-library -module-name=static_inline -O -emit-ir %t/static_inline.sil -enable-objc-interop -import-objc-header %S/Inputs/static_inline.h | %FileCheck --check-prefix=CHECK-IR %s
|
|
|
|
// CHECK: sil shared [clang c_inline_func] @c_inline_func : $@convention(c) (Int32) -> Int32
|
|
|
|
// CHECK-IR-LABEL: define{{.*}} i32 @"$s13static_inline6testit1xs5Int32VAE_tF"(i32 %0)
|
|
// CHECK-IR: = add {{.*}}, 27
|
|
// CHECK-IR: ret
|
|
|
|
import static_inline
|
|
|
|
public func mytest(x: Int32) -> Int32 {
|
|
return testit(x: x)
|
|
}
|