mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
// RUN: %target-sil-opt -sil-print-types %s | %FileCheck %s
|
|
|
|
// Generated from
|
|
// var x : Int32 = 2
|
|
// public func f() -> Int32 { return x }
|
|
// with swiftc -O -parse-as-library -emit-sil
|
|
|
|
import Builtin
|
|
import Swift
|
|
|
|
// CHECK: sil_global private @globalinit_token0 : $Builtin.Word
|
|
sil_global private @globalinit_token0 : $Builtin.Word
|
|
|
|
// CHECK: sil_global @_Tv2ch1xSi : $Int32 = {
|
|
// CHECK-NEXT: %0 = integer_literal $Builtin.Int32, 2
|
|
// CHECK-NEXT: %initval = struct $Int32 (%0 : $Builtin.Int32)
|
|
// CHECK-NEXT: }
|
|
sil_global @_Tv2ch1xSi : $Int32 = {
|
|
%0 = integer_literal $Builtin.Int32, 2
|
|
%initval = struct $Int32 (%0 : $Builtin.Int32)
|
|
}
|
|
|
|
// CHECK-LABEL: sil [global_init] @_TF2cha1xSi : $@convention(thin) () -> Builtin.RawPointer {
|
|
sil [global_init] @_TF2cha1xSi : $@convention(thin) () -> Builtin.RawPointer {
|
|
bb0:
|
|
%0 = global_addr @_Tv2ch1xSi : $*Int32
|
|
%1 = address_to_pointer %0 : $*Int32 to $Builtin.RawPointer
|
|
return %1 : $Builtin.RawPointer
|
|
}
|
|
|
|
// CHECK-LABEL: sil @_TF2ch1fFT_Si : $@convention(thin) () -> Int32 {
|
|
sil @_TF2ch1fFT_Si : $@convention(thin) () -> Int32 {
|
|
bb0:
|
|
%0 = global_addr @_Tv2ch1xSi : $*Int32
|
|
%1 = load %0 : $*Int32
|
|
return %1 : $Int32
|
|
}
|