Files
swift-mirror/test/SILOptimizer/globalopt_linkage.swift
Erik Eckstein 39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00

29 lines
680 B
Swift

// RUN: %target-swift-frontend -O -Xllvm -sil-disable-pass=inline -emit-sil -primary-file %s | %FileCheck %s
// Check if GlobalOpt generates the getters with the right linkage and the right mangling
struct MyStruct {
static let StaticVar = 10
}
let Global = 27
func testit() -> Int {
return MyStruct.StaticVar + Global + PublicGlobal
}
public let PublicGlobal = 27
_ = testit()
// CHECK: sil hidden @{{.*}}testit
// CHECK: // MyStruct.StaticVar.getter
// CHECK-NEXT: sil private @$s{{.*}}StaticVar
// CHECK: // Global.getter
// CHECK-NEXT: sil private @$s{{.*}}Global
// CHECK: // PublicGlobal.getter
// CHECK-NEXT: sil non_abi @$s{{.*}}PublicGlobal