-
Notifications
You must be signed in to change notification settings - Fork 10.4k
/
Copy pathpure_mode.sil
54 lines (45 loc) · 1.6 KB
/
pure_mode.sil
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
// RUN: %target-sil-opt %s | %target-sil-opt -sil-print-no-uses | %FileCheck %s
// REQUIRES: PTRSIZE=64
sil_stage canonical
import Builtin
import Swift
import SwiftShims
sil_global hidden @$s3nix2ggSSvp : $String
class C {
@_hasStorage var a: Builtin.Int64
@_hasStorage var b: Builtin.Int64
}
sil_global [let] @gc : $C = {
%0 = integer_literal $Builtin.Int64, 0
%1 = integer_literal $Builtin.Int64, 1
%2 = integer_literal $Builtin.Int64, 2
%3 = integer_literal $Builtin.Int64, 3
// CHECK: %initval = object $C (%0, %1, [tail_elems] %2, %3)
%initval = object $C (%0, %1, [tail_elems] %2, %3)
}
sil @main : $@convention(c) (Int32, UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>) -> Int32 {
[%1: noescape **]
[global: read,write,copy,deinit_barrier]
bb0(%0 : $Int32, %1 : $UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>):
alloc_global @$s3nix2ggSSvp
%3 = global_addr @$s3nix2ggSSvp : $*String
%4 = integer_literal $Builtin.Int64, 0
br bb1
bb2:
// CHECK: struct $String (%{{[0-9]+}} : $_StringGuts)
%10 = struct $String (%9 : $_StringGuts)
// CHECK: store %{{[0-9]+}} to %{{[0-9]+$}}
store %10 to %3 : $*String
%12 = integer_literal $Builtin.Int32, 0
%13 = struct $Int32 (%12 : $Builtin.Int32)
return %13 : $Int32
bb1:
%5 = integer_literal $Builtin.Int64, -2305843009213693952
// CHECK: struct $UInt64 (%{{[0-9]+}})
// CHECK-NOT: user:
%6 = struct $UInt64 (%4 : $Builtin.Int64)
%7 = value_to_bridge_object %5 : $Builtin.Int64
%8 = struct $_StringObject (%6 : $UInt64, %7 : $Builtin.BridgeObject)
%9 = struct $_StringGuts (%8 : $_StringObject)
br bb2
}