Skip to content

Commit a84a921

Browse files
authored
Merge pull request #1241 from nickrolfe/category_changes
C++: change expected test output following extractor frontend upgrade
2 parents ccbb7ce + baf0912 commit a84a921

File tree

4 files changed

+279
-235
lines changed

4 files changed

+279
-235
lines changed

cpp/ql/test/library-tests/conversions/conversions.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
| conversions.cpp:179:36:179:37 | (..:: *)... | pointer-to-member derived class conversion | prval | ..:: * | ..:: * |
123123
| conversions.cpp:180:10:180:47 | static_cast<..:: *>... | pointer-to-member derived class conversion | prval | ..:: * | ..:: * |
124124
| conversions.cpp:180:43:180:46 | (..:: *)... | pointer-to-member derived class conversion | prval | ..:: * | ..:: * |
125-
| conversions.cpp:190:22:190:29 | (const String)... | prvalue adjustment conversion | prval | const String | void |
125+
| conversions.cpp:190:22:190:29 | (const String)... | glvalue conversion | lval | const String | String |
126126
| conversions.cpp:193:20:193:31 | (const Base)... | glvalue conversion | lval | const Base | Base |
127127
| conversions.cpp:193:31:193:31 | (Base)... | base class conversion | lval | Base | Middle |
128128
| conversions.cpp:193:31:193:31 | (Middle)... | base class conversion | lval | Middle | Derived |

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

Lines changed: 115 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -5119,22 +5119,28 @@ ir.cpp:
51195119
# 809| Type = const Base &
51205120
# 809| ValueCategory = prvalue
51215121
# 809| expr: (const Base)...
5122-
# 809| Conversion = prvalue adjustment conversion
5122+
# 809| Conversion = glvalue conversion
51235123
# 809| Type = const Base
5124-
# 809| ValueCategory = prvalue
5125-
# 809| expr: call to Base
5126-
# 809| Type = void
5127-
# 809| ValueCategory = prvalue
5128-
# 809| 0: (reference to)
5129-
# 809| Type = const Base &
5124+
# 809| ValueCategory = lvalue
5125+
# 809| expr: (reference dereference)
5126+
# 809| Type = Base
5127+
# 809| ValueCategory = lvalue
5128+
# 809| expr: (reference to)
5129+
# 809| Type = Base &
51305130
# 809| ValueCategory = prvalue
5131-
# 809| expr: (const Base)...
5132-
# 809| Conversion = base class conversion
5133-
# 809| Type = const Base
5134-
# 809| ValueCategory = lvalue
5135-
# 809| expr: m
5136-
# 809| Type = Middle
5137-
# 809| ValueCategory = lvalue
5131+
# 809| expr: call to Base
5132+
# 809| Type = void
5133+
# 809| ValueCategory = prvalue
5134+
# 809| 0: (reference to)
5135+
# 809| Type = const Base &
5136+
# 809| ValueCategory = prvalue
5137+
# 809| expr: (const Base)...
5138+
# 809| Conversion = base class conversion
5139+
# 809| Type = const Base
5140+
# 809| ValueCategory = lvalue
5141+
# 809| expr: m
5142+
# 809| Type = Middle
5143+
# 809| ValueCategory = lvalue
51385144
# 810| 8: ExprStmt
51395145
# 810| 0: (reference dereference)
51405146
# 810| Type = Base
@@ -5149,22 +5155,28 @@ ir.cpp:
51495155
# 810| Type = const Base &
51505156
# 810| ValueCategory = prvalue
51515157
# 810| expr: (const Base)...
5152-
# 810| Conversion = prvalue adjustment conversion
5158+
# 810| Conversion = glvalue conversion
51535159
# 810| Type = const Base
5154-
# 810| ValueCategory = prvalue
5155-
# 810| expr: call to Base
5156-
# 810| Type = void
5157-
# 810| ValueCategory = prvalue
5158-
# 810| 0: (reference to)
5159-
# 810| Type = const Base &
5160+
# 810| ValueCategory = lvalue
5161+
# 810| expr: (reference dereference)
5162+
# 810| Type = Base
5163+
# 810| ValueCategory = lvalue
5164+
# 810| expr: (reference to)
5165+
# 810| Type = Base &
51605166
# 810| ValueCategory = prvalue
5161-
# 810| expr: (const Base)...
5162-
# 810| Conversion = base class conversion
5163-
# 810| Type = const Base
5164-
# 810| ValueCategory = lvalue
5165-
# 810| expr: m
5166-
# 810| Type = Middle
5167-
# 810| ValueCategory = lvalue
5167+
# 810| expr: call to Base
5168+
# 810| Type = void
5169+
# 810| ValueCategory = prvalue
5170+
# 810| 0: (reference to)
5171+
# 810| Type = const Base &
5172+
# 810| ValueCategory = prvalue
5173+
# 810| expr: (const Base)...
5174+
# 810| Conversion = base class conversion
5175+
# 810| Type = const Base
5176+
# 810| ValueCategory = lvalue
5177+
# 810| expr: m
5178+
# 810| Type = Middle
5179+
# 810| ValueCategory = lvalue
51685180
# 811| 9: ExprStmt
51695181
# 811| 0: ... = ...
51705182
# 811| Type = Base *
@@ -5349,26 +5361,32 @@ ir.cpp:
53495361
# 823| Type = const Base &
53505362
# 823| ValueCategory = prvalue
53515363
# 823| expr: (const Base)...
5352-
# 823| Conversion = prvalue adjustment conversion
5364+
# 823| Conversion = glvalue conversion
53535365
# 823| Type = const Base
5354-
# 823| ValueCategory = prvalue
5355-
# 823| expr: call to Base
5356-
# 823| Type = void
5357-
# 823| ValueCategory = prvalue
5358-
# 823| 0: (reference to)
5359-
# 823| Type = const Base &
5366+
# 823| ValueCategory = lvalue
5367+
# 823| expr: (reference dereference)
5368+
# 823| Type = Base
5369+
# 823| ValueCategory = lvalue
5370+
# 823| expr: (reference to)
5371+
# 823| Type = Base &
53605372
# 823| ValueCategory = prvalue
5361-
# 823| expr: (const Base)...
5362-
# 823| Conversion = base class conversion
5363-
# 823| Type = const Base
5364-
# 823| ValueCategory = lvalue
5365-
# 823| expr: (const Middle)...
5366-
# 823| Conversion = base class conversion
5367-
# 823| Type = const Middle
5368-
# 823| ValueCategory = lvalue
5369-
# 823| expr: d
5370-
# 823| Type = Derived
5373+
# 823| expr: call to Base
5374+
# 823| Type = void
5375+
# 823| ValueCategory = prvalue
5376+
# 823| 0: (reference to)
5377+
# 823| Type = const Base &
5378+
# 823| ValueCategory = prvalue
5379+
# 823| expr: (const Base)...
5380+
# 823| Conversion = base class conversion
5381+
# 823| Type = const Base
53715382
# 823| ValueCategory = lvalue
5383+
# 823| expr: (const Middle)...
5384+
# 823| Conversion = base class conversion
5385+
# 823| Type = const Middle
5386+
# 823| ValueCategory = lvalue
5387+
# 823| expr: d
5388+
# 823| Type = Derived
5389+
# 823| ValueCategory = lvalue
53725390
# 824| 20: ExprStmt
53735391
# 824| 0: (reference dereference)
53745392
# 824| Type = Base
@@ -5383,26 +5401,32 @@ ir.cpp:
53835401
# 824| Type = const Base &
53845402
# 824| ValueCategory = prvalue
53855403
# 824| expr: (const Base)...
5386-
# 824| Conversion = prvalue adjustment conversion
5404+
# 824| Conversion = glvalue conversion
53875405
# 824| Type = const Base
5388-
# 824| ValueCategory = prvalue
5389-
# 824| expr: call to Base
5390-
# 824| Type = void
5391-
# 824| ValueCategory = prvalue
5392-
# 824| 0: (reference to)
5393-
# 824| Type = const Base &
5406+
# 824| ValueCategory = lvalue
5407+
# 824| expr: (reference dereference)
5408+
# 824| Type = Base
5409+
# 824| ValueCategory = lvalue
5410+
# 824| expr: (reference to)
5411+
# 824| Type = Base &
53945412
# 824| ValueCategory = prvalue
5395-
# 824| expr: (const Base)...
5396-
# 824| Conversion = base class conversion
5397-
# 824| Type = const Base
5398-
# 824| ValueCategory = lvalue
5399-
# 824| expr: (const Middle)...
5400-
# 824| Conversion = base class conversion
5401-
# 824| Type = const Middle
5402-
# 824| ValueCategory = lvalue
5403-
# 824| expr: d
5404-
# 824| Type = Derived
5413+
# 824| expr: call to Base
5414+
# 824| Type = void
5415+
# 824| ValueCategory = prvalue
5416+
# 824| 0: (reference to)
5417+
# 824| Type = const Base &
5418+
# 824| ValueCategory = prvalue
5419+
# 824| expr: (const Base)...
5420+
# 824| Conversion = base class conversion
5421+
# 824| Type = const Base
54055422
# 824| ValueCategory = lvalue
5423+
# 824| expr: (const Middle)...
5424+
# 824| Conversion = base class conversion
5425+
# 824| Type = const Middle
5426+
# 824| ValueCategory = lvalue
5427+
# 824| expr: d
5428+
# 824| Type = Derived
5429+
# 824| ValueCategory = lvalue
54065430
# 825| 21: ExprStmt
54075431
# 825| 0: ... = ...
54085432
# 825| Type = Base *
@@ -6786,18 +6810,24 @@ ir.cpp:
67866810
# 1036| 0: (reference to)
67876811
# 1036| Type = lambda [] type at line 1036, col. 21 &
67886812
# 1036| ValueCategory = prvalue
6789-
# 1036| expr: [...](...){...}
6813+
# 1036| expr: (reference dereference)
67906814
# 1036| Type = decltype([...](...){...})
6791-
# 1036| ValueCategory = prvalue
6792-
# 1036| 0: {...}
6793-
# 1036| Type = decltype([...](...){...})
6815+
# 1036| ValueCategory = xvalue
6816+
# 1036| expr: (reference to)
6817+
# 1036| Type = lambda [] type at line 1036, col. 21 &
67946818
# 1036| ValueCategory = prvalue
6795-
#-----| .s: call to String
6796-
#-----| Type = void
6797-
#-----| ValueCategory = prvalue
6798-
#-----| .x: x
6799-
#-----| Type = int
6800-
#-----| ValueCategory = prvalue(load)
6819+
# 1036| expr: [...](...){...}
6820+
# 1036| Type = decltype([...](...){...})
6821+
# 1036| ValueCategory = xvalue
6822+
# 1036| 0: {...}
6823+
# 1036| Type = decltype([...](...){...})
6824+
# 1036| ValueCategory = prvalue
6825+
#-----| .s: call to String
6826+
#-----| Type = void
6827+
#-----| ValueCategory = prvalue
6828+
#-----| .x: x
6829+
#-----| Type = int
6830+
#-----| ValueCategory = prvalue(load)
68016831
# 1037| 5: ExprStmt
68026832
# 1037| 0: call to operator()
68036833
# 1037| Type = char
@@ -6867,15 +6897,21 @@ ir.cpp:
68676897
# 1040| 0: (reference to)
68686898
# 1040| Type = lambda [] type at line 1040, col. 30 &
68696899
# 1040| ValueCategory = prvalue
6870-
# 1040| expr: [...](...){...}
6900+
# 1040| expr: (reference dereference)
68716901
# 1040| Type = decltype([...](...){...})
6872-
# 1040| ValueCategory = prvalue
6873-
# 1040| 0: {...}
6874-
# 1040| Type = decltype([...](...){...})
6902+
# 1040| ValueCategory = xvalue
6903+
# 1040| expr: (reference to)
6904+
# 1040| Type = lambda [] type at line 1040, col. 30 &
68756905
# 1040| ValueCategory = prvalue
6876-
#-----| .s: call to String
6877-
#-----| Type = void
6878-
#-----| ValueCategory = prvalue
6906+
# 1040| expr: [...](...){...}
6907+
# 1040| Type = decltype([...](...){...})
6908+
# 1040| ValueCategory = xvalue
6909+
# 1040| 0: {...}
6910+
# 1040| Type = decltype([...](...){...})
6911+
# 1040| ValueCategory = prvalue
6912+
#-----| .s: call to String
6913+
#-----| Type = void
6914+
#-----| ValueCategory = prvalue
68796915
# 1041| 9: ExprStmt
68806916
# 1041| 0: call to operator()
68816917
# 1041| Type = char

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3568,7 +3568,7 @@ ir.cpp:
35683568
# 809| r0_34(glval<Base>) = ConvertToBase[Middle : Base] : r0_33
35693569
# 809| v0_35(void) = Call : r0_32, r0_34
35703570
# 809| mu0_36(unknown) = ^CallSideEffect : mu0_2
3571-
# 809| r0_37(Base) = Convert : v0_35
3571+
# 809| r0_37(glval<Base>) = Convert : v0_35
35723572
# 809| r0_38(Base &) = Call : r0_31, this:r0_30, r0_37
35733573
# 809| mu0_39(unknown) = ^CallSideEffect : mu0_2
35743574
# 810| r0_40(glval<Base>) = VariableAddress[b] :
@@ -3578,7 +3578,7 @@ ir.cpp:
35783578
# 810| r0_44(glval<Base>) = ConvertToBase[Middle : Base] : r0_43
35793579
# 810| v0_45(void) = Call : r0_42, r0_44
35803580
# 810| mu0_46(unknown) = ^CallSideEffect : mu0_2
3581-
# 810| r0_47(Base) = Convert : v0_45
3581+
# 810| r0_47(glval<Base>) = Convert : v0_45
35823582
# 810| r0_48(Base &) = Call : r0_41, this:r0_40, r0_47
35833583
# 810| mu0_49(unknown) = ^CallSideEffect : mu0_2
35843584
# 811| r0_50(glval<Middle *>) = VariableAddress[pm] :
@@ -3645,7 +3645,7 @@ ir.cpp:
36453645
# 823| r0_111(glval<Base>) = ConvertToBase[Middle : Base] : r0_110
36463646
# 823| v0_112(void) = Call : r0_108, r0_111
36473647
# 823| mu0_113(unknown) = ^CallSideEffect : mu0_2
3648-
# 823| r0_114(Base) = Convert : v0_112
3648+
# 823| r0_114(glval<Base>) = Convert : v0_112
36493649
# 823| r0_115(Base &) = Call : r0_107, this:r0_106, r0_114
36503650
# 823| mu0_116(unknown) = ^CallSideEffect : mu0_2
36513651
# 824| r0_117(glval<Base>) = VariableAddress[b] :
@@ -3656,7 +3656,7 @@ ir.cpp:
36563656
# 824| r0_122(glval<Base>) = ConvertToBase[Middle : Base] : r0_121
36573657
# 824| v0_123(void) = Call : r0_119, r0_122
36583658
# 824| mu0_124(unknown) = ^CallSideEffect : mu0_2
3659-
# 824| r0_125(Base) = Convert : v0_123
3659+
# 824| r0_125(glval<Base>) = Convert : v0_123
36603660
# 824| r0_126(Base &) = Call : r0_118, this:r0_117, r0_125
36613661
# 824| mu0_127(unknown) = ^CallSideEffect : mu0_2
36623662
# 825| r0_128(glval<Derived *>) = VariableAddress[pd] :

0 commit comments

Comments
 (0)