Skip to content

Codegen testing should be added to DDC #47397

Open
@srujzs

Description

@srujzs

Testing whether the compiler outputs the correct expected code exists today within the analyzer, CFE, and dart2js. You can look at some of the specific test runners here:

analyzer - pkg/analyzer/test/id_tests
CFE - pkg/front_end/test/id_tests
dart2js - pkg/compiler/test/equivalence

and the tests actually being run:

analyzer and CFE - pkg/_fe_analyzer_shared/test/constants/data/list.dart
dart2js - pkg/compiler/test/codegen/data/array_add.dart

A lot of the infrastructure is shared between CFE and analyzer, whereas dart2js implements much of its own. DDC can leverage much of what already exists with the CFE and analyzer in order to create codegen tests. There are a few uses cases with performance that this would be useful for e.g. js_util optimizations.

I dug into this earlier this year a bit, but have not created a fully working implementation yet. This bug is just to track this effort.

cc @nshahan

Metadata

Metadata

Assignees

Labels

C1P2A bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.dev-compiler-testtype-enhancementA request for a change that isn't a bugweb-dev-compilerweb-triage-2complexity assigned

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions