1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
// RUN: %empty-directory(%t)
// RUN: %build-irgen-test-overlays
// RUN: %target-swift-frontend -enable-objc-interop -sdk %S/Inputs -primary-file %s -O -disable-sil-perf-optzns -emit-irgen -Xcc -fstack-protector -I %t | %FileCheck %s
// RUN: %empty-directory(%t/Empty.framework/Modules/Empty.swiftmodule)
// RUN: %target-swift-frontend -emit-module-path %t/Empty.framework/Modules/Empty.swiftmodule/%target-swiftmodule-name %S/../Inputs/empty.swift -module-name Empty -I %t
// RUN: %target-swift-frontend -sdk %S/Inputs -primary-file %s -I %t -F %t -DIMPORT_EMPTY -O -disable-sil-perf-optzns -emit-irgen -Xcc -fstack-protector -enable-objc-interop | %FileCheck %s
// REQUIRES: CPU=i386 || CPU=x86_64
// REQUIRES: objc_interop
#if IMPORT_EMPTY
import Empty
#endif
import gizmo
// CHECK-LABEL: define hidden swiftcc i64 @"$s12clang_inline16CallStaticInlineC10ReturnZeros5Int64VyF"(ptr swiftself %0) {{.*}} {
class CallStaticInline {
func ReturnZero() -> Int64 { return Int64(zero()) }
}
// CHECK-LABEL: define internal i32 @zero()
// CHECK-SAME: [[INLINEHINT_SSP_UWTABLE:#[0-9]+]] {
// CHECK-LABEL: define hidden swiftcc i64 @"$s12clang_inline17CallStaticInline2C10ReturnZeros5Int64VyF"(ptr swiftself %0) {{.*}} {
class CallStaticInline2 {
func ReturnZero() -> Int64 { return Int64(wrappedZero()) }
}
// CHECK-LABEL: define internal i32 @wrappedZero()
// CHECK-SAME: [[INLINEHINT_SSP_UWTABLE:#[0-9]+]] {
// CHECK-LABEL: define hidden swiftcc i32 @"$s12clang_inline10testExterns5Int32VyF"() {{.*}} {
func testExtern() -> CInt {
return wrappedGetInt()
}
// CHECK-LABEL: define internal i32 @wrappedGetInt()
// CHECK-SAME: [[INLINEHINT_SSP_UWTABLE:#[0-9]+]] {
// CHECK-LABEL: define hidden swiftcc i32 @"$s12clang_inline16testAlwaysInlines5Int32VyF"() {{.*}} {
func testAlwaysInline() -> CInt {
return alwaysInlineNumber()
}
// CHECK-LABEL: define internal i32 @alwaysInlineNumber()
// CHECK-SAME: [[ALWAYS_INLINE:#[0-9]+]] {
// CHECK-LABEL: define hidden swiftcc i32 @"$s12clang_inline20testInlineRedeclareds5Int32VyF"() {{.*}} {
func testInlineRedeclared() -> CInt {
return zeroRedeclared()
}
// CHECK-LABEL: define internal i32 @zeroRedeclared() #{{[0-9]+}} {
// CHECK-LABEL: define hidden swiftcc i32 @"$s12clang_inline27testInlineRedeclaredWrappeds5Int32VyF"() {{.*}} {
func testInlineRedeclaredWrapped() -> CInt {
return wrappedZeroRedeclared()
}
// CHECK-LABEL: define internal i32 @wrappedZeroRedeclared() #{{[0-9]+}} {
// CHECK-LABEL: define hidden swiftcc i32 @"$s12clang_inline22testStaticButNotInlines5Int32VyF"() {{.*}} {
func testStaticButNotInline() -> CInt {
return staticButNotInline()
}
// CHECK-LABEL: define internal i32 @staticButNotInline() #{{[0-9]+}} {
// CHECK-LABEL: define internal i32 @innerZero()
// CHECK-SAME: [[INNER_ZERO_ATTR:#[0-9]+]] {
// CHECK-LABEL: declare i32 @getInt()
// CHECK-SAME: [[GET_INT_ATTR:#[0-9]+]]
// CHECK-DAG: attributes [[INLINEHINT_SSP_UWTABLE]] = { inlinehint optsize ssp {{.*}}}
// CHECK-DAG: attributes [[ALWAYS_INLINE]] = { alwaysinline nounwind optsize ssp
// CHECK-DAG: attributes [[INNER_ZERO_ATTR]] = { inlinehint nounwind optsize ssp
// CHECK-DAG: attributes [[GET_INT_ATTR]] = {
|