Skip to content

Commit 1e33593

Browse files
committed
C++: Accept test changes.
1 parent dd39b97 commit 1e33593

10 files changed

+154
-421
lines changed

cpp/ql/test/library-tests/ir/ir/aliased_ir.expected

Lines changed: 78 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3308,12 +3308,14 @@ ir.c:
33083308
# 84| m84_8(int) = InitializeParameter[x2] : &:r84_7
33093309
# 85| r85_1(glval<int>) = VariableAddress[x1] :
33103310
# 85| r85_2(int) = Load[x1] : &:r85_1, m84_6
3311-
# 85| v85_3(void) = ConditionalBranch : r85_2
3311+
# 85| r85_3(int) = Constant[0] :
3312+
# 85| r85_4(bool) = CompareNE : r85_2, r85_3
3313+
# 85| v85_5(void) = ConditionalBranch : r85_4
33123314
#-----| False -> Block 2
33133315
#-----| True -> Block 1
33143316

33153317
# 85| Block 1
3316-
# 85| v85_4(void) = NoOp :
3318+
# 85| v85_6(void) = NoOp :
33173319
#-----| Goto -> Block 2
33183320

33193321
# 86| Block 2
@@ -3336,12 +3338,14 @@ ir.c:
33363338
# 88| m88_5(int) = Store[y] : &:r88_1, r88_4
33373339
# 89| r89_1(glval<int>) = VariableAddress[y] :
33383340
# 89| r89_2(int) = Load[y] : &:r89_1, m88_5
3339-
# 89| v89_3(void) = ConditionalBranch : r89_2
3341+
# 89| r89_3(int) = Constant[0] :
3342+
# 89| r89_4(bool) = CompareNE : r89_2, r89_3
3343+
# 89| v89_5(void) = ConditionalBranch : r89_4
33403344
#-----| False -> Block 6
33413345
#-----| True -> Block 5
33423346

33433347
# 89| Block 5
3344-
# 89| v89_4(void) = NoOp :
3348+
# 89| v89_6(void) = NoOp :
33453349
#-----| Goto -> Block 6
33463350

33473351
# 90| Block 6
@@ -3359,19 +3363,23 @@ ir.c:
33593363
# 92| Block 8
33603364
# 92| r92_1(glval<int>) = VariableAddress[x1] :
33613365
# 92| r92_2(int) = Load[x1] : &:r92_1, m84_6
3362-
# 92| v92_3(void) = ConditionalBranch : r92_2
3366+
# 92| r92_3(int) = Constant[0] :
3367+
# 92| r92_4(bool) = CompareNE : r92_2, r92_3
3368+
# 92| v92_5(void) = ConditionalBranch : r92_4
33633369
#-----| False -> Block 11
33643370
#-----| True -> Block 9
33653371

33663372
# 92| Block 9
3367-
# 92| r92_4(glval<int>) = VariableAddress[x2] :
3368-
# 92| r92_5(int) = Load[x2] : &:r92_4, m84_8
3369-
# 92| v92_6(void) = ConditionalBranch : r92_5
3373+
# 92| r92_6(glval<int>) = VariableAddress[x2] :
3374+
# 92| r92_7(int) = Load[x2] : &:r92_6, m84_8
3375+
# 92| r92_8(int) = Constant[0] :
3376+
# 92| r92_9(bool) = CompareNE : r92_7, r92_8
3377+
# 92| v92_10(void) = ConditionalBranch : r92_9
33703378
#-----| False -> Block 11
33713379
#-----| True -> Block 10
33723380

33733381
# 92| Block 10
3374-
# 92| v92_7(void) = NoOp :
3382+
# 92| v92_11(void) = NoOp :
33753383
#-----| Goto -> Block 11
33763384

33773385
# 93| Block 11
@@ -3385,31 +3393,35 @@ ir.c:
33853393
# 93| Block 12
33863394
# 93| r93_5(glval<int>) = VariableAddress[x2] :
33873395
# 93| r93_6(int) = Load[x2] : &:r93_5, m84_8
3388-
# 93| v93_7(void) = ConditionalBranch : r93_6
3396+
# 93| r93_7(int) = Constant[0] :
3397+
# 93| r93_8(bool) = CompareNE : r93_6, r93_7
3398+
# 93| v93_9(void) = ConditionalBranch : r93_8
33893399
#-----| False -> Block 14
33903400
#-----| True -> Block 13
33913401

33923402
# 93| Block 13
3393-
# 93| v93_8(void) = NoOp :
3403+
# 93| v93_10(void) = NoOp :
33943404
#-----| Goto -> Block 14
33953405

33963406
# 94| Block 14
33973407
# 94| r94_1(glval<int>) = VariableAddress[x1] :
33983408
# 94| r94_2(int) = Load[x1] : &:r94_1, m84_6
3399-
# 94| v94_3(void) = ConditionalBranch : r94_2
3409+
# 94| r94_3(int) = Constant[0] :
3410+
# 94| r94_4(bool) = CompareNE : r94_2, r94_3
3411+
# 94| v94_5(void) = ConditionalBranch : r94_4
34003412
#-----| False -> Block 17
34013413
#-----| True -> Block 15
34023414

34033415
# 94| Block 15
3404-
# 94| r94_4(glval<int>) = VariableAddress[x2] :
3405-
# 94| r94_5(int) = Load[x2] : &:r94_4, m84_8
3406-
# 94| r94_6(bool) = LogicalNot : r94_5
3407-
# 94| v94_7(void) = ConditionalBranch : r94_6
3416+
# 94| r94_6(glval<int>) = VariableAddress[x2] :
3417+
# 94| r94_7(int) = Load[x2] : &:r94_6, m84_8
3418+
# 94| r94_8(bool) = LogicalNot : r94_7
3419+
# 94| v94_9(void) = ConditionalBranch : r94_8
34083420
#-----| False -> Block 17
34093421
#-----| True -> Block 16
34103422

34113423
# 94| Block 16
3412-
# 94| v94_8(void) = NoOp :
3424+
# 94| v94_10(void) = NoOp :
34133425
#-----| Goto -> Block 17
34143426

34153427
# 95| Block 17
@@ -3435,19 +3447,23 @@ ir.c:
34353447
# 96| Block 20
34363448
# 96| r96_1(glval<int>) = VariableAddress[x1] :
34373449
# 96| r96_2(int) = Load[x1] : &:r96_1, m84_6
3438-
# 96| v96_3(void) = ConditionalBranch : r96_2
3450+
# 96| r96_3(int) = Constant[0] :
3451+
# 96| r96_4(bool) = CompareNE : r96_2, r96_3
3452+
# 96| v96_5(void) = ConditionalBranch : r96_4
34393453
#-----| False -> Block 21
34403454
#-----| True -> Block 22
34413455

34423456
# 96| Block 21
3443-
# 96| r96_4(glval<int>) = VariableAddress[x2] :
3444-
# 96| r96_5(int) = Load[x2] : &:r96_4, m84_8
3445-
# 96| v96_6(void) = ConditionalBranch : r96_5
3457+
# 96| r96_6(glval<int>) = VariableAddress[x2] :
3458+
# 96| r96_7(int) = Load[x2] : &:r96_6, m84_8
3459+
# 96| r96_8(int) = Constant[0] :
3460+
# 96| r96_9(bool) = CompareNE : r96_7, r96_8
3461+
# 96| v96_10(void) = ConditionalBranch : r96_9
34463462
#-----| False -> Block 23
34473463
#-----| True -> Block 22
34483464

34493465
# 96| Block 22
3450-
# 96| v96_7(void) = NoOp :
3466+
# 96| v96_11(void) = NoOp :
34513467
#-----| Goto -> Block 23
34523468

34533469
# 97| Block 23
@@ -3461,31 +3477,35 @@ ir.c:
34613477
# 97| Block 24
34623478
# 97| r97_5(glval<int>) = VariableAddress[x2] :
34633479
# 97| r97_6(int) = Load[x2] : &:r97_5, m84_8
3464-
# 97| v97_7(void) = ConditionalBranch : r97_6
3480+
# 97| r97_7(int) = Constant[0] :
3481+
# 97| r97_8(bool) = CompareNE : r97_6, r97_7
3482+
# 97| v97_9(void) = ConditionalBranch : r97_8
34653483
#-----| False -> Block 26
34663484
#-----| True -> Block 25
34673485

34683486
# 97| Block 25
3469-
# 97| v97_8(void) = NoOp :
3487+
# 97| v97_10(void) = NoOp :
34703488
#-----| Goto -> Block 26
34713489

34723490
# 98| Block 26
34733491
# 98| r98_1(glval<int>) = VariableAddress[x1] :
34743492
# 98| r98_2(int) = Load[x1] : &:r98_1, m84_6
3475-
# 98| v98_3(void) = ConditionalBranch : r98_2
3493+
# 98| r98_3(int) = Constant[0] :
3494+
# 98| r98_4(bool) = CompareNE : r98_2, r98_3
3495+
# 98| v98_5(void) = ConditionalBranch : r98_4
34763496
#-----| False -> Block 27
34773497
#-----| True -> Block 28
34783498

34793499
# 98| Block 27
3480-
# 98| r98_4(glval<int>) = VariableAddress[x2] :
3481-
# 98| r98_5(int) = Load[x2] : &:r98_4, m84_8
3482-
# 98| r98_6(bool) = LogicalNot : r98_5
3483-
# 98| v98_7(void) = ConditionalBranch : r98_6
3500+
# 98| r98_6(glval<int>) = VariableAddress[x2] :
3501+
# 98| r98_7(int) = Load[x2] : &:r98_6, m84_8
3502+
# 98| r98_8(bool) = LogicalNot : r98_7
3503+
# 98| v98_9(void) = ConditionalBranch : r98_8
34843504
#-----| False -> Block 29
34853505
#-----| True -> Block 28
34863506

34873507
# 98| Block 28
3488-
# 98| v98_8(void) = NoOp :
3508+
# 98| v98_10(void) = NoOp :
34893509
#-----| Goto -> Block 29
34903510

34913511
# 99| Block 29
@@ -3512,47 +3532,53 @@ ir.c:
35123532
# 101| r101_1(glval<int>) = VariableAddress[x_1_and_2] :
35133533
# 101| r101_2(glval<int>) = VariableAddress[x1] :
35143534
# 101| r101_3(int) = Load[x1] : &:r101_2, m84_6
3515-
# 101| v101_4(void) = ConditionalBranch : r101_3
3535+
# 101| r101_4(int) = Constant[0] :
3536+
# 101| r101_5(bool) = CompareNE : r101_3, r101_4
3537+
# 101| v101_6(void) = ConditionalBranch : r101_5
35163538
#-----| False -> Block 33
35173539
#-----| True -> Block 36
35183540

35193541
# 101| Block 33
3520-
# 101| r101_5(glval<int>) = VariableAddress[#temp101:19] :
3521-
# 101| r101_6(int) = Constant[0] :
3522-
# 101| m101_7(int) = Store[#temp101:19] : &:r101_5, r101_6
3542+
# 101| r101_7(glval<int>) = VariableAddress[#temp101:19] :
3543+
# 101| r101_8(int) = Constant[0] :
3544+
# 101| m101_9(int) = Store[#temp101:19] : &:r101_7, r101_8
35233545
#-----| Goto -> Block 34
35243546

35253547
# 101| Block 34
3526-
# 101| m101_8(int) = Phi : from 33:m101_7, from 35:m101_14
3527-
# 101| r101_9(glval<int>) = VariableAddress[#temp101:19] :
3528-
# 101| r101_10(int) = Load[#temp101:19] : &:r101_9, m101_8
3529-
# 101| m101_11(int) = Store[x_1_and_2] : &:r101_1, r101_10
3530-
# 102| r102_1(glval<int>) = VariableAddress[x_1_and_2] :
3531-
# 102| r102_2(int) = Load[x_1_and_2] : &:r102_1, m101_11
3532-
# 102| v102_3(void) = ConditionalBranch : r102_2
3548+
# 101| m101_10(int) = Phi : from 33:m101_9, from 35:m101_16
3549+
# 101| r101_11(glval<int>) = VariableAddress[#temp101:19] :
3550+
# 101| r101_12(int) = Load[#temp101:19] : &:r101_11, m101_10
3551+
# 101| m101_13(int) = Store[x_1_and_2] : &:r101_1, r101_12
3552+
# 102| r102_1(glval<int>) = VariableAddress[x_1_and_2] :
3553+
# 102| r102_2(int) = Load[x_1_and_2] : &:r102_1, m101_13
3554+
# 102| r102_3(int) = Constant[0] :
3555+
# 102| r102_4(bool) = CompareNE : r102_2, r102_3
3556+
# 102| v102_5(void) = ConditionalBranch : r102_4
35333557
#-----| False -> Block 38
35343558
#-----| True -> Block 37
35353559

35363560
# 101| Block 35
3537-
# 101| r101_12(glval<int>) = VariableAddress[#temp101:19] :
3538-
# 101| r101_13(int) = Constant[1] :
3539-
# 101| m101_14(int) = Store[#temp101:19] : &:r101_12, r101_13
3561+
# 101| r101_14(glval<int>) = VariableAddress[#temp101:19] :
3562+
# 101| r101_15(int) = Constant[1] :
3563+
# 101| m101_16(int) = Store[#temp101:19] : &:r101_14, r101_15
35403564
#-----| Goto -> Block 34
35413565

35423566
# 101| Block 36
3543-
# 101| r101_15(glval<int>) = VariableAddress[x2] :
3544-
# 101| r101_16(int) = Load[x2] : &:r101_15, m84_8
3545-
# 101| v101_17(void) = ConditionalBranch : r101_16
3567+
# 101| r101_17(glval<int>) = VariableAddress[x2] :
3568+
# 101| r101_18(int) = Load[x2] : &:r101_17, m84_8
3569+
# 101| r101_19(int) = Constant[0] :
3570+
# 101| r101_20(bool) = CompareNE : r101_18, r101_19
3571+
# 101| v101_21(void) = ConditionalBranch : r101_20
35463572
#-----| False -> Block 33
35473573
#-----| True -> Block 35
35483574

35493575
# 102| Block 37
3550-
# 102| v102_4(void) = NoOp :
3576+
# 102| v102_6(void) = NoOp :
35513577
#-----| Goto -> Block 38
35523578

35533579
# 103| Block 38
35543580
# 103| r103_1(glval<int>) = VariableAddress[x_1_and_2] :
3555-
# 103| r103_2(int) = Load[x_1_and_2] : &:r103_1, m101_11
3581+
# 103| r103_2(int) = Load[x_1_and_2] : &:r103_1, m101_13
35563582
# 103| r103_3(bool) = LogicalNot : r103_2
35573583
# 103| v103_4(void) = ConditionalBranch : r103_3
35583584
#-----| False -> Block 40
@@ -38838,7 +38864,9 @@ try_except.c:
3883838864
# 33| m33_3(int) = Store[x] : &:r33_1, r33_2
3883938865
# 35| r35_1(glval<int>) = VariableAddress[b] :
3884038866
# 35| r35_2(int) = Load[b] : &:r35_1, m32_6
38841-
# 35| v35_3(void) = ConditionalBranch : r35_2
38867+
# 35| r35_3(int) = Constant[0] :
38868+
# 35| r35_4(bool) = CompareNE : r35_2, r35_3
38869+
# 35| v35_5(void) = ConditionalBranch : r35_4
3884238870
#-----| False -> Block 2
3884338871
#-----| True -> Block 1
3884438872

cpp/ql/test/library-tests/ir/ir/aliased_ssa_consistency.expected

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,16 @@ thisArgumentIsNonPointer
3030
| ir.cpp:2546:34:2546:34 | Call: call to operator bool | Call instruction 'Call: call to operator bool' has a `this` argument operand that is not an address, in function '$@'. | ir.cpp:2545:6:2545:23 | void this_inconsistency(bool) | void this_inconsistency(bool) |
3131
nonUniqueIRVariable
3232
nonBooleanOperand
33-
| ir.c:85:7:85:8 | ConditionalBranch: x1 | Conditional branch instruction ConditionalBranch: x1 with non-Boolean condition, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
3433
| ir.c:86:6:86:8 | LogicalNot: ! ... | Logical Not instruction LogicalNot: ! ... with non-Boolean operand, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
3534
| ir.c:88:11:88:13 | LogicalNot: ! ... | Logical Not instruction LogicalNot: ! ... with non-Boolean operand, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
36-
| ir.c:89:6:89:6 | ConditionalBranch: y | Conditional branch instruction ConditionalBranch: y with non-Boolean condition, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
3735
| ir.c:90:6:90:7 | LogicalNot: ! ... | Logical Not instruction LogicalNot: ! ... with non-Boolean operand, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
38-
| ir.c:92:6:92:7 | ConditionalBranch: x1 | Conditional branch instruction ConditionalBranch: x1 with non-Boolean condition, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
39-
| ir.c:92:12:92:13 | ConditionalBranch: x2 | Conditional branch instruction ConditionalBranch: x2 with non-Boolean condition, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
4036
| ir.c:93:6:93:8 | LogicalNot: ! ... | Logical Not instruction LogicalNot: ! ... with non-Boolean operand, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
41-
| ir.c:93:13:93:14 | ConditionalBranch: x2 | Conditional branch instruction ConditionalBranch: x2 with non-Boolean condition, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
42-
| ir.c:94:6:94:7 | ConditionalBranch: x1 | Conditional branch instruction ConditionalBranch: x1 with non-Boolean condition, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
4337
| ir.c:94:12:94:14 | LogicalNot: ! ... | Logical Not instruction LogicalNot: ! ... with non-Boolean operand, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
4438
| ir.c:95:6:95:8 | LogicalNot: ! ... | Logical Not instruction LogicalNot: ! ... with non-Boolean operand, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
4539
| ir.c:95:13:95:15 | LogicalNot: ! ... | Logical Not instruction LogicalNot: ! ... with non-Boolean operand, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
46-
| ir.c:96:6:96:7 | ConditionalBranch: x1 | Conditional branch instruction ConditionalBranch: x1 with non-Boolean condition, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
47-
| ir.c:96:12:96:13 | ConditionalBranch: x2 | Conditional branch instruction ConditionalBranch: x2 with non-Boolean condition, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
4840
| ir.c:97:6:97:8 | LogicalNot: ! ... | Logical Not instruction LogicalNot: ! ... with non-Boolean operand, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
49-
| ir.c:97:13:97:14 | ConditionalBranch: x2 | Conditional branch instruction ConditionalBranch: x2 with non-Boolean condition, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
50-
| ir.c:98:6:98:7 | ConditionalBranch: x1 | Conditional branch instruction ConditionalBranch: x1 with non-Boolean condition, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
5141
| ir.c:98:12:98:14 | LogicalNot: ! ... | Logical Not instruction LogicalNot: ! ... with non-Boolean operand, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
5242
| ir.c:99:6:99:8 | LogicalNot: ! ... | Logical Not instruction LogicalNot: ! ... with non-Boolean operand, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
5343
| ir.c:99:13:99:15 | LogicalNot: ! ... | Logical Not instruction LogicalNot: ! ... with non-Boolean operand, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
54-
| ir.c:101:19:101:20 | ConditionalBranch: x1 | Conditional branch instruction ConditionalBranch: x1 with non-Boolean condition, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
55-
| ir.c:101:25:101:26 | ConditionalBranch: x2 | Conditional branch instruction ConditionalBranch: x2 with non-Boolean condition, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
56-
| ir.c:102:6:102:14 | ConditionalBranch: x_1_and_2 | Conditional branch instruction ConditionalBranch: x_1_and_2 with non-Boolean condition, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
5744
| ir.c:103:6:103:15 | LogicalNot: ! ... | Logical Not instruction LogicalNot: ! ... with non-Boolean operand, in function '$@'. | ir.c:84:6:84:28 | void branch_on_integral_in_c(int, int) | void branch_on_integral_in_c(int, int) |
58-
| try_except.c:35:13:35:13 | ConditionalBranch: b | Conditional branch instruction ConditionalBranch: b with non-Boolean condition, in function '$@'. | try_except.c:32:6:32:6 | void h(int) | void h(int) |
5945
missingCppType

0 commit comments

Comments
 (0)