Skip to content

Compiling with instrumentation does not generate unique coverage array per method #78640

@drognanar

Description

@drognanar

Version Used: VS 17.14

Steps to Reproduce:

  1. Download https://github.com/microsoft/vs-streamjsonrpc
  2. Add <BuildingForLiveUnitTesting>true</BuildingForLiveUnitTesting> to the main Directory.Build.props, to compile all projects with LUT instrumentation and the /instrument:TestCoverage csc flag
  3. After the build ildasm/disassemble the StreamJsonRpc.dll
  4. There are multiple methods that use the same coverage payload index (in this case PayloadRoot[244] even though it should be unique per method). In the examples below it's both under StreamJsonRpc.JsonRpc class.

Image

Image

Expected Behavior:

All methods should have a unique PayloadRoot[index] index value.

Actual Behavior:

Multiple methods have the same PayloadRoot[index]. In this example multiple methods have PayloadRoot[244] and that's causing two methods to share the same coverage array.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions