Skip to content

Commit e91c042

Browse files
committed
C++: Update tests for copy constructor calls with implied source
1 parent e710cf7 commit e91c042

File tree

4 files changed

+107
-52
lines changed

4 files changed

+107
-52
lines changed

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13437,6 +13437,19 @@ ir.cpp:
1343713437
# 1736| getInitializer(0): [ConstructorDirectInit] call to CopyConstructorWithImplicitArgumentClass
1343813438
# 1736| Type = [VoidType] void
1343913439
# 1736| ValueCategory = prvalue
13440+
# 1736| getArgument(0): [VariableAccess] (unnamed parameter 0)
13441+
# 1736| Type = [LValueReferenceType] const CopyConstructorTestNonVirtualClass &
13442+
# 1736| ValueCategory = prvalue(load)
13443+
# 1736| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to)
13444+
# 1736| Type = [LValueReferenceType] const CopyConstructorWithImplicitArgumentClass &
13445+
# 1736| ValueCategory = prvalue
13446+
# 1736| getExpr(): [CStyleCast] (const CopyConstructorWithImplicitArgumentClass)...
13447+
# 1736| Conversion = [BaseClassConversion] base class conversion
13448+
# 1736| Type = [SpecifiedType] const CopyConstructorWithImplicitArgumentClass
13449+
# 1736| ValueCategory = lvalue
13450+
# 1736| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
13451+
# 1736| Type = [SpecifiedType] const CopyConstructorTestNonVirtualClass
13452+
# 1736| ValueCategory = lvalue
1344013453
# 1736| getInitializer(1): (no string representation)
1344113454
# 1736| Type = [VirtualBaseClass] CopyConstructorWithBitwiseCopyClass
1344213455
# 1736| ValueCategory = prvalue
@@ -13473,6 +13486,19 @@ ir.cpp:
1347313486
# 1743| getInitializer(0): [ConstructorVirtualInit] call to CopyConstructorWithImplicitArgumentClass
1347413487
# 1743| Type = [VoidType] void
1347513488
# 1743| ValueCategory = prvalue
13489+
# 1743| getArgument(0): [VariableAccess] (unnamed parameter 0)
13490+
# 1743| Type = [LValueReferenceType] const CopyConstructorTestVirtualClass &
13491+
# 1743| ValueCategory = prvalue(load)
13492+
# 1743| getArgument(0).getFullyConverted(): [ReferenceToExpr] (reference to)
13493+
# 1743| Type = [LValueReferenceType] const CopyConstructorWithImplicitArgumentClass &
13494+
# 1743| ValueCategory = prvalue
13495+
# 1743| getExpr(): [CStyleCast] (const CopyConstructorWithImplicitArgumentClass)...
13496+
# 1743| Conversion = [BaseClassConversion] base class conversion
13497+
# 1743| Type = [SpecifiedType] const CopyConstructorWithImplicitArgumentClass
13498+
# 1743| ValueCategory = lvalue
13499+
# 1743| getExpr(): [ReferenceDereferenceExpr] (reference dereference)
13500+
# 1743| Type = [SpecifiedType] const CopyConstructorTestVirtualClass
13501+
# 1743| ValueCategory = lvalue
1347613502
# 1743| getInitializer(1): (no string representation)
1347713503
# 1743| Type = [VirtualBaseClass] CopyConstructorWithBitwiseCopyClass
1347813504
# 1743| ValueCategory = prvalue

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

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8072,19 +8072,27 @@
80728072
| ir.cpp:1736:7:1736:7 | Address | &:r1736_7 |
80738073
| ir.cpp:1736:7:1736:7 | Address | &:r1736_7 |
80748074
| ir.cpp:1736:7:1736:7 | Address | &:r1736_9 |
8075+
| ir.cpp:1736:7:1736:7 | Address | &:r1736_11 |
8076+
| ir.cpp:1736:7:1736:7 | Address | &:r1736_15 |
8077+
| ir.cpp:1736:7:1736:7 | Arg(0) | 0:r1736_15 |
80758078
| ir.cpp:1736:7:1736:7 | Arg(this) | this:r1736_9 |
80768079
| ir.cpp:1736:7:1736:7 | CallTarget | func:r1736_10 |
80778080
| ir.cpp:1736:7:1736:7 | ChiPartial | partial:m1736_3 |
8078-
| ir.cpp:1736:7:1736:7 | ChiPartial | partial:m1736_12 |
8079-
| ir.cpp:1736:7:1736:7 | ChiPartial | partial:m1736_14 |
8081+
| ir.cpp:1736:7:1736:7 | ChiPartial | partial:m1736_17 |
8082+
| ir.cpp:1736:7:1736:7 | ChiPartial | partial:m1736_20 |
80808083
| ir.cpp:1736:7:1736:7 | ChiTotal | total:m1736_2 |
80818084
| ir.cpp:1736:7:1736:7 | ChiTotal | total:m1736_4 |
80828085
| ir.cpp:1736:7:1736:7 | ChiTotal | total:m1736_8 |
8086+
| ir.cpp:1736:7:1736:7 | Load | m0_2 |
80838087
| ir.cpp:1736:7:1736:7 | Load | m1736_6 |
8084-
| ir.cpp:1736:7:1736:7 | SideEffect | m1736_15 |
8088+
| ir.cpp:1736:7:1736:7 | SideEffect | m1736_21 |
8089+
| ir.cpp:1736:7:1736:7 | SideEffect | ~m0_4 |
80858090
| ir.cpp:1736:7:1736:7 | SideEffect | ~m1736_4 |
8086-
| ir.cpp:1736:7:1736:7 | SideEffect | ~m1736_13 |
8091+
| ir.cpp:1736:7:1736:7 | SideEffect | ~m1736_18 |
80878092
| ir.cpp:1736:7:1736:7 | Unary | m1736_6 |
8093+
| ir.cpp:1736:7:1736:7 | Unary | r1736_12 |
8094+
| ir.cpp:1736:7:1736:7 | Unary | r1736_13 |
8095+
| ir.cpp:1736:7:1736:7 | Unary | r1736_14 |
80888096
| ir.cpp:1740:5:1740:38 | Address | &:r1740_5 |
80898097
| ir.cpp:1740:5:1740:38 | Address | &:r1740_5 |
80908098
| ir.cpp:1740:5:1740:38 | Address | &:r1740_7 |
@@ -8117,19 +8125,27 @@
81178125
| ir.cpp:1743:7:1743:7 | Address | &:r1743_7 |
81188126
| ir.cpp:1743:7:1743:7 | Address | &:r1743_7 |
81198127
| ir.cpp:1743:7:1743:7 | Address | &:r1743_9 |
8128+
| ir.cpp:1743:7:1743:7 | Address | &:r1743_11 |
8129+
| ir.cpp:1743:7:1743:7 | Address | &:r1743_15 |
8130+
| ir.cpp:1743:7:1743:7 | Arg(0) | 0:r1743_15 |
81208131
| ir.cpp:1743:7:1743:7 | Arg(this) | this:r1743_9 |
81218132
| ir.cpp:1743:7:1743:7 | CallTarget | func:r1743_10 |
81228133
| ir.cpp:1743:7:1743:7 | ChiPartial | partial:m1743_3 |
8123-
| ir.cpp:1743:7:1743:7 | ChiPartial | partial:m1743_12 |
8124-
| ir.cpp:1743:7:1743:7 | ChiPartial | partial:m1743_14 |
8134+
| ir.cpp:1743:7:1743:7 | ChiPartial | partial:m1743_17 |
8135+
| ir.cpp:1743:7:1743:7 | ChiPartial | partial:m1743_20 |
81258136
| ir.cpp:1743:7:1743:7 | ChiTotal | total:m1743_2 |
81268137
| ir.cpp:1743:7:1743:7 | ChiTotal | total:m1743_4 |
8127-
| ir.cpp:1743:7:1743:7 | ChiTotal | total:m1743_13 |
8138+
| ir.cpp:1743:7:1743:7 | ChiTotal | total:m1743_18 |
8139+
| ir.cpp:1743:7:1743:7 | Load | m0_2 |
81288140
| ir.cpp:1743:7:1743:7 | Load | m1743_6 |
81298141
| ir.cpp:1743:7:1743:7 | SideEffect | m1743_8 |
8142+
| ir.cpp:1743:7:1743:7 | SideEffect | ~m0_4 |
81308143
| ir.cpp:1743:7:1743:7 | SideEffect | ~m1743_4 |
8131-
| ir.cpp:1743:7:1743:7 | SideEffect | ~m1743_15 |
8144+
| ir.cpp:1743:7:1743:7 | SideEffect | ~m1743_21 |
81328145
| ir.cpp:1743:7:1743:7 | Unary | m1743_6 |
8146+
| ir.cpp:1743:7:1743:7 | Unary | r1743_12 |
8147+
| ir.cpp:1743:7:1743:7 | Unary | r1743_13 |
8148+
| ir.cpp:1743:7:1743:7 | Unary | r1743_14 |
81338149
| ir.cpp:1747:5:1747:35 | Address | &:r1747_5 |
81348150
| ir.cpp:1747:5:1747:35 | Address | &:r1747_5 |
81358151
| ir.cpp:1747:5:1747:35 | Address | &:r1747_7 |

0 commit comments

Comments
 (0)