diff --git a/compiler/fir/analysis-tests/ReadMe.md b/compiler/fir/analysis-tests/ReadMe.md new file mode 100644 index 00000000000..6c15d990a41 --- /dev/null +++ b/compiler/fir/analysis-tests/ReadMe.md @@ -0,0 +1,46 @@ +# FIR Analysis tests + +Mostly, format of FIR analysis test is the same as the one described at `compiler/testData/diagnostics/ReadMe.md`. + + +`DEBUG_INFO_EXPRESSION_TYPE` and `DEBUG_INFO_CALL` are also partially supported but need to be written out explicitly in a test data file: +```kotlin +fun foo( + x1: String, + x2: Collection, + x3: MutableMap> +) { + x1 + ")!>x2 + >")!>x3 +} + +interface B { + operator fun invoke(x: Int): String +} + +class A { + fun foo(x: Int) { + fun baz(x: Double) {} + baz(1.0) + } + + val bar: B = TODO() +} + +fun A.foo(x: String) {} + +fun main() { + fun A.foo(x: Double) {} + val a = A() + a.foo(1) + a.foo("") + a.foo(1.0) + a.bar(1) +} +``` + +## Specific Directives +- `// FIR_IDENTICAL` should be prepended in a `.kt` file of an old diagnostic test when analysis result of old FE and FIR are the same +- `// FIR_IGNORE` should be prepended in a `.fir.kt` file of an old diagnostic test known to fail with exception +- `// !DUMP_CFG` generates `.dot` file with rendered data flow graph (see comment at `org.jetbrains.kotlin.fir.AbstractFirDiagnosticsTest`)