Skip to content

Commit 400f87b

Browse files
author
Amritpan Kaur
committed
[Tests] Update tests to reflect new output.
1 parent e5c5fc9 commit 400f87b

File tree

4 files changed

+51
-7
lines changed

4 files changed

+51
-7
lines changed

test/Concurrency/async_overload_filtering.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ var a: String? = nil
1818

1919
// CHECK: attempting disjunction choice $T0 bound to decl async_overload_filtering.(file).filter_async(fn2:)
2020
// CHECK-NEXT: overload set choice binding $T0 := {{.*}}
21+
// CHECK-NEXT: (considering -> ({{.*}}) -> {{.*}} applicable fn {{.*}}
2122
// CHECK-NEXT: increasing 'sync-in-asynchronous' score by 1
23+
// CHECK-NEXT: (added constraint: {{.*}} arg conv () async -> {{.*}}
24+
// CHECK-NEXT: (removed constraint: ({{.*}}) -> {{.*}} applicable fn {{.*}}
25+
// CHECK-NEXT: (outcome: simplified)
26+
// CHECK-NEXT: )
2227
// CHECK-NEXT: solution is worse than the best solution
2328
filter_async {
2429
Obj()

test/Constraints/common_type.swift

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,27 @@ func f(_: Double) -> Y { return Y() }
2828

2929
func testCallCommonType() {
3030
// CHECK: overload set choice binding $T{{[0-9]+}} := (Int) -> X
31-
// CHECK-NEXT: (common result type for $T{{[0-9]+}} is Int)
31+
// CHECK-NEXT: (considering -> (_const $T2) -> $T3 applicable fn $T1
32+
// CHECK-NEXT: (added constraint: $T2 arg conv Int
33+
// CHECK-NEXT: (removed constraint: (_const $T2) -> $T3 applicable fn $T1
34+
// CHECK-NEXT: (outcome: simplified)
35+
// CHECK-NEXT: )
36+
// CHECK-NEXT: (considering -> $T3[.g: value] == $T4
37+
// CHECK-NEXT: (added constraint: disjunction
38+
// CHECK-NEXT: > $T4 bound to decl common_type
39+
// CHECK-NEXT: > $T4 bound to decl common_type
40+
// CHECK-NEXT: (common result type for $T4 is Int)
3241
// CHECK: (overload set choice binding $T{{[0-9]+}} := (Double) -> Y)
33-
// CHECK-NEXT: (common result type for $T{{[0-9]+}} is Double)
42+
// CHECK-NEXT: (considering -> (_const $T2) -> $T3 applicable fn $T1
43+
// CHECK-NEXT: (added constraint: $T2 arg conv Double
44+
// CHECK-NEXT: (removed constraint: (_const $T2) -> $T3 applicable fn $T1
45+
// CHECK-NEXT: (outcome: simplified)
46+
// CHECK-NEXT: )
47+
// CHECK-NEXT: (considering -> $T3[.g: value] == $T4
48+
// CHECK-NEXT: (added constraint: disjunction
49+
// CHECK-NEXT: > $T4 bound to decl common_type
50+
// CHECK-NEXT: > $T4 bound to decl common_type
51+
// CHECK-NEXT: (common result type for $T4 is Double)
3452
_ = f(0).g(0)
3553
}
3654

test/Constraints/one_way_solve.swift

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,23 @@ func testTernaryOneWayOverload(b: Bool) {
3737
// CHECK: (attempting type variable $T11 := Int8
3838

3939
// CHECK: solving component #1
40-
// CHECK: (attempting type variable $T11 := Int8
41-
// CHECK: (found solution: [component: non-default literal(s), value: 2] [component: use of overloaded unapplied function(s), value: 2])
42-
43-
// CHECK: (composed solution: [component: non-default literal(s), value: 2] [component: use of overloaded unapplied function(s), value: 2])
44-
// CHECK-NOT: (composed solution: [component: non-default literal(s), value: 2] [component: use of overloaded unapplied function(s), value: 2])
40+
// CHECK: (attempting type variable $T11 := Int8
41+
// CHECK: (considering -> $T5 conv $T11
42+
// CHECK: (removed constraint: $T5 conv $T11
43+
// CHECK: (outcome: simplified)
44+
// CHECK: )
45+
// CHECK: (considering -> $T10 conv $T11
46+
// CHECK: (removed constraint: $T10 conv $T11
47+
// CHECK: (outcome: simplified)
48+
// CHECK: )
49+
// CHECK: (considering -> $T11 conv Int8
50+
// CHECK: > $T10 conv $T11
51+
// CHECK: > $T11 conv Int8
52+
// CHECK: )
53+
// CHECK: )
54+
// CHECK: found solution: [non-default literal(s) = 2] [use of overloaded unapplied function(s) = 2]
55+
56+
// CHECK: composed solution: [non-default literal(s) = 2] [use of overloaded unapplied function(s) = 2]
57+
// CHECK-NOT: composed solution: [non-default literal(s) = 2] [use of overloaded unapplied function(s) = 2]
4558
let _: Int8 = b ? Builtin.one_way(int8Or16(17)) : Builtin.one_way(int8Or16(42))
4659
}

test/Constraints/overload_filtering.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ func testSubscript(x: X, i: Int) {
3535
func testUnresolvedMember(i: Int) -> X {
3636
// CHECK: disabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.init(_:)
3737
// CHECK-NEXT: disabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.init(_:_:_:)
38+
// CHECK-NEXT: (removed constraint: disjunction
39+
// CHECK-NEXT: > $T1 bound to decl overload_filtering
40+
// CHECK-NEXT: > [disabled] $T1 bound to decl overload_filtering
41+
// CHECK-NEXT: > [disabled] $T1 bound to decl overload_filtering
3842
// CHECK-NEXT: introducing single enabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.init(_:_:)
3943
return .init(i, i)
4044
}
@@ -56,6 +60,10 @@ func test_member_filtering() {
5660
func test(s: S) {
5761
// CHECK: disabled disjunction term {{.*}} bound to decl overload_filtering.(file).test_member_filtering().S.bar(v:)
5862
// CHECK-NEXT: disabled disjunction term {{.*}} bound to decl overload_filtering.(file).test_member_filtering().S.bar(a:b:)
63+
// CHECK-NEXT: (removed constraint: disjunction
64+
// CHECK-NEXT: > $T4 bound to decl overload_filtering
65+
// CHECK-NEXT: > [disabled] $T4 bound to decl overload_filtering
66+
// CHECK-NEXT: > [disabled] $T4 bound to decl overload_filtering
5967
// CHECK-NEXT: introducing single enabled disjunction term {{.*}} bound to decl overload_filtering.(file).test_member_filtering().S.bar
6068
s.foo(42).bar(42)
6169
}

0 commit comments

Comments
 (0)