156 Commits

Author SHA1 Message Date
Anders Schack-Mulligen
dc6d3fe7ba Use flowFrom. 2025-12-03 14:04:18 +01:00
Ian Lynagh
9182da1d58 Kotlin: Add a test for nested types 2025-10-31 13:42:44 +00:00
idrissrio
5d2268fa80 Java: accept new test results after extractor update 2025-09-02 20:19:38 +02:00
Anders Schack-Mulligen
273429d14a Java: Accept qltest output 2025-08-05 10:32:53 +02:00
Ian Lynagh
9a03f2eb26 Kotlin: Accept test changes in 2.2.0 2025-07-22 17:38:14 +01:00
Anders Schack-Mulligen
448cc82ef9 Kotlin: Accept more test changes. 2025-07-17 11:21:27 +02:00
Anders Schack-Mulligen
db01828717 Java: Deprecate redundant basic block predicates. 2025-05-21 09:01:46 +02:00
Chris Smowton
27222499d4 Update test expectation 2025-05-13 14:42:18 +01:00
Chris Smowton
1afe67ab13 Accept Kotlin 2.1.20 test changes
These are mainly small changes in how source-locations are ascribed to synthetic expressions, plus three real changes:

- The comment extractor is performing better presumably due to improvements in the underlying representation
- *= /= and %= operations are once again extracted correctly; presumably their origin information has been fixed
- Reference to a static final Java field can lead to more constant propagation than before

The last one might be a minor nuisance to someone trying to find references to such a field.
2025-05-13 14:42:15 +01:00
Chris Smowton
1577b40b45 Accept test changes 2025-02-28 11:23:07 +00:00
Michael Nebel
0a1d2d0bbb Java: Update all test util paths to point to the new location. 2024-12-12 13:21:25 +01:00
Owen Mansel-Chan
5b575113c3 Update test-kotlin2 2024-12-10 15:56:15 +00:00
Chris Smowton
89a2f0dc00 Merge pull request #17890 from smowton/smowton/fix/kotlin-use-nulltype
Kotlin extractor: use special <nulltype> for null literals
2024-11-11 10:54:21 +00:00
Tom Hvitved
95e9d013cc Update expected test output 2024-11-04 12:07:06 +01:00
Chris Smowton
5d3f723df9 Kotlin extractor: use special <nulltype> for null literals
This matches the Java extractor's treatment of these literals, and so enables dataflow type-tracking to avoid special-casing Kotlin. Natively, Kotlin would regard this as kotlin.Nothing?, the type that can only contain null (kotlin.Nothing without a ? can take nothing at all), which gets Java-ified as java.lang.Void, and this will continue to be used when a null type has to be "boxed", as in representing substituted generic constraints with no possible type.
2024-11-01 16:14:10 +00:00
Tom Hvitved
bf0675e5ba Kotlin: Update two tests 2024-10-04 08:35:30 +02:00
Ian Lynagh
08be35fc2c Kotlin: Add a test for constructors 2024-09-27 11:21:23 +01:00
Asger F
9703f67794 Test output updates that only affect nodes/edges 2024-08-23 11:03:26 +02:00
Anders Schack-Mulligen
fb1dfd4217 Java: Accept test changes. 2024-08-15 10:32:12 +02:00
Anders Schack-Mulligen
3cdc8d5eca Java: Add PathGraph to test output for default inline flow tests. 2024-08-15 10:17:31 +02:00
Tom Hvitved
f83df76928 Shared: Apply ShowProvenance in InlineFlowTest.qll 2024-08-13 13:34:43 +02:00
Ian Lynagh
839258897a Kotlin: Add test for generated throw statements 2024-06-03 15:26:52 +01:00
Ian Lynagh
2d760c7cc7 Kotlin: Tweak comments test
The top comment now gets owned by the Compilation Unit. We could
explicitly stop this from happening instead, but I think it's
reasonable.
2024-06-03 15:26:52 +01:00
Ian Lynagh
6224670884 Kotlin: Accept 2.0.0's Kotlin 2 test output 2024-06-03 15:26:51 +01:00
Ian Lynagh
e610573411 Merge pull request #16078 from igfoo/igfoo/exprs_changes
Kotlin 2: Accept more changes
2024-04-02 12:19:17 +01:00
Ian Lynagh
3acdc73f22 Kotlin 2: Accept some more location changes 2024-03-28 16:15:37 +00:00
Ian Lynagh
568fba6940 Kotlin 2: Accept some more test changes 2024-03-28 15:28:36 +00:00
Ian Lynagh
0fdc71bf57 Kotlin 2: Accept a test change
For

    if(r != null) {
        val r2: Rectangle = r

in Kotlin 2 mode, there is no IMPLICIT_NOTNULL check in Kotlin 2 mode:

    then: BLOCK type=kotlin.Unit origin=null
      VAR name:r2 type:java.awt.Rectangle [val]
-       TYPE_OP type=java.awt.Rectangle origin=IMPLICIT_NOTNULL typeOperand=java.awt.Rectangle
-         GET_VAR 'val r: @[FlexibleNullability] java.awt.Rectangle? [val] declared in <root>.foo' type=@[FlexibleNullability] java.awt.Rectangle? origin=null
+       GET_VAR 'val r: @[FlexibleNullability] java.awt.Rectangle? [val] declared in <root>.foo' type=@[FlexibleNullability] java.awt.Rectangle? origin=null
      VAR name:height type:kotlin.Int [val]
        GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:height type:kotlin.Int visibility:public' type=kotlin.Int origin=null
          receiver: GET_VAR 'val r2: java.awt.Rectangle [val] declared in <root>.foo' type=java.awt.Rectangle origin=null
2024-03-28 15:23:27 +00:00
Ian Lynagh
96723b1a8f Kotlin 2: Accept some loc changes 2024-03-28 15:11:19 +00:00
Ian Lynagh
24c4c3e068 Kotlin 2: Accept a test change
With:

    open class Root {}
    class Subclass1: Root() {}

    fun typeTests(x: Root, y: Subclass1) {
        val y1: Subclass1 = if (x is Subclass1) { x } else { y }
    }

we now get a slightly different AST, which means we no longer need to
insert a StmtExpr:

     BRANCH
       if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.Subclass1
         GET_VAR 'x: <root>.Root declared in <root>.typeTests' type=<root>.Root origin=null
-      then: TYPE_OP type=<root>.Subclass1 origin=IMPLICIT_CAST typeOperand=<root>.Subclass1
-        BLOCK type=<root>.Root origin=null
+      then: BLOCK type=<root>.Subclass1 origin=null
+        TYPE_OP type=<root>.Subclass1 origin=IMPLICIT_CAST typeOperand=<root>.Subclass1
           GET_VAR 'x: <root>.Root declared in <root>.typeTests' type=<root>.Root origin=null
2024-03-28 15:07:30 +00:00
Ian Lynagh
c5604c97bd Kotlin 2: Accept more location changes 2024-03-26 14:10:28 +00:00
Ian Lynagh
63e34c4dec Kotlin 2: Accept more location changes 2024-03-22 14:09:20 +00:00
Ian Lynagh
3fa7532b43 Kotlin 2: Accept more test changes 2024-03-20 11:46:58 +00:00
Ian Lynagh
a53d5d832d Kotlin 2: Accept more loc changes 2024-03-15 18:08:53 +00:00
Ian Lynagh
c4c843968e Kotlin 2: Accept more loc changes 2024-03-15 18:07:39 +00:00
Ian Lynagh
57d17d85f2 Kotlin 2: Accept more loc changes 2024-03-15 18:07:12 +00:00
Ian Lynagh
6c0885c24d Kotlin 2: Accept more loc changes 2024-03-15 18:06:45 +00:00
Ian Lynagh
5580daf60e Kotlin 2: Accept more loc changes 2024-03-15 18:06:13 +00:00
Ian Lynagh
1d2b31f0be Kotlin 2: Accept more loc changes 2024-03-15 18:05:46 +00:00
Ian Lynagh
5552fe3c34 Kotlin 2: Accept more loc changes 2024-03-15 18:05:09 +00:00
Ian Lynagh
28f98d0344 Kotlin 2: Accept more location changes 2024-03-15 18:04:28 +00:00
Ian Lynagh
354cdf44aa Kotlin 2: Accept more location changes 2024-03-15 18:03:55 +00:00
Ian Lynagh
f4542f6160 Kotlin2 : Accept some more location changes 2024-03-15 18:02:54 +00:00
Ian Lynagh
0e94aa0eb5 Kotlin 2: Accept more changes in the exprs test 2024-03-12 16:42:37 +00:00
Ian Lynagh
e74606eba3 Kotlin 2: Accept some more loc changes 2024-03-07 18:40:59 +00:00
Ian Lynagh
79c5ad93b0 Kotlin 2: Accept a loc change
This is a bit of an odd location for the IrVariableImpl as it includes a
comment, but the comment is already included in the corrresponding
IrLocalDelegatedPropertyImpl so it's not clearly wrong:

 Element: 16 59 (2:4 - 2:47) class org.jetbrains.kotlin.ir.declarations.impl.IrLocalDelegatedPropertyImpl
-Element: 29 42 (2:17 - 2:30) class org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl
+Element: 16 59 (2:4 - 2:47) class org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl

So just accept the change.
2024-03-07 18:37:00 +00:00
Ian Lynagh
e58b6e86b2 Kotlin 2: Accept more loc changes in exprs test 2024-03-06 17:57:44 +00:00
Ian Lynagh
6e09dcc16a Kotlin 2: Accept more loc changes in exprs 2024-03-04 19:06:32 +00:00
Ian Lynagh
22e6c676c3 Kotlin 2: Accept loc change for a string literal in expr test 2024-03-04 19:02:40 +00:00
Ian Lynagh
b7d2e54bbd Kotlin 2: exprs test: Accept loc change for ClassWithDelegate 2024-03-04 19:00:40 +00:00