Commit Graph

42 Commits

Author SHA1 Message Date
Mathias Vorreiter Pedersen
0487e0622a C++: Accept test changes from tests that use getAQlClass. 2025-11-24 14:04:35 +00:00
Mathias Vorreiter Pedersen
c481be8ea7 C++: Accept test changes for tests that select all types of an expression. 2025-09-18 12:16:28 +01:00
Jeroen Ketema
8f249c77bc C++: Support more complex 16-bit float types 2025-06-24 16:56:34 +02:00
Jeroen Ketema
25149e7ec2 C++: Update expected test results 2025-06-18 13:41:33 +02:00
Jeroen Ketema
f910906965 C++: Update expected test results 2025-06-09 23:42:09 +02:00
Jeroen Ketema
5ae8fe502a C++: Correctly identify orphaned variables as static 2024-06-06 20:35:26 +02:00
Jeroen Ketema
798357ffc6 C++: Add test case that shows that __func__ is not considered static 2024-06-06 20:31:45 +02:00
Geoffrey White
1df1f0dbc2 C++: Use 'concat' in the variable.ql test. 2024-04-12 14:22:21 +01:00
Geoffrey White
0235e9962e C++: Accept test changes (related to getAQlClass). 2024-04-12 14:19:37 +01:00
Jeroen Ketema
2a64552979 C++: Add support for C23/C++23 floating-point types 2023-10-19 10:45:14 +02:00
Jeroen Ketema
ea9f49efa1 C++: Remove support for _Float128x which is not actually supported by gcc 2023-08-04 17:23:11 +02:00
Jeroen Ketema
1bab950023 C++: Introduce (_Complex) _Float16 type which is needed after frontend update 2023-01-10 10:41:43 +01:00
Jeroen Ketema
82c9b8b494 C++: Ensure only one Variable exists for every global variable
Depending on the extraction order, before this change there might be multiple
`GlobalVariable`s per declared global variable. See the tests in
`cpp/ql/test/library-tests/variables/global`. This change ensures that only one
of those `GlobalVariable`s is visible to the user if we can locate a unique
definition. If not, the old situation persists.

Note that an exception needs to be made for templated variables. Here, the
definition refers to the non-instantiated template, while a declaration that
is not a definition refers to an instantiation. In case the instantiation refers
to a template parameter, the mangled names of the template and the instantiation
will be identical. This happens for example in the following case:
```
template <typename T>
T x = T(42);           // Uninstantiated templated variable

template <typename T>
class C {
  T y = x<T>;          // Instantiation using a template parameter
};
```
Since the uninstantiated template and the instantiation are two different
entities, we do not unify them as described above.
2022-06-28 15:32:43 +02:00
Jeroen Ketema
0f37e4e7b2 C++: Add variable in namespace test 2022-06-22 07:56:27 +02:00
Jeroen Ketema
1f97f1d931 C++: Add global variable tests 2022-06-21 10:43:40 +02:00
Erik Krogh Kristensen
91af2f14b1 CPP: update expected output after deleting deprecated things 2022-03-09 18:28:12 +01:00
Mathias Vorreiter Pedersen
c998370c84 C++: Accept more test changes. 2021-11-17 15:22:17 +00:00
Mathias Vorreiter Pedersen
a006a7fb24 Revert "Merge pull request #6004 from MathiasVP/path-sensitive-stack-variable-reachability-analysis"
This reverts commit e3e7b00986, reversing
changes made to 8ccdd4fb9f.
2021-07-20 18:06:49 +02:00
Mathias Vorreiter Pedersen
14a04ee453 C++: Accept more test changes. These all arise because we now transitively pull in 'semmle.code.cpp.Print' when including 'cpp'. 2021-06-14 22:02:46 +02:00
Alex Denisov
a12954a403 C++: Remove outdated comment 2021-06-07 17:15:21 +02:00
Alex Denisov
17be6e1271 C++: Fix string literal expectation 2021-06-07 09:47:26 +02:00
Ian Lynagh
9e518d2555 C++: Accept test change for p#n -> (unnamed parameter n) 2020-10-14 12:59:47 +01:00
Ian Lynagh
3ead154c9a C++: Add VariableDeclarationEntry test to library-tests/variables/global 2020-08-24 11:51:52 +01:00
Ian Lynagh
fb62ce6d25 C++: Give fewer types to global variables
Follows change in the extractor.
2020-08-24 00:49:33 +01:00
Matthew Gretton-Dann
52670dd956 C++: Update expected test output. 2020-04-29 10:18:13 +01:00
Dave Bartolomeo
434e11c0c5 C++: Fix test output 2020-03-27 19:47:08 -04:00
Dave Bartolomeo
9922958bf1 C++: Fix failed tests
Added a new `StaticLocalVariable` class, which made several other pieces of the original change a bit cleaner.

Fixed test failures due to a mistake in the original `CFG.qll` change.

Added a test case for static local variables with constructors.

Removed the `Uninitialized` instruction from the initialization of a static local, because all objects with static storage duration are zero-initialized at startup.

Fixed expectations for `SignAnalysis.ql` to reflect that a bad result is now fixed.
2020-03-13 06:46:07 -04:00
Dave Bartolomeo
ef194d3332 C++: Accept test output 2020-03-10 13:49:20 -04:00
Jonas Jensen
8110039e0a C++: Bring back the StackVariable QL class
The new `StackVariable` class actually denotes what its name suggests.
2019-11-19 11:23:34 +01:00
Dave Bartolomeo
63038896f4 C++: Accept test output after changes 2019-10-21 17:06:32 -07:00
Jonas Jensen
4ef5c9af62 C++: Autoformat everything
Some files that will change in #1736 have been spared.

    ./build -j4 target/jars/qlformat
    find ql/cpp/ql -name "*.ql"  -print0 | xargs -0 target/jars/qlformat --input
    find ql/cpp/ql -name "*.qll" -print0 | xargs -0 target/jars/qlformat --input
    (cd ql && git checkout 'cpp/ql/src/semmle/code/cpp/ir/implementation/**/*SSA*.qll')
    buildutils-internal/scripts/pr-checks/sync-identical-files.py --latest
2019-09-09 11:25:53 +02:00
Matthew Gretton-Dann
a733625646 C++: Add Variable.isThreadLocal() 2019-08-06 11:22:26 +01:00
Geoffrey White
a842ed56cf CPP: Integrate and produce full results. 2019-06-10 15:33:12 +01:00
Geoffrey White
e143870b65 CPP: Pavel's sketch implementation. 2019-06-10 15:33:12 +01:00
Geoffrey White
2f36d81137 CPP: Add cases for fields. 2019-06-10 15:07:52 +01:00
Geoffrey White
d3f98a5a74 CPP: Create a direct test of Variable.getAnAssignedValue(). 2019-06-10 14:33:14 +01:00
Nick Rolfe
8e9aeffdbc C++: accept test output from changes to extractor TRAP ordering 2019-03-18 10:44:18 +00:00
Ian Lynagh
a709a2d0f3 C++: Add Variable.isConstexpr() 2019-02-28 15:26:15 +00:00
Ian Lynagh
894a37ccda C++: Accept test changes 2018-10-18 12:36:42 +01:00
Dave Bartolomeo
aa267c8302 C++: Force LF for .c,.cpp,.h,.hpp 2018-09-23 16:23:52 -07:00
Jonas Jensen
38fe45ef32 C++: Don't use dbtypes in Declaration.qll 2018-08-28 14:58:39 +02:00
Pavel Avgustinov
b55526aa58 QL code and tests for C#/C++/JavaScript. 2018-08-02 17:53:23 +01:00