Skip to content

Commit d51cbe2

Browse files
committed
C++: Update IR tests for handling of bitwise copy with explicit source
1 parent 8be02b1 commit d51cbe2

File tree

4 files changed

+36
-24
lines changed

4 files changed

+36
-24
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12842,9 +12842,9 @@ ir.cpp:
1284212842
# 1674| getDeclarationEntry(0): (no string representation)
1284312843
# 1674| Type = [ArrayType] int[2]
1284412844
# 1674| getVariable().getInitializer(): [Initializer] initializer for (unnamed local variable)
12845-
# 1674| getExpr(): (no string representation)
12845+
# 1674| getExpr(): [VariableAccess] xs
1284612846
# 1674| Type = [ArrayType] int[2]
12847-
# 1674| ValueCategory = prvalue
12847+
# 1674| ValueCategory = prvalue(load)
1284812848
# 1674| getDeclarationEntry(1): [VariableDeclarationEntry] definition of x0
1284912849
# 1674| Type = [IntType] int
1285012850
#-----| getVariable().getInitializer(): [Initializer] initializer for x0

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,9 @@
684684
| file://:0:0:0:0 | ChiTotal | total:m763_8 |
685685
| file://:0:0:0:0 | ChiTotal | total:m1043_10 |
686686
| file://:0:0:0:0 | ChiTotal | total:m1240_4 |
687+
| file://:0:0:0:0 | Left | r0_2 |
687688
| file://:0:0:0:0 | Left | r0_4 |
689+
| file://:0:0:0:0 | Left | r0_7 |
688690
| file://:0:0:0:0 | Left | r0_11 |
689691
| file://:0:0:0:0 | Load | m0_2 |
690692
| file://:0:0:0:0 | Load | m0_2 |
@@ -696,7 +698,9 @@
696698
| file://:0:0:0:0 | Load | m1466_4 |
697699
| file://:0:0:0:0 | Load | m1466_4 |
698700
| file://:0:0:0:0 | Load | ~m1444_6 |
701+
| file://:0:0:0:0 | Right | r0_3 |
699702
| file://:0:0:0:0 | Right | r0_5 |
703+
| file://:0:0:0:0 | Right | r0_8 |
700704
| file://:0:0:0:0 | Right | r0_12 |
701705
| file://:0:0:0:0 | SideEffect | m0_4 |
702706
| file://:0:0:0:0 | SideEffect | m0_4 |
@@ -726,19 +730,23 @@
726730
| file://:0:0:0:0 | StoreValue | r0_1 |
727731
| file://:0:0:0:0 | StoreValue | r0_1 |
728732
| file://:0:0:0:0 | StoreValue | r0_3 |
733+
| file://:0:0:0:0 | StoreValue | r0_4 |
729734
| file://:0:0:0:0 | StoreValue | r0_6 |
735+
| file://:0:0:0:0 | StoreValue | r0_9 |
730736
| file://:0:0:0:0 | StoreValue | r0_13 |
731737
| file://:0:0:0:0 | StoreValue | r0_13 |
732738
| file://:0:0:0:0 | StoreValue | r0_22 |
733739
| file://:0:0:0:0 | StoreValue | r0_22 |
734740
| file://:0:0:0:0 | Unary | r0_1 |
741+
| file://:0:0:0:0 | Unary | r0_1 |
735742
| file://:0:0:0:0 | Unary | r0_2 |
736743
| file://:0:0:0:0 | Unary | r0_3 |
737744
| file://:0:0:0:0 | Unary | r0_5 |
738745
| file://:0:0:0:0 | Unary | r0_5 |
739746
| file://:0:0:0:0 | Unary | r0_6 |
740747
| file://:0:0:0:0 | Unary | r0_6 |
741748
| file://:0:0:0:0 | Unary | r0_6 |
749+
| file://:0:0:0:0 | Unary | r0_6 |
742750
| file://:0:0:0:0 | Unary | r0_7 |
743751
| file://:0:0:0:0 | Unary | r0_7 |
744752
| file://:0:0:0:0 | Unary | r0_7 |
@@ -7438,6 +7446,7 @@
74387446
| ir.cpp:1668:17:1668:17 | StoreValue | r1668_4 |
74397447
| ir.cpp:1672:6:1672:42 | ChiPartial | partial:m1672_3 |
74407448
| ir.cpp:1672:6:1672:42 | ChiTotal | total:m1672_2 |
7449+
| ir.cpp:1672:6:1672:42 | SideEffect | m1672_3 |
74417450
| ir.cpp:1673:9:1673:10 | Address | &:r1673_1 |
74427451
| ir.cpp:1673:9:1673:10 | Left | r1673_1 |
74437452
| ir.cpp:1673:9:1673:10 | Left | r1673_1 |
@@ -7451,6 +7460,12 @@
74517460
| ir.cpp:1673:21:1673:21 | ChiPartial | partial:m1673_11 |
74527461
| ir.cpp:1673:21:1673:21 | ChiTotal | total:m1673_7 |
74537462
| ir.cpp:1673:21:1673:21 | StoreValue | r1673_10 |
7463+
| ir.cpp:1674:10:1674:10 | Address | &:r1674_1 |
7464+
| ir.cpp:1674:11:1674:11 | Address | &:r1674_5 |
7465+
| ir.cpp:1674:15:1674:15 | Address | &:r1674_6 |
7466+
| ir.cpp:1674:21:1674:22 | Address | &:r1674_2 |
7467+
| ir.cpp:1674:21:1674:22 | Load | m1673_12 |
7468+
| ir.cpp:1674:21:1674:22 | StoreValue | r1674_3 |
74547469
| ir.cpp:1680:5:1680:23 | Address | &:r1680_5 |
74557470
| ir.cpp:1680:5:1680:23 | Address | &:r1680_5 |
74567471
| ir.cpp:1680:5:1680:23 | Address | &:r1680_7 |

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
missingOperand
2-
| ir.cpp:1674:21:1674:22 | Load: Unknown literal | Instruction 'Load' is missing an expected operand with tag 'Address' in function '$@'. | ir.cpp:1672:6:1672:42 | void array_structured_binding_non_ref_init() | void array_structured_binding_non_ref_init() |
32
| ir.cpp:1688:24:1690:5 | Store: Unknown literal | Instruction 'Store' is missing an expected operand with tag 'StoreValue' in function '$@'. | ir.cpp:1683:6:1683:20 | void captured_lambda(int, int&, int&&) | void captured_lambda(int, int&, int&&) |
43
| ir.cpp:1688:24:1690:5 | Store: Unknown literal | Instruction 'Store' is missing an expected operand with tag 'StoreValue' in function '$@'. | ir.cpp:1683:6:1683:20 | void captured_lambda(int, int&, int&&) | void captured_lambda(int, int&, int&&) |
54
| ir.cpp:1689:28:1689:54 | Store: Unknown literal | Instruction 'Store' is missing an expected operand with tag 'StoreValue' in function '$@'. | ir.cpp:1688:46:1688:46 | void (void captured_lambda(int, int&, int&&))::(lambda [] type at line 1688, col. 25)::operator()() const | void (void captured_lambda(int, int&, int&&))::(lambda [] type at line 1688, col. 25)::operator()() const |
@@ -27,7 +26,6 @@ lostReachability
2726
backEdgeCountMismatch
2827
useNotDominatedByDefinition
2928
| ir.cpp:1486:8:1486:8 | Unary | Operand 'Unary' is not dominated by its definition in function '$@'. | ir.cpp:1486:8:1486:8 | void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct() | void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct() |
30-
| ir.cpp:1674:10:1674:10 | Address | Operand 'Address' is not dominated by its definition in function '$@'. | ir.cpp:1672:6:1672:42 | void array_structured_binding_non_ref_init() | void array_structured_binding_non_ref_init() |
3129
| ir.cpp:1683:34:1683:34 | Address | Operand 'Address' is not dominated by its definition in function '$@'. | ir.cpp:1683:6:1683:20 | void captured_lambda(int, int&, int&&) | void captured_lambda(int, int&, int&&) |
3230
| ir.cpp:1683:43:1683:43 | Address | Operand 'Address' is not dominated by its definition in function '$@'. | ir.cpp:1683:6:1683:20 | void captured_lambda(int, int&, int&&) | void captured_lambda(int, int&, int&&) |
3331
| ir.cpp:1688:10:1688:21 | Address | Operand 'Address' is not dominated by its definition in function '$@'. | ir.cpp:1683:6:1683:20 | void captured_lambda(int, int&, int&&) | void captured_lambda(int, int&, int&&) |

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

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8680,26 +8680,25 @@ ir.cpp:
86808680
# 1673| r1673_9(int) = Constant[2] :
86818681
# 1673| mu1673_10(int) = Store[?] : &:r1673_8, r1673_9
86828682
# 1674| r1674_1(glval<int[2]>) = VariableAddress[(unnamed local variable)] :
8683-
8684-
# 1674| Block 1
8685-
# 1674| r1674_2(int[2]) = Load : ~m?
8686-
# 1674| mu1674_3(int[2]) = Store[(unnamed local variable)] : &:r1674_1, r1674_2
8687-
# 1674| r1674_4(glval<int &>) = VariableAddress[x0] :
8688-
#-----| r0_1(glval<int[2]>) = VariableAddress[(unnamed local variable)] :
8689-
#-----| r0_2(int *) = Convert : r0_1
8690-
#-----| r0_3(unsigned long) = Constant[0] :
8691-
#-----| r0_4(glval<int>) = PointerAdd[4] : r0_2, r0_3
8692-
#-----| mu0_5(int &) = Store[x0] : &:r1674_4, r0_4
8693-
# 1674| r1674_5(glval<int &>) = VariableAddress[x1] :
8694-
#-----| r0_6(glval<int[2]>) = VariableAddress[(unnamed local variable)] :
8695-
#-----| r0_7(int *) = Convert : r0_6
8696-
#-----| r0_8(unsigned long) = Constant[1] :
8697-
#-----| r0_9(glval<int>) = PointerAdd[4] : r0_7, r0_8
8698-
#-----| mu0_10(int &) = Store[x1] : &:r1674_5, r0_9
8699-
# 1675| v1675_1(void) = NoOp :
8700-
# 1672| v1672_4(void) = ReturnVoid :
8701-
# 1672| v1672_5(void) = AliasedUse : ~m?
8702-
# 1672| v1672_6(void) = ExitFunction :
8683+
# 1674| r1674_2(glval<int[2]>) = VariableAddress[xs] :
8684+
# 1674| r1674_3(int[2]) = Load[xs] : &:r1674_2, ~m?
8685+
# 1674| mu1674_4(int[2]) = Store[(unnamed local variable)] : &:r1674_1, r1674_3
8686+
# 1674| r1674_5(glval<int &>) = VariableAddress[x0] :
8687+
#-----| r0_1(glval<int[2]>) = VariableAddress[(unnamed local variable)] :
8688+
#-----| r0_2(int *) = Convert : r0_1
8689+
#-----| r0_3(unsigned long) = Constant[0] :
8690+
#-----| r0_4(glval<int>) = PointerAdd[4] : r0_2, r0_3
8691+
#-----| mu0_5(int &) = Store[x0] : &:r1674_5, r0_4
8692+
# 1674| r1674_6(glval<int &>) = VariableAddress[x1] :
8693+
#-----| r0_6(glval<int[2]>) = VariableAddress[(unnamed local variable)] :
8694+
#-----| r0_7(int *) = Convert : r0_6
8695+
#-----| r0_8(unsigned long) = Constant[1] :
8696+
#-----| r0_9(glval<int>) = PointerAdd[4] : r0_7, r0_8
8697+
#-----| mu0_10(int &) = Store[x1] : &:r1674_6, r0_9
8698+
# 1675| v1675_1(void) = NoOp :
8699+
# 1672| v1672_4(void) = ReturnVoid :
8700+
# 1672| v1672_5(void) = AliasedUse : ~m?
8701+
# 1672| v1672_6(void) = ExitFunction :
87038702

87048703
# 1680| void CapturedLambdaMyObj::CapturedLambdaMyObj()
87058704
# 1680| Block 0

0 commit comments

Comments
 (0)