Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 52bc25b

Browse files
committed
C++: Accept output
1 parent bb30275 commit 52bc25b

7 files changed

Lines changed: 49 additions & 11 deletions

File tree

cpp/ql/test/library-tests/ir/ssa/aliased_ssa_ir.expected

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ssa.cpp:
2929
# 15| r15_6(int) = Add : r15_4, r15_5
3030
# 15| m15_7(int) = Store : &:r15_3, r15_6
3131
# 15| m15_8(unknown) = Chi : total:m13_9, partial:m15_7
32+
# 15| r15_9(int) = CopyValue : r15_4
3233
#-----| Goto -> Block 3
3334

3435
# 18| Block 2
@@ -40,6 +41,7 @@ ssa.cpp:
4041
# 18| r18_6(int) = Add : r18_4, r18_5
4142
# 18| m18_7(int) = Store : &:r18_3, r18_6
4243
# 18| m18_8(unknown) = Chi : total:m13_9, partial:m18_7
44+
# 18| r18_9(int) = CopyValue : r18_4
4345
#-----| Goto -> Block 3
4446

4547
# 21| Block 3
@@ -61,6 +63,7 @@ ssa.cpp:
6163
# 22| r22_6(int) = Add : r22_4, r22_5
6264
# 22| m22_7(int) = Store : &:r22_3, r22_6
6365
# 22| m22_8(unknown) = Chi : total:m21_3, partial:m22_7
66+
# 22| r22_9(int) = CopyValue : r22_4
6467
#-----| Goto -> Block 6
6568

6669
# 25| Block 5
@@ -72,6 +75,7 @@ ssa.cpp:
7275
# 25| r25_6(int) = Add : r25_4, r25_5
7376
# 25| m25_7(int) = Store : &:r25_3, r25_6
7477
# 25| m25_8(unknown) = Chi : total:m21_3, partial:m25_7
78+
# 25| r25_9(int) = CopyValue : r25_4
7579
#-----| Goto -> Block 6
7680

7781
# 28| Block 6
@@ -193,6 +197,7 @@ ssa.cpp:
193197
# 62| r62_3(int) = Constant[1] :
194198
# 62| r62_4(int) = Add : r62_2, r62_3
195199
# 62| m62_5(int) = Store : &:r62_1, r62_4
200+
# 62| r62_6(int) = CopyValue : r62_2
196201
# 63| r63_1(bool) = Constant[0] :
197202
# 63| v63_2(void) = ConditionalBranch : r63_1
198203
#-----| False -> Block 1

cpp/ql/test/library-tests/ir/ssa/aliased_ssa_ir_unsound.expected

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ssa.cpp:
2929
# 15| r15_6(int) = Add : r15_4, r15_5
3030
# 15| m15_7(int) = Store : &:r15_3, r15_6
3131
# 15| m15_8(unknown) = Chi : total:m13_9, partial:m15_7
32+
# 15| r15_9(int) = CopyValue : r15_4
3233
#-----| Goto -> Block 3
3334

3435
# 18| Block 2
@@ -40,6 +41,7 @@ ssa.cpp:
4041
# 18| r18_6(int) = Add : r18_4, r18_5
4142
# 18| m18_7(int) = Store : &:r18_3, r18_6
4243
# 18| m18_8(unknown) = Chi : total:m13_9, partial:m18_7
44+
# 18| r18_9(int) = CopyValue : r18_4
4345
#-----| Goto -> Block 3
4446

4547
# 21| Block 3
@@ -61,6 +63,7 @@ ssa.cpp:
6163
# 22| r22_6(int) = Add : r22_4, r22_5
6264
# 22| m22_7(int) = Store : &:r22_3, r22_6
6365
# 22| m22_8(unknown) = Chi : total:m21_3, partial:m22_7
66+
# 22| r22_9(int) = CopyValue : r22_4
6467
#-----| Goto -> Block 6
6568

6669
# 25| Block 5
@@ -72,6 +75,7 @@ ssa.cpp:
7275
# 25| r25_6(int) = Add : r25_4, r25_5
7376
# 25| m25_7(int) = Store : &:r25_3, r25_6
7477
# 25| m25_8(unknown) = Chi : total:m21_3, partial:m25_7
78+
# 25| r25_9(int) = CopyValue : r25_4
7579
#-----| Goto -> Block 6
7680

7781
# 28| Block 6
@@ -193,6 +197,7 @@ ssa.cpp:
193197
# 62| r62_3(int) = Constant[1] :
194198
# 62| r62_4(int) = Add : r62_2, r62_3
195199
# 62| m62_5(int) = Store : &:r62_1, r62_4
200+
# 62| r62_6(int) = CopyValue : r62_2
196201
# 63| r63_1(bool) = Constant[0] :
197202
# 63| v63_2(void) = ConditionalBranch : r63_1
198203
#-----| False -> Block 1

cpp/ql/test/library-tests/ir/ssa/unaliased_ssa_ir.expected

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ ssa.cpp:
2727
# 15| r15_5(int) = Constant[1] :
2828
# 15| r15_6(int) = Add : r15_4, r15_5
2929
# 15| mu15_7(int) = Store : &:r15_3, r15_6
30+
# 15| r15_8(int) = CopyValue : r15_4
3031
#-----| Goto -> Block 3
3132

3233
# 18| Block 2
@@ -37,6 +38,7 @@ ssa.cpp:
3738
# 18| r18_5(int) = Constant[1] :
3839
# 18| r18_6(int) = Add : r18_4, r18_5
3940
# 18| mu18_7(int) = Store : &:r18_3, r18_6
41+
# 18| r18_8(int) = CopyValue : r18_4
4042
#-----| Goto -> Block 3
4143

4244
# 21| Block 3
@@ -54,6 +56,7 @@ ssa.cpp:
5456
# 22| r22_5(int) = Constant[1] :
5557
# 22| r22_6(int) = Add : r22_4, r22_5
5658
# 22| mu22_7(int) = Store : &:r22_3, r22_6
59+
# 22| r22_8(int) = CopyValue : r22_4
5760
#-----| Goto -> Block 6
5861

5962
# 25| Block 5
@@ -64,6 +67,7 @@ ssa.cpp:
6467
# 25| r25_5(int) = Constant[1] :
6568
# 25| r25_6(int) = Add : r25_4, r25_5
6669
# 25| mu25_7(int) = Store : &:r25_3, r25_6
70+
# 25| r25_8(int) = CopyValue : r25_4
6771
#-----| Goto -> Block 6
6872

6973
# 28| Block 6
@@ -188,6 +192,7 @@ ssa.cpp:
188192
# 62| r62_3(int) = Constant[1] :
189193
# 62| r62_4(int) = Add : r62_2, r62_3
190194
# 62| m62_5(int) = Store : &:r62_1, r62_4
195+
# 62| r62_6(int) = CopyValue : r62_2
191196
# 63| r63_1(bool) = Constant[0] :
192197
# 63| v63_2(void) = ConditionalBranch : r63_1
193198
#-----| False -> Block 1

cpp/ql/test/library-tests/ir/ssa/unaliased_ssa_ir_unsound.expected

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ ssa.cpp:
2727
# 15| r15_5(int) = Constant[1] :
2828
# 15| r15_6(int) = Add : r15_4, r15_5
2929
# 15| mu15_7(int) = Store : &:r15_3, r15_6
30+
# 15| r15_8(int) = CopyValue : r15_4
3031
#-----| Goto -> Block 3
3132

3233
# 18| Block 2
@@ -37,6 +38,7 @@ ssa.cpp:
3738
# 18| r18_5(int) = Constant[1] :
3839
# 18| r18_6(int) = Add : r18_4, r18_5
3940
# 18| mu18_7(int) = Store : &:r18_3, r18_6
41+
# 18| r18_8(int) = CopyValue : r18_4
4042
#-----| Goto -> Block 3
4143

4244
# 21| Block 3
@@ -54,6 +56,7 @@ ssa.cpp:
5456
# 22| r22_5(int) = Constant[1] :
5557
# 22| r22_6(int) = Add : r22_4, r22_5
5658
# 22| mu22_7(int) = Store : &:r22_3, r22_6
59+
# 22| r22_8(int) = CopyValue : r22_4
5760
#-----| Goto -> Block 6
5861

5962
# 25| Block 5
@@ -64,6 +67,7 @@ ssa.cpp:
6467
# 25| r25_5(int) = Constant[1] :
6568
# 25| r25_6(int) = Add : r25_4, r25_5
6669
# 25| mu25_7(int) = Store : &:r25_3, r25_6
70+
# 25| r25_8(int) = CopyValue : r25_4
6771
#-----| Goto -> Block 6
6872

6973
# 28| Block 6
@@ -188,6 +192,7 @@ ssa.cpp:
188192
# 62| r62_3(int) = Constant[1] :
189193
# 62| r62_4(int) = Add : r62_2, r62_3
190194
# 62| m62_5(int) = Store : &:r62_1, r62_4
195+
# 62| r62_6(int) = CopyValue : r62_2
191196
# 63| r63_1(bool) = Constant[0] :
192197
# 63| v63_2(void) = ConditionalBranch : r63_1
193198
#-----| False -> Block 1

cpp/ql/test/library-tests/rangeanalysis/signanalysis/SignAnalysis.expected

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
| test.c:24:5:24:9 | Load: count | positive |
5656
| test.c:24:5:24:11 | Add: ... ++ | positive strictlyPositive |
5757
| test.c:24:5:24:11 | Constant: ... ++ | positive strictlyPositive |
58+
| test.c:24:5:24:11 | CopyValue: ... ++ | positive |
5859
| test.c:24:5:24:11 | Store: ... ++ | positive strictlyPositive |
5960
| test.c:25:5:25:22 | Store: ... = ... | positive |
6061
| test.c:25:13:25:17 | Load: count | positive strictlyPositive |
@@ -85,6 +86,7 @@
8586
| test.c:42:22:42:22 | Load: i | positive |
8687
| test.c:42:22:42:24 | Add: ... ++ | positive strictlyPositive |
8788
| test.c:42:22:42:24 | Constant: ... ++ | positive strictlyPositive |
89+
| test.c:42:22:42:24 | CopyValue: ... ++ | positive |
8890
| test.c:42:22:42:24 | Store: ... ++ | positive strictlyPositive |
8991
| test.c:43:5:43:9 | Load: total | positive |
9092
| test.c:43:5:43:14 | Add: ... += ... | positive |
@@ -457,6 +459,7 @@
457459
| test.c:343:5:343:5 | Load: i | positive |
458460
| test.c:343:5:343:7 | Add: ... ++ | positive strictlyPositive |
459461
| test.c:343:5:343:7 | Constant: ... ++ | positive strictlyPositive |
462+
| test.c:343:5:343:7 | CopyValue: ... ++ | positive |
460463
| test.c:343:5:343:7 | Store: ... ++ | positive strictlyPositive |
461464
| test.c:345:3:345:7 | Store: ... = ... | positive strictlyPositive |
462465
| test.c:345:7:345:7 | Load: i | positive strictlyPositive |
@@ -654,6 +657,7 @@
654657
| test.c:398:9:398:9 | Load: y | positive strictlyPositive |
655658
| test.c:398:9:398:11 | Add: ... ++ | positive strictlyPositive |
656659
| test.c:398:9:398:11 | Constant: ... ++ | positive strictlyPositive |
660+
| test.c:398:9:398:11 | CopyValue: ... ++ | positive strictlyPositive |
657661
| test.c:398:9:398:11 | Store: ... ++ | positive strictlyPositive |
658662
| test.c:398:9:398:22 | CopyValue: ... , ... | positive strictlyPositive |
659663
| test.c:398:14:398:14 | Load: y | positive strictlyPositive |

cpp/ql/test/library-tests/valuenumbering/GlobalValueNumbering/diff_ir_expr.expected

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
| test.cpp:56:13:56:16 | (int)... | test.cpp:59:9:59:12 | (int)... | AST only |
5555
| test.cpp:56:13:56:16 | * ... | test.cpp:56:31:56:34 | * ... | AST only |
5656
| test.cpp:56:13:56:16 | * ... | test.cpp:59:9:59:12 | * ... | AST only |
57+
| test.cpp:56:14:56:16 | ptr | test.cpp:56:47:56:51 | ... ++ | IR only |
5758
| test.cpp:56:21:56:24 | (int)... | test.cpp:53:10:53:13 | (int)... | AST only |
5859
| test.cpp:56:21:56:24 | (int)... | test.cpp:56:21:56:24 | (int)... | AST only |
5960
| test.cpp:56:30:56:43 | (...) | test.cpp:56:30:56:43 | (...) | AST only |
@@ -62,25 +63,34 @@
6263
| test.cpp:56:31:56:34 | (int)... | test.cpp:59:9:59:12 | (int)... | AST only |
6364
| test.cpp:56:31:56:34 | * ... | test.cpp:56:13:56:16 | * ... | AST only |
6465
| test.cpp:56:31:56:34 | * ... | test.cpp:59:9:59:12 | * ... | AST only |
66+
| test.cpp:56:32:56:34 | ptr | test.cpp:56:47:56:51 | ... ++ | IR only |
6567
| test.cpp:56:39:56:42 | (int)... | test.cpp:44:9:44:9 | 0 | AST only |
6668
| test.cpp:56:39:56:42 | (int)... | test.cpp:51:25:51:25 | 0 | AST only |
6769
| test.cpp:56:39:56:42 | (int)... | test.cpp:53:18:53:21 | (int)... | AST only |
6870
| test.cpp:56:39:56:42 | (int)... | test.cpp:56:39:56:42 | (int)... | AST only |
6971
| test.cpp:56:39:56:42 | (int)... | test.cpp:59:17:59:20 | (int)... | AST only |
7072
| test.cpp:56:39:56:42 | (int)... | test.cpp:88:12:88:12 | 0 | AST only |
71-
| test.cpp:56:47:56:51 | ... ++ | test.cpp:56:47:56:51 | ... ++ | AST only |
73+
| test.cpp:56:47:56:49 | ptr | test.cpp:56:47:56:51 | ... ++ | IR only |
74+
| test.cpp:56:47:56:51 | ... ++ | test.cpp:56:14:56:16 | ptr | IR only |
75+
| test.cpp:56:47:56:51 | ... ++ | test.cpp:56:32:56:34 | ptr | IR only |
76+
| test.cpp:56:47:56:51 | ... ++ | test.cpp:56:47:56:49 | ptr | IR only |
77+
| test.cpp:56:47:56:51 | ... ++ | test.cpp:59:10:59:12 | ptr | IR only |
7278
| test.cpp:59:9:59:12 | (int)... | test.cpp:56:13:56:16 | (int)... | AST only |
7379
| test.cpp:59:9:59:12 | (int)... | test.cpp:56:31:56:34 | (int)... | AST only |
7480
| test.cpp:59:9:59:12 | (int)... | test.cpp:59:9:59:12 | (int)... | AST only |
7581
| test.cpp:59:9:59:12 | * ... | test.cpp:56:13:56:16 | * ... | AST only |
7682
| test.cpp:59:9:59:12 | * ... | test.cpp:56:31:56:34 | * ... | AST only |
83+
| test.cpp:59:10:59:12 | ptr | test.cpp:56:47:56:51 | ... ++ | IR only |
7784
| test.cpp:59:17:59:20 | (int)... | test.cpp:44:9:44:9 | 0 | AST only |
7885
| test.cpp:59:17:59:20 | (int)... | test.cpp:51:25:51:25 | 0 | AST only |
7986
| test.cpp:59:17:59:20 | (int)... | test.cpp:53:18:53:21 | (int)... | AST only |
8087
| test.cpp:59:17:59:20 | (int)... | test.cpp:56:39:56:42 | (int)... | AST only |
8188
| test.cpp:59:17:59:20 | (int)... | test.cpp:59:17:59:20 | (int)... | AST only |
8289
| test.cpp:59:17:59:20 | (int)... | test.cpp:88:12:88:12 | 0 | AST only |
83-
| test.cpp:62:5:62:12 | ... ++ | test.cpp:62:5:62:12 | ... ++ | AST only |
90+
| test.cpp:62:5:62:10 | result | test.cpp:62:5:62:12 | ... ++ | IR only |
91+
| test.cpp:62:5:62:12 | ... ++ | test.cpp:62:5:62:10 | result | IR only |
92+
| test.cpp:62:5:62:12 | ... ++ | test.cpp:65:10:65:15 | result | IR only |
93+
| test.cpp:65:10:65:15 | result | test.cpp:62:5:62:12 | ... ++ | IR only |
8494
| test.cpp:77:20:77:28 | call to getAValue | test.cpp:79:7:79:7 | v | IR only |
8595
| test.cpp:77:20:77:30 | (signed short)... | test.cpp:77:20:77:30 | (signed short)... | AST only |
8696
| test.cpp:77:20:77:30 | (signed short)... | test.cpp:79:7:79:7 | v | AST only |

cpp/ql/test/library-tests/valuenumbering/GlobalValueNumbering/ir_gvn.expected

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ test.cpp:
404404

405405
# 53| Block 1
406406
# 53| m53_1(unsigned int) = Phi : from 0:m51_3, from 8:m62_5
407-
# 53| valnum = m53_1, m65_4, r62_2, r65_3
407+
# 53| valnum = m53_1, m65_4, r62_2, r62_6, r65_3
408408
# 53| r53_2(glval<char *>) = VariableAddress[str] :
409409
# 53| valnum = r49_6, r53_2, r56_6
410410
# 53| r53_3(char *) = Load : &:r53_2, m49_7
@@ -434,11 +434,11 @@ test.cpp:
434434

435435
# 56| Block 3
436436
# 56| m56_1(decltype(nullptr)) = Phi : from 2:m55_4, from 5:m56_23
437-
# 56| valnum = m56_1, r56_13, r56_20, r56_3, r59_2
437+
# 56| valnum = m56_1, r56_13, r56_20, r56_24, r56_3, r59_2
438438
# 56| r56_2(glval<char *>) = VariableAddress[ptr] :
439439
# 56| valnum = r50_1, r55_3, r56_12, r56_19, r56_2, r59_1
440440
# 56| r56_3(char *) = Load : &:r56_2, m56_1
441-
# 56| valnum = m56_1, r56_13, r56_20, r56_3, r59_2
441+
# 56| valnum = m56_1, r56_13, r56_20, r56_24, r56_3, r59_2
442442
# 56| r56_4(char) = Load : &:r56_3, ~m49_4
443443
# 56| valnum = unique
444444
# 56| r56_5(int) = Convert : r56_4
@@ -461,7 +461,7 @@ test.cpp:
461461
# 56| r56_12(glval<char *>) = VariableAddress[ptr] :
462462
# 56| valnum = r50_1, r55_3, r56_12, r56_19, r56_2, r59_1
463463
# 56| r56_13(char *) = Load : &:r56_12, m56_1
464-
# 56| valnum = m56_1, r56_13, r56_20, r56_3, r59_2
464+
# 56| valnum = m56_1, r56_13, r56_20, r56_24, r56_3, r59_2
465465
# 56| r56_14(char) = Load : &:r56_13, ~m49_4
466466
# 56| valnum = unique
467467
# 56| r56_15(int) = Convert : r56_14
@@ -478,20 +478,22 @@ test.cpp:
478478
# 56| r56_19(glval<char *>) = VariableAddress[ptr] :
479479
# 56| valnum = r50_1, r55_3, r56_12, r56_19, r56_2, r59_1
480480
# 56| r56_20(char *) = Load : &:r56_19, m56_1
481-
# 56| valnum = m56_1, r56_13, r56_20, r56_3, r59_2
481+
# 56| valnum = m56_1, r56_13, r56_20, r56_24, r56_3, r59_2
482482
# 56| r56_21(int) = Constant[1] :
483483
# 56| valnum = unique
484484
# 56| r56_22(char *) = PointerAdd[1] : r56_20, r56_21
485485
# 56| valnum = m56_23, r56_22
486486
# 56| m56_23(char *) = Store : &:r56_19, r56_22
487487
# 56| valnum = m56_23, r56_22
488+
# 56| r56_24(char *) = CopyValue : r56_20
489+
# 56| valnum = m56_1, r56_13, r56_20, r56_24, r56_3, r59_2
488490
#-----| Goto (back edge) -> Block 3
489491

490492
# 59| Block 6
491493
# 59| r59_1(glval<char *>) = VariableAddress[ptr] :
492494
# 59| valnum = r50_1, r55_3, r56_12, r56_19, r56_2, r59_1
493495
# 59| r59_2(char *) = Load : &:r59_1, m56_1
494-
# 59| valnum = m56_1, r56_13, r56_20, r56_3, r59_2
496+
# 59| valnum = m56_1, r56_13, r56_20, r56_24, r56_3, r59_2
495497
# 59| r59_3(char) = Load : &:r59_2, ~m49_4
496498
# 59| valnum = unique
497499
# 59| r59_4(int) = Convert : r59_3
@@ -512,13 +514,15 @@ test.cpp:
512514
# 62| r62_1(glval<unsigned int>) = VariableAddress[result] :
513515
# 62| valnum = r51_1, r62_1, r65_2
514516
# 62| r62_2(unsigned int) = Load : &:r62_1, m53_1
515-
# 62| valnum = m53_1, m65_4, r62_2, r65_3
517+
# 62| valnum = m53_1, m65_4, r62_2, r62_6, r65_3
516518
# 62| r62_3(unsigned int) = Constant[1] :
517519
# 62| valnum = unique
518520
# 62| r62_4(unsigned int) = Add : r62_2, r62_3
519521
# 62| valnum = m62_5, r62_4
520522
# 62| m62_5(unsigned int) = Store : &:r62_1, r62_4
521523
# 62| valnum = m62_5, r62_4
524+
# 62| r62_6(unsigned int) = CopyValue : r62_2
525+
# 62| valnum = m53_1, m65_4, r62_2, r62_6, r65_3
522526
#-----| Goto (back edge) -> Block 1
523527

524528
# 63| Block 9
@@ -528,9 +532,9 @@ test.cpp:
528532
# 65| r65_2(glval<unsigned int>) = VariableAddress[result] :
529533
# 65| valnum = r51_1, r62_1, r65_2
530534
# 65| r65_3(unsigned int) = Load : &:r65_2, m53_1
531-
# 65| valnum = m53_1, m65_4, r62_2, r65_3
535+
# 65| valnum = m53_1, m65_4, r62_2, r62_6, r65_3
532536
# 65| m65_4(unsigned int) = Store : &:r65_1, r65_3
533-
# 65| valnum = m53_1, m65_4, r62_2, r65_3
537+
# 65| valnum = m53_1, m65_4, r62_2, r62_6, r65_3
534538
# 49| v49_14(void) = ReturnIndirection : &:r49_8, m49_9
535539
# 49| v49_15(void) = ReturnIndirection : &:r49_12, m49_13
536540
# 49| r49_16(glval<unsigned int>) = VariableAddress[#return] :

0 commit comments

Comments
 (0)