Skip to content

C++: Update expected test results after extractor changes #19837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cpp/ql/test/library-tests/floats/float128/usertypes.ql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import cpp

from UserType t, Type related
where
related = t.(Class).getABaseClass() or
related = t.(TypedefType).getUnderlyingType()
(
related = t.(Class).getABaseClass() or
related = t.(TypedefType).getUnderlyingType()
) and
exists(t.getFile())
select t, related
30 changes: 15 additions & 15 deletions cpp/ql/test/library-tests/ir/ir/PrintAST.expected
Original file line number Diff line number Diff line change
Expand Up @@ -10807,22 +10807,22 @@ ir.cpp:
# 885| Type = [FunctionPointerType] ..(*)(..)
# 885| ValueCategory = prvalue
# 886| getStmt(2): [ReturnStmt] return ...
# 888| [TopLevelFunction] void VAListUsage(int, __va_list_tag[1])
# 888| [TopLevelFunction] void VAListUsage(int, __builtin_va_list)
# 888| <params>:
# 888| getParameter(0): [Parameter] x
# 888| Type = [IntType] int
# 888| getParameter(1): [Parameter] args
# 888| Type = [ArrayType] __va_list_tag[1]
# 888| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
# 888| getEntryPoint(): [BlockStmt] { ... }
# 889| getStmt(0): [DeclStmt] declaration
# 889| getDeclarationEntry(0): [VariableDeclarationEntry] definition of args2
# 889| Type = [ArrayType] __va_list_tag[1]
# 889| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
# 890| getStmt(1): [ExprStmt] ExprStmt
# 890| getExpr(): [BuiltInVarArgCopy] __builtin_va_copy
# 890| Type = [VoidType] void
# 890| ValueCategory = prvalue
# 890| getDestinationVAList(): [VariableAccess] args2
# 890| Type = [ArrayType] __va_list_tag[1]
# 890| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
# 890| ValueCategory = lvalue
# 890| getSourceVAList(): [VariableAccess] args
# 890| Type = [PointerType] __va_list_tag *
Expand Down Expand Up @@ -10859,7 +10859,7 @@ ir.cpp:
# 893| Type = [VoidType] void
# 893| ValueCategory = prvalue
# 893| getVAList(): [VariableAccess] args2
# 893| Type = [ArrayType] __va_list_tag[1]
# 893| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
# 893| ValueCategory = lvalue
# 893| getVAList().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
# 893| Type = [PointerType] __va_list_tag *
Expand All @@ -10872,13 +10872,13 @@ ir.cpp:
# 896| getEntryPoint(): [BlockStmt] { ... }
# 897| getStmt(0): [DeclStmt] declaration
# 897| getDeclarationEntry(0): [VariableDeclarationEntry] definition of args
# 897| Type = [ArrayType] __va_list_tag[1]
# 897| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
# 899| getStmt(1): [ExprStmt] ExprStmt
# 899| getExpr(): [BuiltInVarArgsStart] __builtin_va_start
# 899| Type = [VoidType] void
# 899| ValueCategory = prvalue
# 899| getVAList(): [VariableAccess] args
# 899| Type = [ArrayType] __va_list_tag[1]
# 899| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
# 899| ValueCategory = lvalue
# 899| getLastNamedParameter(): [VariableAccess] x
# 899| Type = [IntType] int
Expand All @@ -10888,16 +10888,16 @@ ir.cpp:
# 899| ValueCategory = prvalue
# 900| getStmt(2): [DeclStmt] declaration
# 900| getDeclarationEntry(0): [VariableDeclarationEntry] definition of args2
# 900| Type = [ArrayType] __va_list_tag[1]
# 900| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
# 901| getStmt(3): [ExprStmt] ExprStmt
# 901| getExpr(): [BuiltInVarArgCopy] __builtin_va_copy
# 901| Type = [VoidType] void
# 901| ValueCategory = prvalue
# 901| getDestinationVAList(): [VariableAccess] args2
# 901| Type = [ArrayType] __va_list_tag[1]
# 901| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
# 901| ValueCategory = lvalue
# 901| getSourceVAList(): [VariableAccess] args
# 901| Type = [ArrayType] __va_list_tag[1]
# 901| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
# 901| ValueCategory = lvalue
# 901| getDestinationVAList().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
# 901| Type = [PointerType] __va_list_tag *
Expand All @@ -10913,7 +10913,7 @@ ir.cpp:
# 902| Type = [DoubleType] double
# 902| ValueCategory = prvalue(load)
# 902| getVAList(): [VariableAccess] args
# 902| Type = [ArrayType] __va_list_tag[1]
# 902| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
# 902| ValueCategory = lvalue
# 902| getVAList().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
# 902| Type = [PointerType] __va_list_tag *
Expand All @@ -10926,7 +10926,7 @@ ir.cpp:
# 903| Type = [IntType] int
# 903| ValueCategory = prvalue(load)
# 903| getVAList(): [VariableAccess] args
# 903| Type = [ArrayType] __va_list_tag[1]
# 903| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
# 903| ValueCategory = lvalue
# 903| getVAList().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
# 903| Type = [PointerType] __va_list_tag *
Expand All @@ -10940,7 +10940,7 @@ ir.cpp:
# 904| Type = [VoidType] void
# 904| ValueCategory = prvalue
# 904| getVAList(): [VariableAccess] args
# 904| Type = [ArrayType] __va_list_tag[1]
# 904| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
# 904| ValueCategory = lvalue
# 904| getVAList().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
# 904| Type = [PointerType] __va_list_tag *
Expand All @@ -10953,7 +10953,7 @@ ir.cpp:
# 905| Type = [IntType] int
# 905| ValueCategory = prvalue(load)
# 905| getArgument(1): [VariableAccess] args2
# 905| Type = [ArrayType] __va_list_tag[1]
# 905| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
# 905| ValueCategory = lvalue
# 905| getArgument(1).getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
# 905| Type = [PointerType] __va_list_tag *
Expand All @@ -10963,7 +10963,7 @@ ir.cpp:
# 906| Type = [VoidType] void
# 906| ValueCategory = prvalue
# 906| getVAList(): [VariableAccess] args2
# 906| Type = [ArrayType] __va_list_tag[1]
# 906| Type = [BuiltInVarArgsList,CTypedefType] __builtin_va_list
# 906| ValueCategory = lvalue
# 906| getVAList().getFullyConverted(): [ArrayToPointerConversion] array to pointer conversion
# 906| Type = [PointerType] __va_list_tag *
Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/test/library-tests/ir/ir/aliased_ir.expected
Original file line number Diff line number Diff line change
Expand Up @@ -8614,7 +8614,7 @@ ir.cpp:
# 883| v883_13(void) = AliasedUse : m883_3
# 883| v883_14(void) = ExitFunction :

# 888| void VAListUsage(int, __va_list_tag[1])
# 888| void VAListUsage(int, __builtin_va_list)
# 888| Block 0
# 888| v888_1(void) = EnterFunction :
# 888| m888_2(unknown) = AliasedDefinition :
Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/test/library-tests/ir/ir/raw_ir.expected
Original file line number Diff line number Diff line change
Expand Up @@ -7955,7 +7955,7 @@ ir.cpp:
# 883| v883_12(void) = AliasedUse : ~m?
# 883| v883_13(void) = ExitFunction :

# 888| void VAListUsage(int, __va_list_tag[1])
# 888| void VAListUsage(int, __builtin_va_list)
# 888| Block 0
# 888| v888_1(void) = EnterFunction :
# 888| mu888_2(unknown) = AliasedDefinition :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
| printf1.h:44:18:44:20 | ull | This format specifier for type 'int' does not match the argument type 'unsigned long long'. |
| printf1.h:45:18:45:20 | ull | This format specifier for type 'unsigned int' does not match the argument type 'unsigned long long'. |
| printf1.h:46:18:46:20 | ull | This format specifier for type 'unsigned int' does not match the argument type 'unsigned long long'. |
| printf1.h:62:19:62:20 | ul | This format specifier for type 'size_t' does not match the argument type 'unsigned long'. |
| printf1.h:68:19:68:21 | sst | This format specifier for type 'size_t' does not match the argument type 'long'. |
| printf1.h:71:19:71:20 | st | This format specifier for type 'ssize_t' does not match the argument type 'unsigned long long'. |
| printf1.h:72:19:72:20 | ST | This format specifier for type 'ssize_t' does not match the argument type 'unsigned long long'. |
| printf1.h:73:19:73:22 | c_st | This format specifier for type 'ssize_t' does not match the argument type 'unsigned long long'. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ void g()
const SIZE_T C_ST = sizeof(st);
ssize_t sst;

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

printf("%zd", ul); // not ok [NOT DETECTED]
printf("%zd", st); // not ok
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
| printf1.h:44:18:44:20 | ull | This format specifier for type 'int' does not match the argument type 'unsigned long long'. |
| printf1.h:45:18:45:20 | ull | This format specifier for type 'unsigned int' does not match the argument type 'unsigned long long'. |
| printf1.h:46:18:46:20 | ull | This format specifier for type 'unsigned int' does not match the argument type 'unsigned long long'. |
| printf1.h:62:19:62:20 | ul | This format specifier for type 'size_t' does not match the argument type 'unsigned long'. |
| printf1.h:68:19:68:21 | sst | This format specifier for type 'size_t' does not match the argument type 'long'. |
| printf1.h:71:19:71:20 | st | This format specifier for type 'ssize_t' does not match the argument type 'unsigned long long'. |
| printf1.h:72:19:72:20 | ST | This format specifier for type 'ssize_t' does not match the argument type 'unsigned long long'. |
| printf1.h:73:19:73:22 | c_st | This format specifier for type 'ssize_t' does not match the argument type 'unsigned long long'. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ void g()
const SIZE_T C_ST = sizeof(st);
ssize_t sst;

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

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