Skip to content

Commit ed5fa16

Browse files
committed
Unified: Update .expected
1 parent 870240f commit ed5fa16

3 files changed

Lines changed: 30 additions & 30 deletions

File tree

unified/ql/test/library-tests/controlflow/basicblock-slices.expected

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
| 21 | cfg.swift:21:11:21:17 | MyError | 'MyError -^ ... .error1 -^ ThrowExpr' |
2020
| 23 | cfg.swift:23:3:25:3 | GuardIfStmt | 'GuardIfStmt -V x -> 0 -^ ... <= ...' |
2121
| 23 | cfg.swift:23:21:25:3 | Block | 'Block' |
22-
| 24 | cfg.swift:24:11:24:17 | MyError | 'MyError -^ ... .error3 -> Argument -V x -> 1 -^ ... + ... -^ error3(...) -^ ThrowExpr' |
22+
| 24 | cfg.swift:24:11:24:17 | MyError | 'MyError -^ ... .error3 -> Argument -V x -> 1 -^ ... + ... -^ ... .error3(...) -^ ThrowExpr' |
2323
| 28 | cfg.swift:28:1:45:1 | FunctionDeclaration | 'FunctionDeclaration' |
2424
| 28 | cfg.swift:28:15:28:15 | x | 'x -^ Block' |
2525
| 29 | cfg.swift:29:3:43:3 | TryExpr | 'TryExpr -V Block' |
@@ -31,7 +31,7 @@
3131
| 35 | cfg.swift:35:5:37:3 | CatchClause | 'CatchClause -V MyError -^ ... .error1 -> isZero -> Argument -V x -^ isZero(...) -? MyError -^ ... .error2 -^ ConditionalPattern -^ OrPattern' |
3232
| 35 | cfg.swift:35:62:37:3 | Block | 'Block' |
3333
| 36 | cfg.swift:36:12:36:12 | 0 | '0 -^ ReturnExpr' |
34-
| 37 | cfg.swift:37:5:39:3 | CatchClause | 'CatchClause -V MyError -^ ... .error3 -> Argument -V withParam -^ ExprPattern -^ error3(...)' |
34+
| 37 | cfg.swift:37:5:39:3 | CatchClause | 'CatchClause -V MyError -^ ... .error3 -> Argument -V withParam -^ ExprPattern -^ ... .error3(...)' |
3535
| 37 | cfg.swift:37:41:39:3 | Block | 'Block' |
3636
| 38 | cfg.swift:38:12:38:20 | withParam | 'withParam -^ ReturnExpr' |
3737
| 39 | cfg.swift:39:5:41:3 | CatchClause | 'CatchClause -V ' |
@@ -97,24 +97,24 @@
9797
| 112 | cfg.swift:112:3:112:18 | VariableDeclaration | 'VariableDeclaration -V c -> C -> Argument -V 42 -^ C(...)' |
9898
| 113 | cfg.swift:113:3:113:18 | VariableDeclaration | 'VariableDeclaration -V n1 -> c -^ ... .myInt' |
9999
| 114 | cfg.swift:114:3:114:23 | VariableDeclaration | 'VariableDeclaration -V n2 -> c -^ ... .self -^ ... .myInt' |
100-
| 115 | cfg.swift:115:3:115:23 | VariableDeclaration | 'VariableDeclaration -V n3 -> c -^ ... .getMyInt -^ getMyInt(...)' |
101-
| 116 | cfg.swift:116:3:116:28 | VariableDeclaration | 'VariableDeclaration -V n4 -> c -^ ... .self -^ ... .getMyInt -^ getMyInt(...)' |
100+
| 115 | cfg.swift:115:3:115:23 | VariableDeclaration | 'VariableDeclaration -V n3 -> c -^ ... .getMyInt -^ ... .getMyInt(...)' |
101+
| 116 | cfg.swift:116:3:116:28 | VariableDeclaration | 'VariableDeclaration -V n4 -> c -^ ... .self -^ ... .getMyInt -^ ... .getMyInt(...)' |
102102
| 117 | cfg.swift:117:3:117:22 | VariableDeclaration | 'VariableDeclaration -V n5 -> param -^ ... .myInt' |
103103
| 118 | cfg.swift:118:3:118:27 | VariableDeclaration | 'VariableDeclaration -V n6 -> param -^ ... .self -^ ... .myInt' |
104-
| 120 | cfg.swift:120:3:120:32 | VariableDeclaration | 'VariableDeclaration -V n8 -> param -^ ... .self -^ ... .getMyInt -^ getMyInt(...)' |
104+
| 120 | cfg.swift:120:3:120:32 | VariableDeclaration | 'VariableDeclaration -V n8 -> param -^ ... .self -^ ... .getMyInt -^ ... .getMyInt(...)' |
105105
| 122 | cfg.swift:122:3:122:27 | VariableDeclaration | 'VariableDeclaration -V n9 -> inoutParam -^ ... .myInt' |
106-
| 123 | cfg.swift:123:3:123:27 | VariableDeclaration | 'VariableDeclaration -V n7 -> param -^ ... .getMyInt -^ getMyInt(...)' |
106+
| 123 | cfg.swift:123:3:123:27 | VariableDeclaration | 'VariableDeclaration -V n7 -> param -^ ... .getMyInt -^ ... .getMyInt(...)' |
107107
| 124 | cfg.swift:124:3:124:33 | VariableDeclaration | 'VariableDeclaration -V n10 -> inoutParam -^ ... .self -^ ... .myInt' |
108-
| 125 | cfg.swift:125:3:125:33 | VariableDeclaration | 'VariableDeclaration -V n11 -> inoutParam -^ ... .getMyInt -^ getMyInt(...)' |
109-
| 126 | cfg.swift:126:3:126:38 | VariableDeclaration | 'VariableDeclaration -V n12 -> inoutParam -^ ... .self -^ ... .getMyInt -^ getMyInt(...)' |
108+
| 125 | cfg.swift:125:3:125:33 | VariableDeclaration | 'VariableDeclaration -V n11 -> inoutParam -^ ... .getMyInt -^ ... .getMyInt(...)' |
109+
| 126 | cfg.swift:126:3:126:38 | VariableDeclaration | 'VariableDeclaration -V n12 -> inoutParam -^ ... .self -^ ... .getMyInt -^ ... .getMyInt(...)' |
110110
| 128 | cfg.swift:128:3:128:22 | VariableDeclaration | 'VariableDeclaration -V n13 -> opt -^ ... ! -^ ... .myInt' |
111111
| 129 | cfg.swift:129:3:129:27 | VariableDeclaration | 'VariableDeclaration -V n14 -> opt -^ ... ! -^ ... .self -^ ... .myInt' |
112-
| 130 | cfg.swift:130:3:130:27 | VariableDeclaration | 'VariableDeclaration -V n15 -> opt -^ ... ! -^ ... .getMyInt -^ getMyInt(...)' |
113-
| 131 | cfg.swift:131:3:131:32 | VariableDeclaration | 'VariableDeclaration -V n16 -> opt -^ ... ! -^ ... .self -^ ... .getMyInt -^ getMyInt(...)' |
112+
| 130 | cfg.swift:130:3:130:27 | VariableDeclaration | 'VariableDeclaration -V n15 -> opt -^ ... ! -^ ... .getMyInt -^ ... .getMyInt(...)' |
113+
| 131 | cfg.swift:131:3:131:32 | VariableDeclaration | 'VariableDeclaration -V n16 -> opt -^ ... ! -^ ... .self -^ ... .getMyInt -^ ... .getMyInt(...)' |
114114
| 133 | cfg.swift:133:3:133:22 | VariableDeclaration | 'VariableDeclaration -V n17 -> opt -^ ... .myInt' |
115115
| 134 | cfg.swift:134:3:134:27 | VariableDeclaration | 'VariableDeclaration -V n18 -> opt -^ ... .self -^ ... .myInt' |
116-
| 135 | cfg.swift:135:3:135:27 | VariableDeclaration | 'VariableDeclaration -V n19 -> opt -^ ... .getMyInt -^ getMyInt(...)' |
117-
| 136 | cfg.swift:136:3:136:32 | VariableDeclaration | 'VariableDeclaration -V n20 -> opt -^ ... .self -^ ... .getMyInt -^ getMyInt(...)' |
116+
| 135 | cfg.swift:135:3:135:27 | VariableDeclaration | 'VariableDeclaration -V n19 -> opt -^ ... .getMyInt -^ ... .getMyInt(...)' |
117+
| 136 | cfg.swift:136:3:136:32 | VariableDeclaration | 'VariableDeclaration -V n20 -> opt -^ ... .self -^ ... .getMyInt -^ ... .getMyInt(...)' |
118118
| 139 | cfg.swift:139:1:166:1 | FunctionDeclaration | 'FunctionDeclaration' |
119119
| 139 | cfg.swift:139:15:139:15 | x | 'x -^ Block' |
120120
| 140 | cfg.swift:140:3:141:12 | ForEachStmt | 'ForEachStmt -V 0 -> 10 -^ ... ... ...' |
@@ -311,7 +311,7 @@
311311
| 372 | cfg.swift:372:12:372:12 | c | 'c -^ ReturnExpr' |
312312
| 376 | cfg.swift:376:1:378:1 | FunctionDeclaration | 'FunctionDeclaration' |
313313
| 376 | cfg.swift:376:19:376:19 | c | 'c -^ Block' |
314-
| 377 | cfg.swift:377:10:377:10 | c | 'c -^ ... .getOptional -^ getOptional(...) -^ ... .getMyInt -^ getMyInt(...) -^ ReturnExpr' |
314+
| 377 | cfg.swift:377:10:377:10 | c | 'c -^ ... .getOptional -^ ... .getOptional(...) -^ ... .getMyInt -^ ... .getMyInt(...) -^ ReturnExpr' |
315315
| 380 | cfg.swift:380:1:384:1 | FunctionDeclaration | 'FunctionDeclaration' |
316316
| 380 | cfg.swift:380:18:380:18 | x | 'x -> y -^ Block' |
317317
| 381 | cfg.swift:381:10:383:3 | Block | 'Block' |
@@ -323,7 +323,7 @@
323323
| 390 | cfg.swift:390:1:394:1 | ClassLikeDeclaration | 'ClassLikeDeclaration -V Derived -^ BaseType -V C' |
324324
| 391 | cfg.swift:391:3:393:3 | Block | 'Block' |
325325
| 391 | cfg.swift:391:3:393:3 | ConstructorDeclaration | 'ConstructorDeclaration' |
326-
| 392 | cfg.swift:392:5:392:9 | | ' -^ ... .init -> Argument -V 0 -^ init(...)' |
326+
| 392 | cfg.swift:392:5:392:9 | | ' -^ ... .init -> Argument -V 0 -^ ... .init(...)' |
327327
| 396 | cfg.swift:396:1:404:1 | FunctionDeclaration | 'FunctionDeclaration' |
328328
| 396 | cfg.swift:396:21:396:21 | x | 'x -^ Block' |
329329
| 397 | cfg.swift:397:3:402:3 | TryExpr | 'TryExpr -V Block' |
@@ -407,15 +407,15 @@
407407
| 521 | cfg.swift:521:10:521:10 | x | 'x -^ ReturnExpr' |
408408
| 524 | cfg.swift:524:1:538:1 | Block | 'Block' |
409409
| 524 | cfg.swift:524:1:538:1 | FunctionDeclaration | 'FunctionDeclaration' |
410-
| 525 | cfg.swift:525:5:533:6 | VariableDeclaration | 'VariableDeclaration -V stream -> AsyncStream -> Argument -V Int -^ ... .self -> Argument -V . -^ ... .bufferingNewest -> Argument -V 5 -^ bufferingNewest(...) -> Argument -V FunctionExpr -^ AsyncStream(...)' |
410+
| 525 | cfg.swift:525:5:533:6 | VariableDeclaration | 'VariableDeclaration -V stream -> AsyncStream -> Argument -V Int -^ ... .self -> Argument -V . -^ ... .bufferingNewest -> Argument -V 5 -^ ... .bufferingNewest(...) -> Argument -V FunctionExpr -^ AsyncStream(...)' |
411411
| 525 | cfg.swift:525:78:533:5 | Block | 'Block' |
412412
| 526 | cfg.swift:526:9:526:20 | continuation | 'continuation' |
413-
| 527 | cfg.swift:527:13:527:16 | Task | 'Task -^ ... .detached -^ Argument -V FunctionExpr -^ detached(...)' |
413+
| 527 | cfg.swift:527:13:527:16 | Task | 'Task -^ ... .detached -^ Argument -V FunctionExpr -^ ... .detached(...)' |
414414
| 527 | cfg.swift:527:27:532:13 | Block | 'Block' |
415415
| 528 | cfg.swift:528:17:530:17 | ForEachStmt | 'ForEachStmt -V 1 -> 100 -^ ... ... ...' |
416416
| 528 | cfg.swift:528:21:528:21 | i | 'i -> Block' |
417-
| 529 | cfg.swift:529:21:529:32 | continuation | 'continuation -^ ... .yield -> Argument -V i -^ yield(...)' |
418-
| 531 | cfg.swift:531:17:531:28 | continuation | 'continuation -^ ... .finish -^ finish(...)' |
417+
| 529 | cfg.swift:529:21:529:32 | continuation | 'continuation -^ ... .yield -> Argument -V i -^ ... .yield(...)' |
418+
| 531 | cfg.swift:531:17:531:28 | continuation | 'continuation -^ ... .finish -^ ... .finish(...)' |
419419
| 535 | cfg.swift:535:5:537:5 | ForEachStmt | 'ForEachStmt -V stream' |
420420
| 535 | cfg.swift:535:19:535:19 | i | 'i -> Block' |
421421
| 536 | cfg.swift:536:9:536:13 | print | 'print -> Argument -V i -^ print(...)' |
@@ -452,10 +452,10 @@
452452
| 576 | cfg.swift:576:11:576:13 | arg | 'arg -^ Block' |
453453
| 578 | cfg.swift:578:1:583:1 | FunctionDeclaration | 'FunctionDeclaration' |
454454
| 578 | cfg.swift:578:30:578:30 | x | 'x -> y -^ Block' |
455-
| 579 | cfg.swift:579:2:579:5 | sink | 'sink -> Argument -V x -^ ... .source -^ source(...) -^ sink(...)' |
456-
| 580 | cfg.swift:580:2:580:5 | sink | 'sink -> Argument -V y -^ ... .source -^ source(...) -^ sink(...)' |
457-
| 581 | cfg.swift:581:2:581:5 | sink | 'sink -> Argument -V getMyProtocol -^ getMyProtocol(...) -^ ... .source -^ source(...) -^ sink(...)' |
458-
| 582 | cfg.swift:582:2:582:5 | sink | 'sink -> Argument -V getMyProtocolImpl -^ getMyProtocolImpl(...) -^ ... .source -^ source(...) -^ sink(...)' |
455+
| 579 | cfg.swift:579:2:579:5 | sink | 'sink -> Argument -V x -^ ... .source -^ ... .source(...) -^ sink(...)' |
456+
| 580 | cfg.swift:580:2:580:5 | sink | 'sink -> Argument -V y -^ ... .source -^ ... .source(...) -^ sink(...)' |
457+
| 581 | cfg.swift:581:2:581:5 | sink | 'sink -> Argument -V getMyProtocol -^ getMyProtocol(...) -^ ... .source -^ ... .source(...) -^ sink(...)' |
458+
| 582 | cfg.swift:582:2:582:5 | sink | 'sink -> Argument -V getMyProtocolImpl -^ getMyProtocolImpl(...) -^ ... .source -^ ... .source(...) -^ sink(...)' |
459459
| 585 | cfg.swift:585:1:593:1 | FunctionDeclaration | 'FunctionDeclaration' |
460460
| 585 | cfg.swift:585:23:585:23 | x | 'x -^ Block' |
461461
| 586 | cfg.swift:586:3:589:3 | VariableDeclaration | 'VariableDeclaration -V a -> SwitchExpr -V x' |

unified/ql/test/library-tests/controlflow/cfg.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ bbStep
1212
| cfg.swift:33:5:33:33 | print(...) | 'print(...) : successor -> 0(+11)' |
1313
| cfg.swift:35:5:35:5 | OrPattern | 'OrPattern : match -> Block(+0)' |
1414
| cfg.swift:35:5:35:5 | OrPattern | 'OrPattern : no-match -> CatchClause(+2)' |
15-
| cfg.swift:37:11:37:39 | error3(...) | 'error3(...) : match -> Block(+0)' |
16-
| cfg.swift:37:11:37:39 | error3(...) | 'error3(...) : no-match -> CatchClause(+2)' |
15+
| cfg.swift:37:11:37:39 | ... .error3(...) | '... .error3(...) : match -> Block(+0)' |
16+
| cfg.swift:37:11:37:39 | ... .error3(...) | '... .error3(...) : no-match -> CatchClause(+2)' |
1717
| cfg.swift:39:11:39:20 | | ' : match -> Block(+0)' |
1818
| cfg.swift:39:11:39:20 | | ' : no-match -> CatchClause(+2)' |
1919
| cfg.swift:40:5:40:20 | print(...) | 'print(...) : successor -> 0(+4)' |
@@ -114,8 +114,8 @@ bbStep
114114
| cfg.swift:518:5:518:10 | ... += ... | '... += ... : successor -> x(+3)' |
115115
| cfg.swift:528:26:528:32 | ... ... ... | '... ... ... : empty -> continuation(+3)' |
116116
| cfg.swift:528:26:528:32 | ... ... ... | '... ... ... : non-empty -> i(+0)' |
117-
| cfg.swift:529:21:529:41 | yield(...) | 'yield(...) : successor -> continuation(+2)' |
118-
| cfg.swift:529:21:529:41 | yield(...) | 'yield(...) : successor -> i(-1)' |
117+
| cfg.swift:529:21:529:41 | ... .yield(...) | '... .yield(...) : successor -> continuation(+2)' |
118+
| cfg.swift:529:21:529:41 | ... .yield(...) | '... .yield(...) : successor -> i(-1)' |
119119
| cfg.swift:535:24:535:29 | stream | 'stream : non-empty -> i(+0)' |
120120
| cfg.swift:536:9:536:16 | print(...) | 'print(...) : successor -> i(-1)' |
121121
| cfg.swift:542:5:542:5 | x | 'x : non-null -> ReturnExpr(-1)' |
@@ -162,5 +162,5 @@ nonSimple
162162
| cfg.swift:10:1:10:1 | ClassLikeDeclaration | 'ClassLikeDeclaration -V MyError -^ BaseType -V Error' |
163163
| cfg.swift:35:5:35:5 | CatchClause | 'CatchClause -V MyError -^ ... .error1 -> isZero -> Argument -V x -^ isZero(...) -? MyError -^ ... .error2 -^ ConditionalPattern -^ OrPattern' |
164164
| cfg.swift:390:1:390:1 | ClassLikeDeclaration | 'ClassLikeDeclaration -V Derived -^ BaseType -V C' |
165-
| cfg.swift:527:13:527:16 | Task | 'Task -^ ... .detached -^ Argument -V FunctionExpr -^ detached(...)' |
165+
| cfg.swift:527:13:527:16 | Task | 'Task -^ ... .detached -^ Argument -V FunctionExpr -^ ... .detached(...)' |
166166
| cfg.swift:569:1:569:1 | ClassLikeDeclaration | 'ClassLikeDeclaration -V MyProcotolImpl -^ BaseType -V MyProtocol' |

unified/ql/test/library-tests/controlflow/cfg.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func tryCatch(x : Int) -> Int {
3434

3535
} catch MyError.error1 , MyError.error2 where isZero(x: x) { // $ bbStep='OrPattern : match -> Block(+0)' bbStep='OrPattern : no-match -> CatchClause(+2)' nonSimple='CatchClause -V MyError -^ ... .error1 -> isZero -> Argument -V x -^ isZero(...) -? MyError -^ ... .error2 -^ ConditionalPattern -^ OrPattern'
3636
return 0
37-
} catch MyError.error3(let withParam) { // $ bbStep='error3(...) : match -> Block(+0)' bbStep='error3(...) : no-match -> CatchClause(+2)'
37+
} catch MyError.error3(let withParam) { // $ bbStep='... .error3(...) : match -> Block(+0)' bbStep='... .error3(...) : no-match -> CatchClause(+2)'
3838
return withParam
3939
} catch is MyError { // $ bbStep=' : match -> Block(+0)' bbStep=' : no-match -> CatchClause(+2)'
4040
print("MyError") // $ bbStep='print(...) : successor -> 0(+4)'
@@ -524,9 +524,9 @@ func testAvailable() -> Int { // $ noCfg
524524
func testAsyncFor () async { // $ noCfg
525525
var stream = AsyncStream(Int.self, bufferingPolicy: .bufferingNewest(5), { // $ bbContinues='Block goto Task(+2)'
526526
continuation in // $ bbContinues='continuation goto Block(-1)'
527-
Task.detached { // $ nonSimple='Task -^ ... .detached -^ Argument -V FunctionExpr -^ detached(...)'
527+
Task.detached { // $ nonSimple='Task -^ ... .detached -^ Argument -V FunctionExpr -^ ... .detached(...)'
528528
for i in 1...100 { // $ bbStep='... ... ... : empty -> continuation(+3)' bbStep='... ... ... : non-empty -> i(+0)'
529-
continuation.yield(i) // $ bbStep='yield(...) : successor -> continuation(+2)' bbStep='yield(...) : successor -> i(-1)'
529+
continuation.yield(i) // $ bbStep='... .yield(...) : successor -> continuation(+2)' bbStep='... .yield(...) : successor -> i(-1)'
530530
}
531531
continuation.finish()
532532
}

0 commit comments

Comments
 (0)