Skip to content

Commit 417b0b5

Browse files
author
Robert Marsh
committed
C++: accept test changes for updated extractor
1 parent 9442be1 commit 417b0b5

8 files changed

Lines changed: 336 additions & 196 deletions

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

Lines changed: 65 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,21 @@ bad_asts.cpp:
155155
# 19| getInitializer(0): [ConstructorFieldInit] constructor init of field x
156156
# 19| Type = [IntType] int
157157
# 19| ValueCategory = prvalue
158-
# 19| getExpr(): [Literal] Unknown literal
158+
# 19| getExpr(): [FieldAccess] x
159159
# 19| Type = [IntType] int
160-
# 19| ValueCategory = prvalue
160+
# 19| ValueCategory = prvalue(load)
161+
# 19| getQualifier(): [VariableAccess] (unnamed parameter 0)
162+
# 19| Type = [LValueReferenceType] const Point &
163+
# 19| ValueCategory = prvalue(load)
161164
# 19| getInitializer(1): [ConstructorFieldInit] constructor init of field y
162165
# 19| Type = [IntType] int
163166
# 19| ValueCategory = prvalue
164-
# 19| getExpr(): [Literal] Unknown literal
167+
# 19| getExpr(): [FieldAccess] y
165168
# 19| Type = [IntType] int
166-
# 19| ValueCategory = prvalue
169+
# 19| ValueCategory = prvalue(load)
170+
# 19| getQualifier(): [VariableAccess] (unnamed parameter 0)
171+
# 19| Type = [LValueReferenceType] const Point &
172+
# 19| ValueCategory = prvalue(load)
167173
# 19| getEntryPoint(): [BlockStmt] { ... }
168174
# 19| getStmt(0): [ReturnStmt] return ...
169175
# 19| [MoveConstructor] void Bad::Point::Point(Bad::Point&&)
@@ -11645,51 +11651,75 @@ ir.cpp:
1164511651
# 1486| getInitializer(0): [ConstructorFieldInit] constructor init of field i
1164611652
# 1486| Type = [IntType] int
1164711653
# 1486| ValueCategory = prvalue
11648-
# 1486| getExpr(): [Literal] Unknown literal
11654+
# 1486| getExpr(): [FieldAccess] i
1164911655
# 1486| Type = [IntType] int
11650-
# 1486| ValueCategory = prvalue
11656+
# 1486| ValueCategory = prvalue(load)
11657+
# 1486| getQualifier(): [VariableAccess] (unnamed parameter 0)
11658+
# 1486| Type = [LValueReferenceType] const StructuredBindingDataMemberStruct &
11659+
# 1486| ValueCategory = prvalue(load)
1165111660
# 1486| getInitializer(1): [ConstructorFieldInit] constructor init of field d
1165211661
# 1486| Type = [DoubleType] double
1165311662
# 1486| ValueCategory = prvalue
11654-
# 1486| getExpr(): [Literal] Unknown literal
11663+
# 1486| getExpr(): [FieldAccess] d
1165511664
# 1486| Type = [DoubleType] double
11656-
# 1486| ValueCategory = prvalue
11665+
# 1486| ValueCategory = prvalue(load)
11666+
# 1486| getQualifier(): [VariableAccess] (unnamed parameter 0)
11667+
# 1486| Type = [LValueReferenceType] const StructuredBindingDataMemberStruct &
11668+
# 1486| ValueCategory = prvalue(load)
1165711669
# 1486| getInitializer(2): [ConstructorFieldInit] constructor init of field b
1165811670
# 1486| Type = [IntType] unsigned int
1165911671
# 1486| ValueCategory = prvalue
11660-
# 1486| getExpr(): [Literal] Unknown literal
11672+
# 1486| getExpr(): [FieldAccess] b
1166111673
# 1486| Type = [IntType] unsigned int
11662-
# 1486| ValueCategory = prvalue
11674+
# 1486| ValueCategory = prvalue(load)
11675+
# 1486| getQualifier(): [VariableAccess] (unnamed parameter 0)
11676+
# 1486| Type = [LValueReferenceType] const StructuredBindingDataMemberStruct &
11677+
# 1486| ValueCategory = prvalue(load)
1166311678
# 1486| getInitializer(3): [ConstructorFieldInit] constructor init of field r
1166411679
# 1486| Type = [LValueReferenceType] int &
1166511680
# 1486| ValueCategory = prvalue
11666-
# 1486| getExpr(): [Literal] Unknown literal
11681+
# 1486| getExpr(): [FieldAccess] r
1166711682
# 1486| Type = [LValueReferenceType] int &
11668-
# 1486| ValueCategory = prvalue
11683+
# 1486| ValueCategory = prvalue(load)
11684+
# 1486| getQualifier(): [VariableAccess] (unnamed parameter 0)
11685+
# 1486| Type = [LValueReferenceType] const StructuredBindingDataMemberStruct &
11686+
# 1486| ValueCategory = prvalue(load)
1166911687
# 1486| getInitializer(4): [ConstructorFieldInit] constructor init of field p
1167011688
# 1486| Type = [IntPointerType] int *
1167111689
# 1486| ValueCategory = prvalue
11672-
# 1486| getExpr(): [Literal] Unknown literal
11690+
# 1486| getExpr(): [FieldAccess] p
1167311691
# 1486| Type = [IntPointerType] int *
11674-
# 1486| ValueCategory = prvalue
11692+
# 1486| ValueCategory = prvalue(load)
11693+
# 1486| getQualifier(): [VariableAccess] (unnamed parameter 0)
11694+
# 1486| Type = [LValueReferenceType] const StructuredBindingDataMemberStruct &
11695+
# 1486| ValueCategory = prvalue(load)
1167511696
# 1486| getInitializer(5): [ConstructorFieldInit] constructor init of field xs
1167611697
# 1486| Type = [CTypedefType,NestedTypedefType] ArrayType
1167711698
# 1486| ValueCategory = prvalue
11678-
# 1486| getExpr(): [Literal] Unknown literal
11699+
# 1486| getExpr(): [FieldAccess] xs
1167911700
# 1486| Type = [CTypedefType,NestedTypedefType] ArrayType
11680-
# 1486| ValueCategory = prvalue
11701+
# 1486| ValueCategory = prvalue(load)
11702+
# 1486| getQualifier(): [VariableAccess] (unnamed parameter 0)
11703+
# 1486| Type = [LValueReferenceType] const StructuredBindingDataMemberStruct &
11704+
# 1486| ValueCategory = prvalue(load)
1168111705
# 1486| getInitializer(6): [ConstructorFieldInit] constructor init of field r_alt
1168211706
# 1486| Type = [CTypedefType,NestedTypedefType] RefType
1168311707
# 1486| ValueCategory = prvalue
11684-
# 1486| getExpr(): [Literal] Unknown literal
11708+
# 1486| getExpr(): [FieldAccess] r_alt
1168511709
# 1486| Type = [CTypedefType,NestedTypedefType] RefType
11686-
# 1486| ValueCategory = prvalue
11710+
# 1486| ValueCategory = prvalue(load)
11711+
# 1486| getQualifier(): [VariableAccess] (unnamed parameter 0)
11712+
# 1486| Type = [LValueReferenceType] const StructuredBindingDataMemberStruct &
11713+
# 1486| ValueCategory = prvalue(load)
1168711714
# 1486| getInitializer(7): [ConstructorFieldInit] constructor init of field m
1168811715
# 1486| Type = [Struct] StructuredBindingDataMemberMemberStruct
1168911716
# 1486| ValueCategory = prvalue
11690-
# 1486| getExpr(): [Literal] Unknown literal
11717+
# 1486| getExpr(): [FieldAccess] m
1169111718
# 1486| Type = [Struct] StructuredBindingDataMemberMemberStruct
11692-
# 1486| ValueCategory = prvalue
11719+
# 1486| ValueCategory = prvalue(load)
11720+
# 1486| getQualifier(): [VariableAccess] (unnamed parameter 0)
11721+
# 1486| Type = [LValueReferenceType] const StructuredBindingDataMemberStruct &
11722+
# 1486| ValueCategory = prvalue(load)
1169311723
# 1486| getEntryPoint(): [BlockStmt] { ... }
1169411724
# 1486| getStmt(0): [ReturnStmt] return ...
1169511725
# 1486| [MoveConstructor] void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct(StructuredBindingDataMemberStruct&&)
@@ -12066,21 +12096,30 @@ ir.cpp:
1206612096
# 1539| getInitializer(0): [ConstructorFieldInit] constructor init of field i
1206712097
# 1539| Type = [IntType] int
1206812098
# 1539| ValueCategory = prvalue
12069-
# 1539| getExpr(): [Literal] Unknown literal
12099+
# 1539| getExpr(): [FieldAccess] i
1207012100
# 1539| Type = [IntType] int
12071-
# 1539| ValueCategory = prvalue
12101+
# 1539| ValueCategory = prvalue(load)
12102+
# 1539| getQualifier(): [VariableAccess] (unnamed parameter 0)
12103+
# 1539| Type = [LValueReferenceType] const StructuredBindingTupleRefGet &
12104+
# 1539| ValueCategory = prvalue(load)
1207212105
# 1539| getInitializer(1): [ConstructorFieldInit] constructor init of field d
1207312106
# 1539| Type = [DoubleType] double
1207412107
# 1539| ValueCategory = prvalue
12075-
# 1539| getExpr(): [Literal] Unknown literal
12108+
# 1539| getExpr(): [FieldAccess] d
1207612109
# 1539| Type = [DoubleType] double
12077-
# 1539| ValueCategory = prvalue
12110+
# 1539| ValueCategory = prvalue(load)
12111+
# 1539| getQualifier(): [VariableAccess] (unnamed parameter 0)
12112+
# 1539| Type = [LValueReferenceType] const StructuredBindingTupleRefGet &
12113+
# 1539| ValueCategory = prvalue(load)
1207812114
# 1539| getInitializer(2): [ConstructorFieldInit] constructor init of field r
1207912115
# 1539| Type = [LValueReferenceType] int &
1208012116
# 1539| ValueCategory = prvalue
12081-
# 1539| getExpr(): [Literal] Unknown literal
12117+
# 1539| getExpr(): [FieldAccess] r
1208212118
# 1539| Type = [LValueReferenceType] int &
12083-
# 1539| ValueCategory = prvalue
12119+
# 1539| ValueCategory = prvalue(load)
12120+
# 1539| getQualifier(): [VariableAccess] (unnamed parameter 0)
12121+
# 1539| Type = [LValueReferenceType] const StructuredBindingTupleRefGet &
12122+
# 1539| ValueCategory = prvalue(load)
1208412123
# 1539| getEntryPoint(): [BlockStmt] { ... }
1208512124
# 1539| getStmt(0): [ReturnStmt] return ...
1208612125
# 1539| [MoveConstructor] void StructuredBindingTupleRefGet::StructuredBindingTupleRefGet(StructuredBindingTupleRefGet&&)

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ missingOperandType
66
duplicateChiOperand
77
sideEffectWithoutPrimary
88
instructionWithoutSuccessor
9-
| bad_asts.cpp:19:10:19:10 | FieldAddress: constructor init of field x | Instruction 'FieldAddress: constructor init of field x' has no successors in function '$@'. | bad_asts.cpp:19:10:19:10 | void Bad::Point::Point(Bad::Point const&) | void Bad::Point::Point(Bad::Point const&) |
10-
| ir.cpp:1486:8:1486:8 | FieldAddress: constructor init of field i | Instruction 'FieldAddress: constructor init of field i' has no successors in function '$@'. | ir.cpp:1486:8:1486:8 | void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct(StructuredBindingDataMemberStruct const&) | void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct(StructuredBindingDataMemberStruct const&) |
11-
| ir.cpp:1539:8:1539:8 | FieldAddress: constructor init of field i | Instruction 'FieldAddress: constructor init of field i' has no successors in function '$@'. | ir.cpp:1539:8:1539:8 | void StructuredBindingTupleRefGet::StructuredBindingTupleRefGet(StructuredBindingTupleRefGet const&) | void StructuredBindingTupleRefGet::StructuredBindingTupleRefGet(StructuredBindingTupleRefGet const&) |
129
| ir.cpp:1688:24:1690:5 | FieldAddress: {...} | Instruction 'FieldAddress: {...}' has no successors in function '$@'. | ir.cpp:1683:6:1683:20 | void captured_lambda(int, int&, int&&) | void captured_lambda(int, int&, int&&) |
1310
| ir.cpp:1689:28:1689:54 | FieldAddress: {...} | Instruction 'FieldAddress: {...}' has no successors 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 |
1411
ambiguousSuccessors

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ missingOperandType
66
duplicateChiOperand
77
sideEffectWithoutPrimary
88
instructionWithoutSuccessor
9-
| bad_asts.cpp:19:10:19:10 | FieldAddress: constructor init of field x | Instruction 'FieldAddress: constructor init of field x' has no successors in function '$@'. | bad_asts.cpp:19:10:19:10 | void Bad::Point::Point(Bad::Point const&) | void Bad::Point::Point(Bad::Point const&) |
10-
| ir.cpp:1486:8:1486:8 | FieldAddress: constructor init of field i | Instruction 'FieldAddress: constructor init of field i' has no successors in function '$@'. | ir.cpp:1486:8:1486:8 | void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct(StructuredBindingDataMemberStruct const&) | void StructuredBindingDataMemberStruct::StructuredBindingDataMemberStruct(StructuredBindingDataMemberStruct const&) |
11-
| ir.cpp:1539:8:1539:8 | FieldAddress: constructor init of field i | Instruction 'FieldAddress: constructor init of field i' has no successors in function '$@'. | ir.cpp:1539:8:1539:8 | void StructuredBindingTupleRefGet::StructuredBindingTupleRefGet(StructuredBindingTupleRefGet const&) | void StructuredBindingTupleRefGet::StructuredBindingTupleRefGet(StructuredBindingTupleRefGet const&) |
129
| ir.cpp:1688:24:1690:5 | FieldAddress: {...} | Instruction 'FieldAddress: {...}' has no successors in function '$@'. | ir.cpp:1683:6:1683:20 | void captured_lambda(int, int&, int&&) | void captured_lambda(int, int&, int&&) |
1310
| ir.cpp:1689:28:1689:54 | FieldAddress: {...} | Instruction 'FieldAddress: {...}' has no successors 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 |
1411
ambiguousSuccessors

0 commit comments

Comments
 (0)