Skip to content

Commit 8e00516

Browse files
committed
C++: Accept changes in ir test
1 parent f5598db commit 8e00516

File tree

4 files changed

+348
-534
lines changed

4 files changed

+348
-534
lines changed

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

Lines changed: 18 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,7 +3732,7 @@ ir.cpp:
37323732
# 572| Type = [ArrayType] char[32]
37333733
# 572| init: [Initializer] initializer for a_pad
37343734
# 572| expr:
3735-
# 572| Type = [ArrayType] const char[1]
3735+
# 572| Type = [ArrayType] const char[32]
37363736
# 572| Value = [StringLiteral] ""
37373737
# 572| ValueCategory = lvalue
37383738
# 573| 1: [DeclStmt] declaration
@@ -6894,9 +6894,6 @@ ir.cpp:
68946894
# 1029| params:
68956895
#-----| 0: [Parameter] p#0
68966896
#-----| Type = [RValueReferenceType] lambda [] type at line 1029, col. 12 &&
6897-
# 1029| initializations:
6898-
# 1029| body: [Block] { ... }
6899-
# 1029| 0: [ReturnStmt] return ...
69006897
# 1029| [Constructor] void (lambda [] type at line 1029, col. 12)::(constructor)()
69016898
# 1029| params:
69026899
# 1029| [MemberFunction] void (lambda [] type at line 1029, col. 12)::_FUN()
@@ -6996,24 +6993,18 @@ ir.cpp:
69966993
# 1036| 0: [VariableDeclarationEntry] definition of lambda_val
69976994
# 1036| Type = [Closure,LocalClass] decltype([...](...){...})
69986995
# 1036| init: [Initializer] initializer for lambda_val
6999-
# 1036| expr: [ConstructorCall] call to (constructor)
7000-
# 1036| Type = [VoidType] void
6996+
# 1036| expr: [LambdaExpression] [...](...){...}
6997+
# 1036| Type = [Closure,LocalClass] decltype([...](...){...})
70016998
# 1036| ValueCategory = prvalue
7002-
# 1036| 0: [ReferenceToExpr] (reference to)
7003-
# 1036| Type = [LValueReferenceType] lambda [] type at line 1036, col. 21 &
6999+
# 1036| 0: [ClassAggregateLiteral] {...}
7000+
# 1036| Type = [Closure,LocalClass] decltype([...](...){...})
70047001
# 1036| ValueCategory = prvalue
7005-
# 1036| expr: [LambdaExpression] [...](...){...}
7006-
# 1036| Type = [Closure,LocalClass] decltype([...](...){...})
7007-
# 1036| ValueCategory = xvalue
7008-
# 1036| 0: [ClassAggregateLiteral] {...}
7009-
# 1036| Type = [Closure,LocalClass] decltype([...](...){...})
7010-
# 1036| ValueCategory = prvalue
7011-
#-----| .s: [ConstructorCall] call to String
7012-
#-----| Type = [VoidType] void
7013-
#-----| ValueCategory = prvalue
7014-
#-----| .x: [VariableAccess] x
7015-
#-----| Type = [IntType] int
7016-
#-----| ValueCategory = prvalue(load)
7002+
#-----| .s: [ConstructorCall] call to String
7003+
#-----| Type = [VoidType] void
7004+
#-----| ValueCategory = prvalue
7005+
#-----| .x: [VariableAccess] x
7006+
#-----| Type = [IntType] int
7007+
#-----| ValueCategory = prvalue(load)
70177008
# 1037| 5: [ExprStmt] ExprStmt
70187009
# 1037| 0: [FunctionCall] call to operator()
70197010
# 1037| Type = [PlainCharType] char
@@ -7077,21 +7068,15 @@ ir.cpp:
70777068
# 1040| 0: [VariableDeclarationEntry] definition of lambda_val_explicit
70787069
# 1040| Type = [Closure,LocalClass] decltype([...](...){...})
70797070
# 1040| init: [Initializer] initializer for lambda_val_explicit
7080-
# 1040| expr: [ConstructorCall] call to (constructor)
7081-
# 1040| Type = [VoidType] void
7071+
# 1040| expr: [LambdaExpression] [...](...){...}
7072+
# 1040| Type = [Closure,LocalClass] decltype([...](...){...})
70827073
# 1040| ValueCategory = prvalue
7083-
# 1040| 0: [ReferenceToExpr] (reference to)
7084-
# 1040| Type = [LValueReferenceType] lambda [] type at line 1040, col. 30 &
7074+
# 1040| 0: [ClassAggregateLiteral] {...}
7075+
# 1040| Type = [Closure,LocalClass] decltype([...](...){...})
70857076
# 1040| ValueCategory = prvalue
7086-
# 1040| expr: [LambdaExpression] [...](...){...}
7087-
# 1040| Type = [Closure,LocalClass] decltype([...](...){...})
7088-
# 1040| ValueCategory = xvalue
7089-
# 1040| 0: [ClassAggregateLiteral] {...}
7090-
# 1040| Type = [Closure,LocalClass] decltype([...](...){...})
7091-
# 1040| ValueCategory = prvalue
7092-
#-----| .s: [ConstructorCall] call to String
7093-
#-----| Type = [VoidType] void
7094-
#-----| ValueCategory = prvalue
7077+
#-----| .s: [ConstructorCall] call to String
7078+
#-----| Type = [VoidType] void
7079+
#-----| ValueCategory = prvalue
70957080
# 1041| 9: [ExprStmt] ExprStmt
70967081
# 1041| 0: [FunctionCall] call to operator()
70977082
# 1041| Type = [PlainCharType] char
@@ -7239,9 +7224,6 @@ ir.cpp:
72397224
# 1032| params:
72407225
#-----| 0: [Parameter] p#0
72417226
#-----| Type = [RValueReferenceType] lambda [] type at line 1032, col. 23 &&
7242-
# 1032| initializations:
7243-
# 1032| body: [Block] { ... }
7244-
# 1032| 0: [ReturnStmt] return ...
72457227
# 1032| [Constructor] void (void Lambda(int, String const&))::(lambda [] type at line 1032, col. 23)::(constructor)()
72467228
# 1032| params:
72477229
# 1032| [MemberFunction] char (void Lambda(int, String const&))::(lambda [] type at line 1032, col. 23)::_FUN(float)
@@ -7277,21 +7259,6 @@ ir.cpp:
72777259
# 1034| params:
72787260
#-----| 0: [Parameter] p#0
72797261
#-----| Type = [RValueReferenceType] lambda [] type at line 1034, col. 21 &&
7280-
# 1034| initializations:
7281-
# 1034| 0: [ConstructorFieldInit] constructor init of field s
7282-
# 1034| Type = [LValueReferenceType] const String &
7283-
# 1034| ValueCategory = prvalue
7284-
# 1034| 0: [Literal] Unknown literal
7285-
# 1034| Type = [LValueReferenceType] const String &
7286-
# 1034| ValueCategory = prvalue
7287-
# 1034| 1: [ConstructorFieldInit] constructor init of field x
7288-
# 1034| Type = [LValueReferenceType] int &
7289-
# 1034| ValueCategory = prvalue
7290-
# 1034| 0: [Literal] Unknown literal
7291-
# 1034| Type = [LValueReferenceType] int &
7292-
# 1034| ValueCategory = prvalue
7293-
# 1034| body: [Block] { ... }
7294-
# 1034| 0: [ReturnStmt] return ...
72957262
# 1034| [Constructor] void (void Lambda(int, String const&))::(lambda [] type at line 1034, col. 21)::(constructor)()
72967263
# 1034| params:
72977264
# 1034| [ConstMemberFunction] char (void Lambda(int, String const&))::(lambda [] type at line 1034, col. 21)::operator()(float) const
@@ -7336,21 +7303,6 @@ ir.cpp:
73367303
# 1036| params:
73377304
#-----| 0: [Parameter] p#0
73387305
#-----| Type = [RValueReferenceType] lambda [] type at line 1036, col. 21 &&
7339-
# 1036| initializations:
7340-
# 1036| 0: [ConstructorFieldInit] constructor init of field s
7341-
# 1036| Type = [SpecifiedType] const String
7342-
# 1036| ValueCategory = prvalue
7343-
# 1036| 0: [ConstructorCall] call to String
7344-
# 1036| Type = [VoidType] void
7345-
# 1036| ValueCategory = prvalue
7346-
# 1036| 1: [ConstructorFieldInit] constructor init of field x
7347-
# 1036| Type = [IntType] int
7348-
# 1036| ValueCategory = prvalue
7349-
# 1036| 0: [Literal] Unknown literal
7350-
# 1036| Type = [IntType] int
7351-
# 1036| ValueCategory = prvalue
7352-
# 1036| body: [Block] { ... }
7353-
# 1036| 0: [ReturnStmt] return ...
73547306
# 1036| [Constructor] void (void Lambda(int, String const&))::(lambda [] type at line 1036, col. 21)::(constructor)()
73557307
# 1036| params:
73567308
# 1036| [Destructor] void (void Lambda(int, String const&))::(lambda [] type at line 1036, col. 21)::~<unnamed>()
@@ -7403,15 +7355,6 @@ ir.cpp:
74037355
# 1038| params:
74047356
#-----| 0: [Parameter] p#0
74057357
#-----| Type = [RValueReferenceType] lambda [] type at line 1038, col. 30 &&
7406-
# 1038| initializations:
7407-
# 1038| 0: [ConstructorFieldInit] constructor init of field s
7408-
# 1038| Type = [LValueReferenceType] const String &
7409-
# 1038| ValueCategory = prvalue
7410-
# 1038| 0: [Literal] Unknown literal
7411-
# 1038| Type = [LValueReferenceType] const String &
7412-
# 1038| ValueCategory = prvalue
7413-
# 1038| body: [Block] { ... }
7414-
# 1038| 0: [ReturnStmt] return ...
74157358
# 1038| [Constructor] void (void Lambda(int, String const&))::(lambda [] type at line 1038, col. 30)::(constructor)()
74167359
# 1038| params:
74177360
# 1038| [ConstMemberFunction] char (void Lambda(int, String const&))::(lambda [] type at line 1038, col. 30)::operator()(float) const
@@ -7451,15 +7394,6 @@ ir.cpp:
74517394
# 1040| params:
74527395
#-----| 0: [Parameter] p#0
74537396
#-----| Type = [RValueReferenceType] lambda [] type at line 1040, col. 30 &&
7454-
# 1040| initializations:
7455-
# 1040| 0: [ConstructorFieldInit] constructor init of field s
7456-
# 1040| Type = [SpecifiedType] const String
7457-
# 1040| ValueCategory = prvalue
7458-
# 1040| 0: [ConstructorCall] call to String
7459-
# 1040| Type = [VoidType] void
7460-
# 1040| ValueCategory = prvalue
7461-
# 1040| body: [Block] { ... }
7462-
# 1040| 0: [ReturnStmt] return ...
74637397
# 1040| [Constructor] void (void Lambda(int, String const&))::(lambda [] type at line 1040, col. 30)::(constructor)()
74647398
# 1040| params:
74657399
# 1040| [Destructor] void (void Lambda(int, String const&))::(lambda [] type at line 1040, col. 30)::~<unnamed>()
@@ -7510,21 +7444,6 @@ ir.cpp:
75107444
# 1042| params:
75117445
#-----| 0: [Parameter] p#0
75127446
#-----| Type = [RValueReferenceType] lambda [] type at line 1042, col. 32 &&
7513-
# 1042| initializations:
7514-
# 1042| 0: [ConstructorFieldInit] constructor init of field s
7515-
# 1042| Type = [LValueReferenceType] const String &
7516-
# 1042| ValueCategory = prvalue
7517-
# 1042| 0: [Literal] Unknown literal
7518-
# 1042| Type = [LValueReferenceType] const String &
7519-
# 1042| ValueCategory = prvalue
7520-
# 1042| 1: [ConstructorFieldInit] constructor init of field x
7521-
# 1042| Type = [IntType] int
7522-
# 1042| ValueCategory = prvalue
7523-
# 1042| 0: [Literal] Unknown literal
7524-
# 1042| Type = [IntType] int
7525-
# 1042| ValueCategory = prvalue
7526-
# 1042| body: [Block] { ... }
7527-
# 1042| 0: [ReturnStmt] return ...
75287447
# 1042| [Constructor] void (void Lambda(int, String const&))::(lambda [] type at line 1042, col. 32)::(constructor)()
75297448
# 1042| params:
75307449
# 1042| [ConstMemberFunction] char (void Lambda(int, String const&))::(lambda [] type at line 1042, col. 32)::operator()(float) const
@@ -7566,33 +7485,6 @@ ir.cpp:
75667485
# 1045| params:
75677486
#-----| 0: [Parameter] p#0
75687487
#-----| Type = [RValueReferenceType] lambda [] type at line 1045, col. 23 &&
7569-
# 1045| initializations:
7570-
# 1045| 0: [ConstructorFieldInit] constructor init of field s
7571-
# 1045| Type = [LValueReferenceType] const String &
7572-
# 1045| ValueCategory = prvalue
7573-
# 1045| 0: [Literal] Unknown literal
7574-
# 1045| Type = [LValueReferenceType] const String &
7575-
# 1045| ValueCategory = prvalue
7576-
# 1045| 1: [ConstructorFieldInit] constructor init of field x
7577-
# 1045| Type = [IntType] int
7578-
# 1045| ValueCategory = prvalue
7579-
# 1045| 0: [Literal] Unknown literal
7580-
# 1045| Type = [IntType] int
7581-
# 1045| ValueCategory = prvalue
7582-
# 1045| 2: [ConstructorFieldInit] constructor init of field i
7583-
# 1045| Type = [IntType] int
7584-
# 1045| ValueCategory = prvalue
7585-
# 1045| 0: [Literal] Unknown literal
7586-
# 1045| Type = [IntType] int
7587-
# 1045| ValueCategory = prvalue
7588-
# 1045| 3: [ConstructorFieldInit] constructor init of field j
7589-
# 1045| Type = [LValueReferenceType] int &
7590-
# 1045| ValueCategory = prvalue
7591-
# 1045| 0: [Literal] Unknown literal
7592-
# 1045| Type = [LValueReferenceType] int &
7593-
# 1045| ValueCategory = prvalue
7594-
# 1045| body: [Block] { ... }
7595-
# 1045| 0: [ReturnStmt] return ...
75967488
# 1045| [Constructor] void (void Lambda(int, String const&))::(lambda [] type at line 1045, col. 23)::(constructor)()
75977489
# 1045| params:
75987490
# 1045| [ConstMemberFunction] char (void Lambda(int, String const&))::(lambda [] type at line 1045, col. 23)::operator()(float) const

0 commit comments

Comments
 (0)