Skip to content

Commit 175ba7b

Browse files
committed
Fix up .expected on the IR side.
1 parent 2637c22 commit 175ba7b

File tree

1 file changed

+195
-12
lines changed

1 file changed

+195
-12
lines changed

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

Lines changed: 195 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,28 @@
1212
#-----| Type = [VoidPointerType]: void *
1313
#-----| 1: [Parameter]: p#1
1414
#-----| Type = [LongType]: unsigned long
15+
#-----| [TopLevelFunction]: void operator delete(void*, unsigned long, std::align_val_t)
16+
#-----| params:
17+
#-----| 0: [Parameter]: p#0
18+
#-----| Type = [VoidPointerType]: void *
19+
#-----| 1: [Parameter]: p#1
20+
#-----| Type = [LongType]: unsigned long
21+
#-----| 2: [Parameter]: p#2
22+
#-----| Type = [ScopedEnum]: align_val_t
1523
#-----| [TopLevelFunction]: void operator delete[](void*, unsigned long)
1624
#-----| params:
1725
#-----| 0: [Parameter]: p#0
1826
#-----| Type = [VoidPointerType]: void *
1927
#-----| 1: [Parameter]: p#1
2028
#-----| Type = [LongType]: unsigned long
29+
#-----| [TopLevelFunction]: void operator delete[](void*, unsigned long, std::align_val_t)
30+
#-----| params:
31+
#-----| 0: [Parameter]: p#0
32+
#-----| Type = [VoidPointerType]: void *
33+
#-----| 1: [Parameter]: p#1
34+
#-----| Type = [LongType]: unsigned long
35+
#-----| 2: [Parameter]: p#2
36+
#-----| Type = [ScopedEnum]: align_val_t
2137
#-----| [TopLevelFunction]: void* operator new(unsigned long)
2238
#-----| params:
2339
#-----| 0: [Parameter]: p#0
@@ -174,6 +190,17 @@ bad_asts.cpp:
174190
# 27| Type = [LValueReferenceType]: const Point &
175191
# 27| ValueCategory = prvalue(load)
176192
# 28| 1: [ReturnStmt]: return ...
193+
clang.cpp:
194+
# 5| [TopLevelFunction]: int* globalIntAddress()
195+
# 5| params:
196+
# 5| body: [Block]: { ... }
197+
# 6| 0: [ReturnStmt]: return ...
198+
# 6| 0: [???]: __builtin_addressof ...
199+
# 6| Type = [IntPointerType]: int *
200+
# 6| ValueCategory = prvalue
201+
# 6| 0: [VariableAccess]: globalInt
202+
# 6| Type = [IntType]: int
203+
# 6| ValueCategory = lvalue
177204
ir.cpp:
178205
# 1| [TopLevelFunction]: void Constants()
179206
# 1| params:
@@ -4386,7 +4413,7 @@ ir.cpp:
43864413
# 705| 2: [VariableAccess]: y
43874414
# 705| Type = [TemplateParameter]: T
43884415
# 705| ValueCategory = lvalue
4389-
# 704| [FunctionTemplateSpecialization]: int min<int>(int, int)
4416+
# 704| [FunctionTemplateInstantiation]: int min<int>(int, int)
43904417
# 704| params:
43914418
# 704| 0: [Parameter]: x
43924419
# 704| Type = [IntType]: int
@@ -4458,7 +4485,7 @@ ir.cpp:
44584485
# 715| Type = [TemplateParameter]: U
44594486
# 715| 1: [Parameter]: y
44604487
# 715| Type = [TemplateParameter]: V
4461-
# 715| [FunctionTemplateSpecialization]: long Outer<long>::Func<void*, char>(void*, char)
4488+
# 715| [FunctionTemplateInstantiation]: long Outer<long>::Func<void*, char>(void*, char)
44624489
# 715| params:
44634490
# 715| 0: [Parameter]: x
44644491
# 715| Type = [VoidPointerType]: void *
@@ -6647,6 +6674,162 @@ ir.cpp:
66476674
# 1002| 0: [StmtExpr]: (statement expression)
66486675
# 1002| Type = [IntType]: int
66496676
# 1002| ValueCategory = prvalue
6677+
# 1006| [TopLevelFunction]: void OperatorDelete()
6678+
# 1006| params:
6679+
# 1006| body: [Block]: { ... }
6680+
# 1007| 0: [ExprStmt]: ExprStmt
6681+
# 1007| 0: [DeleteExpr]: delete
6682+
# 1007| Type = [VoidType]: void
6683+
# 1007| ValueCategory = prvalue
6684+
# 1007| 3: [PointerConversion]: static_cast<int *>...
6685+
# 1007| Conversion = pointer conversion
6686+
# 1007| Type = [IntPointerType]: int *
6687+
# 1007| Value = [PointerConversion]: 0
6688+
# 1007| ValueCategory = prvalue
6689+
# 1007| expr: [Zero]: 0
6690+
# 1007| Type = [NullPointerType]: decltype(nullptr)
6691+
# 1007| Value = [Zero]: 0
6692+
# 1007| ValueCategory = prvalue
6693+
# 1008| 1: [ExprStmt]: ExprStmt
6694+
# 1008| 0: [DeleteExpr]: delete
6695+
# 1008| Type = [VoidType]: void
6696+
# 1008| ValueCategory = prvalue
6697+
# 1008| 1: [DestructorCall]: call to ~String
6698+
# 1008| Type = [VoidType]: void
6699+
# 1008| ValueCategory = prvalue
6700+
# 1008| -1: [PointerConversion]: static_cast<String *>...
6701+
# 1008| Conversion = pointer conversion
6702+
# 1008| Type = [PointerType]: String *
6703+
# 1008| Value = [PointerConversion]: 0
6704+
# 1008| ValueCategory = prvalue
6705+
# 1008| expr: [Zero]: 0
6706+
# 1008| Type = [NullPointerType]: decltype(nullptr)
6707+
# 1008| Value = [Zero]: 0
6708+
# 1008| ValueCategory = prvalue
6709+
# 1009| 2: [ExprStmt]: ExprStmt
6710+
# 1009| 0: [DeleteExpr]: delete
6711+
# 1009| Type = [VoidType]: void
6712+
# 1009| ValueCategory = prvalue
6713+
# 1009| 0: [FunctionCall]: call to operator delete
6714+
# 1009| Type = [VoidType]: void
6715+
# 1009| ValueCategory = prvalue
6716+
# 1009| 3: [PointerConversion]: static_cast<SizedDealloc *>...
6717+
# 1009| Conversion = pointer conversion
6718+
# 1009| Type = [PointerType]: SizedDealloc *
6719+
# 1009| Value = [PointerConversion]: 0
6720+
# 1009| ValueCategory = prvalue
6721+
# 1009| expr: [Zero]: 0
6722+
# 1009| Type = [NullPointerType]: decltype(nullptr)
6723+
# 1009| Value = [Zero]: 0
6724+
# 1009| ValueCategory = prvalue
6725+
# 1010| 3: [ExprStmt]: ExprStmt
6726+
# 1010| 0: [DeleteExpr]: delete
6727+
# 1010| Type = [VoidType]: void
6728+
# 1010| ValueCategory = prvalue
6729+
# 1010| 3: [PointerConversion]: static_cast<Overaligned *>...
6730+
# 1010| Conversion = pointer conversion
6731+
# 1010| Type = [PointerType]: Overaligned *
6732+
# 1010| Value = [PointerConversion]: 0
6733+
# 1010| ValueCategory = prvalue
6734+
# 1010| expr: [Zero]: 0
6735+
# 1010| Type = [NullPointerType]: decltype(nullptr)
6736+
# 1010| Value = [Zero]: 0
6737+
# 1010| ValueCategory = prvalue
6738+
# 1011| 4: [ExprStmt]: ExprStmt
6739+
# 1011| 0: [DeleteExpr]: delete
6740+
# 1011| Type = [VoidType]: void
6741+
# 1011| ValueCategory = prvalue
6742+
# 1011| 1: [DestructorCall]: call to ~PolymorphicBase
6743+
# 1011| Type = [VoidType]: void
6744+
# 1011| ValueCategory = prvalue
6745+
# 1011| -1: [PointerConversion]: static_cast<PolymorphicBase *>...
6746+
# 1011| Conversion = pointer conversion
6747+
# 1011| Type = [PointerType]: PolymorphicBase *
6748+
# 1011| Value = [PointerConversion]: 0
6749+
# 1011| ValueCategory = prvalue
6750+
# 1011| expr: [Zero]: 0
6751+
# 1011| Type = [NullPointerType]: decltype(nullptr)
6752+
# 1011| Value = [Zero]: 0
6753+
# 1011| ValueCategory = prvalue
6754+
# 1012| 5: [ReturnStmt]: return ...
6755+
# 1015| [TopLevelFunction]: void OperatorDeleteArray()
6756+
# 1015| params:
6757+
# 1015| body: [Block]: { ... }
6758+
# 1016| 0: [ExprStmt]: ExprStmt
6759+
# 1016| 0: [DeleteArrayExpr]: delete[]
6760+
# 1016| Type = [VoidType]: void
6761+
# 1016| ValueCategory = prvalue
6762+
# 1016| 3: [PointerConversion]: static_cast<int *>...
6763+
# 1016| Conversion = pointer conversion
6764+
# 1016| Type = [IntPointerType]: int *
6765+
# 1016| Value = [PointerConversion]: 0
6766+
# 1016| ValueCategory = prvalue
6767+
# 1016| expr: [Zero]: 0
6768+
# 1016| Type = [NullPointerType]: decltype(nullptr)
6769+
# 1016| Value = [Zero]: 0
6770+
# 1016| ValueCategory = prvalue
6771+
# 1017| 1: [ExprStmt]: ExprStmt
6772+
# 1017| 0: [DeleteArrayExpr]: delete[]
6773+
# 1017| Type = [VoidType]: void
6774+
# 1017| ValueCategory = prvalue
6775+
# 1017| 1: [DestructorCall]: call to ~String
6776+
# 1017| Type = [VoidType]: void
6777+
# 1017| ValueCategory = prvalue
6778+
# 1017| -1: [PointerConversion]: static_cast<String *>...
6779+
# 1017| Conversion = pointer conversion
6780+
# 1017| Type = [PointerType]: String *
6781+
# 1017| Value = [PointerConversion]: 0
6782+
# 1017| ValueCategory = prvalue
6783+
# 1017| expr: [Zero]: 0
6784+
# 1017| Type = [NullPointerType]: decltype(nullptr)
6785+
# 1017| Value = [Zero]: 0
6786+
# 1017| ValueCategory = prvalue
6787+
# 1018| 2: [ExprStmt]: ExprStmt
6788+
# 1018| 0: [DeleteArrayExpr]: delete[]
6789+
# 1018| Type = [VoidType]: void
6790+
# 1018| ValueCategory = prvalue
6791+
# 1018| 0: [FunctionCall]: call to operator delete[]
6792+
# 1018| Type = [VoidType]: void
6793+
# 1018| ValueCategory = prvalue
6794+
# 1018| 3: [PointerConversion]: static_cast<SizedDealloc *>...
6795+
# 1018| Conversion = pointer conversion
6796+
# 1018| Type = [PointerType]: SizedDealloc *
6797+
# 1018| Value = [PointerConversion]: 0
6798+
# 1018| ValueCategory = prvalue
6799+
# 1018| expr: [Zero]: 0
6800+
# 1018| Type = [NullPointerType]: decltype(nullptr)
6801+
# 1018| Value = [Zero]: 0
6802+
# 1018| ValueCategory = prvalue
6803+
# 1019| 3: [ExprStmt]: ExprStmt
6804+
# 1019| 0: [DeleteArrayExpr]: delete[]
6805+
# 1019| Type = [VoidType]: void
6806+
# 1019| ValueCategory = prvalue
6807+
# 1019| 3: [PointerConversion]: static_cast<Overaligned *>...
6808+
# 1019| Conversion = pointer conversion
6809+
# 1019| Type = [PointerType]: Overaligned *
6810+
# 1019| Value = [PointerConversion]: 0
6811+
# 1019| ValueCategory = prvalue
6812+
# 1019| expr: [Zero]: 0
6813+
# 1019| Type = [NullPointerType]: decltype(nullptr)
6814+
# 1019| Value = [Zero]: 0
6815+
# 1019| ValueCategory = prvalue
6816+
# 1020| 4: [ExprStmt]: ExprStmt
6817+
# 1020| 0: [DeleteArrayExpr]: delete[]
6818+
# 1020| Type = [VoidType]: void
6819+
# 1020| ValueCategory = prvalue
6820+
# 1020| 1: [DestructorCall]: call to ~PolymorphicBase
6821+
# 1020| Type = [VoidType]: void
6822+
# 1020| ValueCategory = prvalue
6823+
# 1020| -1: [PointerConversion]: static_cast<PolymorphicBase *>...
6824+
# 1020| Conversion = pointer conversion
6825+
# 1020| Type = [PointerType]: PolymorphicBase *
6826+
# 1020| Value = [PointerConversion]: 0
6827+
# 1020| ValueCategory = prvalue
6828+
# 1020| expr: [Zero]: 0
6829+
# 1020| Type = [NullPointerType]: decltype(nullptr)
6830+
# 1020| Value = [Zero]: 0
6831+
# 1020| ValueCategory = prvalue
6832+
# 1021| 5: [ReturnStmt]: return ...
66506833
# 1023| [CopyAssignmentOperator]: EmptyStruct& EmptyStruct::operator=(EmptyStruct const&)
66516834
# 1023| params:
66526835
#-----| 0: [Parameter]: p#0
@@ -7454,11 +7637,11 @@ ir.cpp:
74547637
# 1056| [ConstMemberFunction]: bool vector<T>::iterator::operator!=(vector<T>::iterator) const
74557638
# 1056| params:
74567639
# 1056| 0: [Parameter]: right
7457-
# 1056| Type = [Class]: iterator
7640+
# 1056| Type = [NestedClass]: iterator
74587641
# 1056| [ConstMemberFunction]: bool vector<int>::iterator::operator!=(vector<int>::iterator) const
74597642
# 1056| params:
74607643
# 1056| 0: [Parameter]: right
7461-
# 1056| Type = [Struct]: iterator
7644+
# 1056| Type = [NestedStruct]: iterator
74627645
# 1059| [ConstMemberFunction]: vector<T>::iterator vector<T>::begin() const
74637646
# 1059| params:
74647647
# 1059| [ConstMemberFunction]: vector<int>::iterator vector<int>::begin() const
@@ -7495,19 +7678,19 @@ ir.cpp:
74957678
#-----| Type = [SpecifiedType]: const iterator
74967679
#-----| ValueCategory = lvalue
74977680
#-----| expr: [VariableAccess]: (__begin)
7498-
#-----| Type = [Struct]: iterator
7681+
#-----| Type = [NestedStruct]: iterator
74997682
#-----| ValueCategory = lvalue
75007683
#-----| 0: [VariableAccess]: (__end)
7501-
#-----| Type = [Struct]: iterator
7684+
#-----| Type = [NestedStruct]: iterator
75027685
#-----| ValueCategory = prvalue(load)
75037686
# 1069| 3: [ReferenceDereferenceExpr]: (reference dereference)
7504-
# 1069| Type = [Struct]: iterator
7687+
# 1069| Type = [NestedStruct]: iterator
75057688
# 1069| ValueCategory = lvalue
75067689
# 1069| expr: [FunctionCall]: call to operator++
75077690
# 1069| Type = [LValueReferenceType]: iterator &
75087691
# 1069| ValueCategory = prvalue
75097692
#-----| -1: [VariableAccess]: (__begin)
7510-
#-----| Type = [Struct]: iterator
7693+
#-----| Type = [NestedStruct]: iterator
75117694
#-----| ValueCategory = lvalue
75127695
# 1069| 4: [DeclStmt]: declaration
75137696
# 1069| 5: [Block]: { ... }
@@ -7536,19 +7719,19 @@ ir.cpp:
75367719
#-----| Type = [SpecifiedType]: const iterator
75377720
#-----| ValueCategory = lvalue
75387721
#-----| expr: [VariableAccess]: (__begin)
7539-
#-----| Type = [Struct]: iterator
7722+
#-----| Type = [NestedStruct]: iterator
75407723
#-----| ValueCategory = lvalue
75417724
#-----| 0: [VariableAccess]: (__end)
7542-
#-----| Type = [Struct]: iterator
7725+
#-----| Type = [NestedStruct]: iterator
75437726
#-----| ValueCategory = prvalue(load)
75447727
# 1075| 3: [ReferenceDereferenceExpr]: (reference dereference)
7545-
# 1075| Type = [Struct]: iterator
7728+
# 1075| Type = [NestedStruct]: iterator
75467729
# 1075| ValueCategory = lvalue
75477730
# 1075| expr: [FunctionCall]: call to operator++
75487731
# 1075| Type = [LValueReferenceType]: iterator &
75497732
# 1075| ValueCategory = prvalue
75507733
#-----| -1: [VariableAccess]: (__begin)
7551-
#-----| Type = [Struct]: iterator
7734+
#-----| Type = [NestedStruct]: iterator
75527735
#-----| ValueCategory = lvalue
75537736
# 1075| 4: [DeclStmt]: declaration
75547737
# 1075| 5: [Block]: { ... }

0 commit comments

Comments
 (0)