Skip to content

Commit c9d31ec

Browse files
committed
Fix test to work on 64-bit and 32-bit targets
rdar://98728891
1 parent a39588a commit c9d31ec

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed
Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,75 @@
11
// RUN: %target-sil-opt -enable-sil-verify-all %s -inline -sil-print-debuginfo | %FileCheck %s
22

33
// Generated from:
4-
// func g(_ x: Int) -> Int {
4+
// func g(_ x: Int64) -> Int64 {
55
// if (x > 0) {
66
// return 1
77
// }
88
// return 0
99
// }
1010
//
11-
// public func f(_ x: Int) -> Int { return g(x) }
11+
// public func f(_ x: Int64) -> Int64 { return g(x) }
1212

13-
// CHECK: sil @$s1a1fyS2iF : $@convention(thin) (Int) -> Int {
14-
// CHECK: bb0(%0 : $Int):
13+
// CHECK: sil @$s1a1gys5Int64VADF : $@convention(thin) (Int64) -> Int64 {
14+
// CHECK: bb0(%0 : $Int64):
1515
// CHECK-NEXT: scope [[SCOPE_10:[0-9]+]]
16-
// CHECK: cond_br {{.*}}, bb1, bb2, loc "t.swift":3:9, scope [[SCOPE_10]]
16+
// CHECK: cond_br {{.*}}, bb1, bb2, loc "t.swift":2:9, scope [[SCOPE_10]]
1717
// CHECK: bb1:
1818
// CHECK-NEXT: scope [[SCOPE_11:[0-9]+]]
19-
// CHECK: br bb3({{.*}} : $Int), loc "t.swift":4:5, scope [[SCOPE_11]]
19+
// CHECK: br bb3({{.*}} : $Int64), loc "t.swift":3:5, scope [[SCOPE_11]]
2020
// CHECK: bb2:
2121
// CHECK-NEXT: scope [[SCOPE_9:[0-9]+]]
22-
// CHECK: br bb3({{.*}} : $Int), loc "t.swift":6:3, scope [[SCOPE_9]]
23-
// CHECK: bb3({{.*}} : $Int):
22+
// CHECK: br bb3({{.*}} : $Int64), loc "t.swift":5:3, scope [[SCOPE_9]]
23+
// CHECK: bb3({{.*}} : $Int64):
2424

2525
sil_stage canonical
2626

2727
import Builtin
2828
import Swift
2929
import SwiftShims
3030

31-
func g(_ x: Int) -> Int
31+
func g(_ x: Int64) -> Int64
3232

33-
public func f(_ x: Int) -> Int
33+
public func f(_ x: Int64) -> Int64
3434

35-
sil_scope 1 { loc "t.swift":2:6 parent @$s1a1gyS2iF : $@convention(thin) (Int) -> Int }
36-
sil_scope 2 { loc "t.swift":2:25 parent 1 }
37-
sil_scope 3 { loc "t.swift":3:3 parent 2 }
38-
sil_scope 4 { loc "t.swift":3:14 parent 3 }
35+
sil_scope 1 { loc "t.swift":1:6 parent @$s1a1gys5Int64VADF : $@convention(thin) (Int64) -> Int64 }
36+
sil_scope 2 { loc "t.swift":1:29 parent 1 }
37+
sil_scope 3 { loc "t.swift":2:3 parent 2 }
38+
sil_scope 4 { loc "t.swift":2:14 parent 3 }
3939

4040
// g(_:)
41-
sil hidden @$s1a1gyS2iF : $@convention(thin) (Int) -> Int {
41+
sil @$s1a1gys5Int64VADF : $@convention(thin) (Int64) -> Int64 {
4242
// %0 "x" // users: %3, %1
43-
bb0(%0 : $Int):
44-
%2 = integer_literal $Builtin.Int64, 0, loc "t.swift":3:11, scope 3 // user: %4
45-
%3 = struct_extract %0 : $Int, #Int._value, loc "t.swift":3:9, scope 3 // user: %4
46-
%4 = builtin "cmp_slt_Int64"(%2 : $Builtin.Int64, %3 : $Builtin.Int64) : $Builtin.Int1, loc "t.swift":3:9, scope 3 // user: %5
47-
cond_br %4, bb1, bb2, loc "t.swift":3:9, scope 3 // id: %5
43+
bb0(%0 : $Int64):
44+
%2 = integer_literal $Builtin.Int64, 0, loc "t.swift":2:11, scope 3 // user: %4
45+
%3 = struct_extract %0 : $Int64, #Int64._value, loc "t.swift":2:9, scope 3 // user: %4
46+
%4 = builtin "cmp_slt_Int64"(%2 : $Builtin.Int64, %3 : $Builtin.Int64) : $Builtin.Int1, loc "t.swift":2:9, scope 3 // user: %5
47+
cond_br %4, bb1, bb2, loc "t.swift":2:9, scope 3 // id: %5
4848

4949
bb1: // Preds: bb0
50-
%6 = integer_literal $Builtin.Int64, 1, loc "t.swift":4:12, scope 4 // user: %7
51-
%7 = struct $Int (%6 : $Builtin.Int64), loc "t.swift":4:12, scope 4 // user: %8
52-
br bb3(%7 : $Int), loc "t.swift":4:5, scope 4 // id: %8
50+
%6 = integer_literal $Builtin.Int64, 1, loc "t.swift":3:12, scope 4 // user: %7
51+
%7 = struct $Int64 (%6 : $Builtin.Int64), loc "t.swift":3:12, scope 4 // user: %8
52+
br bb3(%7 : $Int64), loc "t.swift":3:5, scope 4 // id: %8
5353

5454
bb2: // Preds: bb0
55-
%9 = integer_literal $Builtin.Int64, 0, loc "t.swift":6:10, scope 2 // user: %10
56-
%10 = struct $Int (%9 : $Builtin.Int64), loc "t.swift":6:10, scope 2 // user: %11
57-
br bb3(%10 : $Int), loc "t.swift":6:3, scope 2 // id: %11
55+
%9 = integer_literal $Builtin.Int64, 0, loc "t.swift":5:10, scope 2 // user: %10
56+
%10 = struct $Int64 (%9 : $Builtin.Int64), loc "t.swift":5:10, scope 2 // user: %11
57+
br bb3(%10 : $Int64), loc "t.swift":5:3, scope 2 // id: %11
5858

5959
// %12 // user: %13
60-
bb3(%12 : $Int): // Preds: bb2 bb1
61-
return %12 : $Int, loc "t.swift":7:1, scope 2 // id: %13
62-
} // end sil function '$s1a1gyS2iF'
60+
bb3(%12 : $Int64): // Preds: bb2 bb1
61+
return %12 : $Int64, loc "t.swift":6:1, scope 2 // id: %13
62+
} // end sil function '$s1a1gys5Int64VADF'
6363

64-
sil_scope 7 { loc "t.swift":9:13 parent @$s1a1fyS2iF : $@convention(thin) (Int) -> Int }
65-
sil_scope 8 { loc "t.swift":9:32 parent 7 }
64+
sil_scope 7 { loc "t.swift":8:13 parent @$s1a1fys5Int64VADF : $@convention(thin) (Int64) -> Int64 }
65+
sil_scope 8 { loc "t.swift":8:36 parent 7 }
6666

6767
// f(_:)
68-
sil @$s1a1fyS2iF : $@convention(thin) (Int) -> Int {
68+
sil @$s1a1fys5Int64VADF : $@convention(thin) (Int64) -> Int64 {
6969
// %0 "x" // users: %3, %1
70-
bb0(%0 : $Int):
70+
bb0(%0 : $Int64):
7171
// function_ref g(_:)
72-
%2 = function_ref @$s1a1gyS2iF : $@convention(thin) (Int) -> Int, loc "t.swift":9:41, scope 8 // user: %3
73-
%3 = apply %2(%0) : $@convention(thin) (Int) -> Int, loc "t.swift":9:41, scope 8 // user: %4
74-
return %3 : $Int, loc "t.swift":9:34, scope 8 // id: %4
75-
} // end sil function '$s1a1fyS2iF'
72+
%2 = function_ref @$s1a1gys5Int64VADF : $@convention(thin) (Int64) -> Int64, loc "t.swift":8:45, scope 8 // user: %3
73+
%3 = apply %2(%0) : $@convention(thin) (Int64) -> Int64, loc "t.swift":8:45, scope 8 // user: %4
74+
return %3 : $Int64, loc "t.swift":8:38, scope 8 // id: %4
75+
} // end sil function '$s1a1fys5Int64VADF'

0 commit comments

Comments
 (0)