Skip to content

Enable PE verification in tests of unsafe code #23130

@jcouv

Description

@jcouv

Currently CompileAndVerify (src/Test/Utilities/Portable/CommonTestBase.cs, line 126) automatically skips PE verification if the compilation has unsafe flag. We should tighten this and identify individual tests for unsafe code that should skip PE verification.

            if (verify)
            {
                // Unsafe code might not verify, so don't try.
                var csharpOptions = compilation.Options as CSharp.CSharpCompilationOptions;
                verify = (csharpOptions == null || !csharpOptions.AllowUnsafe);
            }

Tagging @VSadov

Metadata

Metadata

Assignees

Labels

Area-CompilersResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedTestTest failures in roslyn-CI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions