Skip to content

Commit a9169dc

Browse files
authored
Merge pull request #19837 from jketema/typeref-dataset-check
C++: Update expected test results after extractor changes
2 parents 666144e + 17ce5f4 commit a9169dc

File tree

8 files changed

+30
-23
lines changed

8 files changed

+30
-23
lines changed

cpp/ql/test/library-tests/floats/float128/usertypes.ql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import cpp
22

33
from UserType t, Type related
44
where
5-
related = t.(Class).getABaseClass() or
6-
related = t.(TypedefType).getUnderlyingType()
5+
(
6+
related = t.(Class).getABaseClass() or
7+
related = t.(TypedefType).getUnderlyingType()
8+
) and
9+
exists(t.getFile())
710
select t, related

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10807,22 +10807,22 @@ ir.cpp:
1080710807
# 885| Type = [FunctionPointerType] ..(*)(..)
1080810808
# 885| ValueCategory = prvalue
1080910809
# 886| getStmt(2): [ReturnStmt] return ...
10810-
# 888| [TopLevelFunction] void VAListUsage(int, __va_list_tag[1])
10810+
# 888| [TopLevelFunction] void VAListUsage(int, __builtin_va_list)
1081110811
# 888| <params>:
1081210812
# 888| getParameter(0): [Parameter] x
1081310813
# 888| Type = [IntType] int
1081410814
# 888| getParameter(1): [Parameter] args
10815-
# 888| Type = [ArrayType] __va_list_tag[1]
10815+
# 888| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
1081610816
# 888| getEntryPoint(): [BlockStmt] { ... }
1081710817
# 889| getStmt(0): [DeclStmt] declaration
1081810818
# 889| getDeclarationEntry(0): [VariableDeclarationEntry] definition of args2
10819-
# 889| Type = [ArrayType] __va_list_tag[1]
10819+
# 889| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
1082010820
# 890| getStmt(1): [ExprStmt] ExprStmt
1082110821
# 890| getExpr(): [BuiltInVarArgCopy] __builtin_va_copy
1082210822
# 890| Type = [VoidType] void
1082310823
# 890| ValueCategory = prvalue
1082410824
# 890| getDestinationVAList(): [VariableAccess] args2
10825-
# 890| Type = [ArrayType] __va_list_tag[1]
10825+
# 890| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
1082610826
# 890| ValueCategory = lvalue
1082710827
# 890| getSourceVAList(): [VariableAccess] args
1082810828
# 890| Type = [PointerType] __va_list_tag *
@@ -10859,7 +10859,7 @@ ir.cpp:
1085910859
# 893| Type = [VoidType] void
1086010860
# 893| ValueCategory = prvalue
1086110861
# 893| getVAList(): [VariableAccess] args2
10862-
# 893| Type = [ArrayType] __va_list_tag[1]
10862+
# 893| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
1086310863
# 893| ValueCategory = lvalue
1086410864
# 893| getVAList().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
1086510865
# 893| Type = [PointerType] __va_list_tag *
@@ -10872,13 +10872,13 @@ ir.cpp:
1087210872
# 896| getEntryPoint(): [BlockStmt] { ... }
1087310873
# 897| getStmt(0): [DeclStmt] declaration
1087410874
# 897| getDeclarationEntry(0): [VariableDeclarationEntry] definition of args
10875-
# 897| Type = [ArrayType] __va_list_tag[1]
10875+
# 897| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
1087610876
# 899| getStmt(1): [ExprStmt] ExprStmt
1087710877
# 899| getExpr(): [BuiltInVarArgsStart] __builtin_va_start
1087810878
# 899| Type = [VoidType] void
1087910879
# 899| ValueCategory = prvalue
1088010880
# 899| getVAList(): [VariableAccess] args
10881-
# 899| Type = [ArrayType] __va_list_tag[1]
10881+
# 899| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
1088210882
# 899| ValueCategory = lvalue
1088310883
# 899| getLastNamedParameter(): [VariableAccess] x
1088410884
# 899| Type = [IntType] int
@@ -10888,16 +10888,16 @@ ir.cpp:
1088810888
# 899| ValueCategory = prvalue
1088910889
# 900| getStmt(2): [DeclStmt] declaration
1089010890
# 900| getDeclarationEntry(0): [VariableDeclarationEntry] definition of args2
10891-
# 900| Type = [ArrayType] __va_list_tag[1]
10891+
# 900| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
1089210892
# 901| getStmt(3): [ExprStmt] ExprStmt
1089310893
# 901| getExpr(): [BuiltInVarArgCopy] __builtin_va_copy
1089410894
# 901| Type = [VoidType] void
1089510895
# 901| ValueCategory = prvalue
1089610896
# 901| getDestinationVAList(): [VariableAccess] args2
10897-
# 901| Type = [ArrayType] __va_list_tag[1]
10897+
# 901| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
1089810898
# 901| ValueCategory = lvalue
1089910899
# 901| getSourceVAList(): [VariableAccess] args
10900-
# 901| Type = [ArrayType] __va_list_tag[1]
10900+
# 901| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
1090110901
# 901| ValueCategory = lvalue
1090210902
# 901| getDestinationVAList().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
1090310903
# 901| Type = [PointerType] __va_list_tag *
@@ -10913,7 +10913,7 @@ ir.cpp:
1091310913
# 902| Type = [DoubleType] double
1091410914
# 902| ValueCategory = prvalue(load)
1091510915
# 902| getVAList(): [VariableAccess] args
10916-
# 902| Type = [ArrayType] __va_list_tag[1]
10916+
# 902| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
1091710917
# 902| ValueCategory = lvalue
1091810918
# 902| getVAList().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
1091910919
# 902| Type = [PointerType] __va_list_tag *
@@ -10926,7 +10926,7 @@ ir.cpp:
1092610926
# 903| Type = [IntType] int
1092710927
# 903| ValueCategory = prvalue(load)
1092810928
# 903| getVAList(): [VariableAccess] args
10929-
# 903| Type = [ArrayType] __va_list_tag[1]
10929+
# 903| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
1093010930
# 903| ValueCategory = lvalue
1093110931
# 903| getVAList().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
1093210932
# 903| Type = [PointerType] __va_list_tag *
@@ -10940,7 +10940,7 @@ ir.cpp:
1094010940
# 904| Type = [VoidType] void
1094110941
# 904| ValueCategory = prvalue
1094210942
# 904| getVAList(): [VariableAccess] args
10943-
# 904| Type = [ArrayType] __va_list_tag[1]
10943+
# 904| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
1094410944
# 904| ValueCategory = lvalue
1094510945
# 904| getVAList().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
1094610946
# 904| Type = [PointerType] __va_list_tag *
@@ -10953,7 +10953,7 @@ ir.cpp:
1095310953
# 905| Type = [IntType] int
1095410954
# 905| ValueCategory = prvalue(load)
1095510955
# 905| getArgument(1): [VariableAccess] args2
10956-
# 905| Type = [ArrayType] __va_list_tag[1]
10956+
# 905| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
1095710957
# 905| ValueCategory = lvalue
1095810958
# 905| getArgument(1).getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
1095910959
# 905| Type = [PointerType] __va_list_tag *
@@ -10963,7 +10963,7 @@ ir.cpp:
1096310963
# 906| Type = [VoidType] void
1096410964
# 906| ValueCategory = prvalue
1096510965
# 906| getVAList(): [VariableAccess] args2
10966-
# 906| Type = [ArrayType] __va_list_tag[1]
10966+
# 906| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
1096710967
# 906| ValueCategory = lvalue
1096810968
# 906| getVAList().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
1096910969
# 906| Type = [PointerType] __va_list_tag *

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8614,7 +8614,7 @@ ir.cpp:
86148614
# 883| v883_13(void) = AliasedUse : m883_3
86158615
# 883| v883_14(void) = ExitFunction :
86168616

8617-
# 888| void VAListUsage(int, __va_list_tag[1])
8617+
# 888| void VAListUsage(int, __builtin_va_list)
86188618
# 888| Block 0
86198619
# 888| v888_1(void) = EnterFunction :
86208620
# 888| m888_2(unknown) = AliasedDefinition :

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7955,7 +7955,7 @@ ir.cpp:
79557955
# 883| v883_12(void) = AliasedUse : ~m?
79567956
# 883| v883_13(void) = ExitFunction :
79577957

7958-
# 888| void VAListUsage(int, __va_list_tag[1])
7958+
# 888| void VAListUsage(int, __builtin_va_list)
79597959
# 888| Block 0
79607960
# 888| v888_1(void) = EnterFunction :
79617961
# 888| mu888_2(unknown) = AliasedDefinition :

cpp/ql/test/query-tests/Likely Bugs/Format/WrongTypeFormatArguments/Microsoft/WrongTypeFormatArguments.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
| printf1.h:44:18:44:20 | ull | This format specifier for type 'int' does not match the argument type 'unsigned long long'. |
1111
| printf1.h:45:18:45:20 | ull | This format specifier for type 'unsigned int' does not match the argument type 'unsigned long long'. |
1212
| printf1.h:46:18:46:20 | ull | This format specifier for type 'unsigned int' does not match the argument type 'unsigned long long'. |
13+
| printf1.h:62:19:62:20 | ul | This format specifier for type 'size_t' does not match the argument type 'unsigned long'. |
14+
| printf1.h:68:19:68:21 | sst | This format specifier for type 'size_t' does not match the argument type 'long'. |
1315
| printf1.h:71:19:71:20 | st | This format specifier for type 'ssize_t' does not match the argument type 'unsigned long long'. |
1416
| printf1.h:72:19:72:20 | ST | This format specifier for type 'ssize_t' does not match the argument type 'unsigned long long'. |
1517
| printf1.h:73:19:73:22 | c_st | This format specifier for type 'ssize_t' does not match the argument type 'unsigned long long'. |

cpp/ql/test/query-tests/Likely Bugs/Format/WrongTypeFormatArguments/Microsoft/printf1.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ void g()
5959
const SIZE_T C_ST = sizeof(st);
6060
ssize_t sst;
6161

62-
printf("%zu", ul); // ok (dubious, e.g. on 64-bit Windows `long` is 4 bytes but `size_t` is 8)
62+
printf("%zu", ul); // not ok
6363
printf("%zu", st); // ok
6464
printf("%zu", ST); // ok
6565
printf("%zu", c_st); // ok
6666
printf("%zu", C_ST); // ok
6767
printf("%zu", sizeof(ul)); // ok
68-
printf("%zu", sst); // not ok [NOT DETECTED]
68+
printf("%zu", sst); // not ok
6969

7070
printf("%zd", ul); // not ok [NOT DETECTED]
7171
printf("%zd", st); // not ok

cpp/ql/test/query-tests/Likely Bugs/Format/WrongTypeFormatArguments/Microsoft_no_wchar/WrongTypeFormatArguments.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
| printf1.h:44:18:44:20 | ull | This format specifier for type 'int' does not match the argument type 'unsigned long long'. |
1111
| printf1.h:45:18:45:20 | ull | This format specifier for type 'unsigned int' does not match the argument type 'unsigned long long'. |
1212
| printf1.h:46:18:46:20 | ull | This format specifier for type 'unsigned int' does not match the argument type 'unsigned long long'. |
13+
| printf1.h:62:19:62:20 | ul | This format specifier for type 'size_t' does not match the argument type 'unsigned long'. |
14+
| printf1.h:68:19:68:21 | sst | This format specifier for type 'size_t' does not match the argument type 'long'. |
1315
| printf1.h:71:19:71:20 | st | This format specifier for type 'ssize_t' does not match the argument type 'unsigned long long'. |
1416
| printf1.h:72:19:72:20 | ST | This format specifier for type 'ssize_t' does not match the argument type 'unsigned long long'. |
1517
| printf1.h:73:19:73:22 | c_st | This format specifier for type 'ssize_t' does not match the argument type 'unsigned long long'. |

cpp/ql/test/query-tests/Likely Bugs/Format/WrongTypeFormatArguments/Microsoft_no_wchar/printf1.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ void g()
5959
const SIZE_T C_ST = sizeof(st);
6060
ssize_t sst;
6161

62-
printf("%zu", ul); // ok (dubious, e.g. on 64-bit Windows `long` is 4 bytes but `size_t` is 8)
62+
printf("%zu", ul); // not ok
6363
printf("%zu", st); // ok
6464
printf("%zu", ST); // ok
6565
printf("%zu", c_st); // ok
6666
printf("%zu", C_ST); // ok
6767
printf("%zu", sizeof(ul)); // ok
68-
printf("%zu", sst); // not ok [NOT DETECTED]
68+
printf("%zu", sst); // not ok
6969

7070
printf("%zd", ul); // not ok [NOT DETECTED]
7171
printf("%zd", st); // not ok

0 commit comments

Comments
 (0)