2078 references to EmitToImageReference
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
SymbolKey\SymbolKeyErrorTypeTests.cs (1)
388.AddReferences(sourceCompilation.EmitToImageReference());
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (2)
148var comp2 = CreateCompilation(src2, [comp1.EmitToImageReference()]); 237var comp40 = (Compilation)CreateCompilation(src2, [comp20.EmitToImageReference()]);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (299)
BreakingChanges.cs (1)
1581var libRef = CreateCompilation(libSource, assemblyName: "lib").EmitToImageReference();
CodeGen\CodeGenAsyncIteratorTests.cs (3)
116var lib_ref = lib.EmitToImageReference(); 133var lib_ref = lib.EmitToImageReference(); 9913var verifier = CompileAndVerify(src, expectedOutput: ExpectedOutput("4242"), references: [libComp.EmitToImageReference()],
CodeGen\CodeGenAsyncLocalsTests.cs (1)
961var reference = CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { SystemRef_v4_0_30319_17929 }).EmitToImageReference();
CodeGen\CodeGenAsyncTests.cs (3)
3711var rB = cB.EmitToImageReference(); 3722var rT = cT.EmitToImageReference(); 6135var verifier = CompileAndVerify(src, expectedOutput: ExpectedOutput("4242"), references: [libComp.EmitToImageReference()],
CodeGen\CodeGenAwaitForeachTests.cs (2)
102var comp = CreateCompilationWithTasksExtensions(source, references: new[] { lib.EmitToImageReference() }); 3588var comp = CreateCompilationWithTasksExtensions(source, references: new[] { lib.EmitToImageReference() });
CodeGen\CodeGenAwaitUsingTests.cs (2)
842var comp = CreateCompilationWithTasksExtensions(comp_cs, references: new[] { libComp.EmitToImageReference() }, options: TestOptions.DebugExe); 879var comp = CreateCompilationWithTasksExtensions(comp_cs, references: new[] { libComp.EmitToImageReference() }, options: TestOptions.DebugExe);
CodeGen\CodeGenDeconstructTests.cs (2)
8447var lib = CreateCompilationWithMscorlib461(lib_cs, references: new[] { missing.EmitToImageReference() }, options: TestOptions.DebugDll); 8461var comp = CreateCompilationWithMscorlib461(source, references: new[] { lib.EmitToImageReference() }, options: TestOptions.DebugDll); // no ValueTuple reference
CodeGen\CodeGenDynamicTests.cs (9)
144return CreateCompilationWithMscorlib40(source, new[] { systemCore ?? SystemCoreRef }, assemblyName: GetUniqueName()).EmitToImageReference(); 277var systemCoreRef = CreateCompilationWithMscorlib40(SystemCoreSource, assemblyName: GetUniqueName()).EmitToImageReference(); 296var systemCoreRef = CreateCompilationWithMscorlib40(SystemCoreSource, assemblyName: GetUniqueName()).EmitToImageReference(); 317var systemCoreRef = CreateCompilationWithMscorlib40(SystemCoreSource, assemblyName: GetUniqueName()).EmitToImageReference(); 456var systemCoreRef = CreateCompilationWithMscorlib40(systemCoreSource, assemblyName: GetUniqueName()).EmitToImageReference(); 485var systemCoreRef = CreateCompilationWithMscorlib40(systemCoreSource, assemblyName: GetUniqueName()).EmitToImageReference(); 11468var vbRef = vb.EmitToImageReference(); 11570var vbRef = vb.EmitToImageReference(); 11679var vbRef = vb.EmitToImageReference();
CodeGen\CodeGenExplicitImplementationTests.cs (1)
128references: new[] { comp1.EmitToImageReference() },
CodeGen\CodeGenExprLambdaTests.cs (2)
6020var reference1 = compilation1.EmitToImageReference(); 6067var reference1 = compilation1.EmitToImageReference();
CodeGen\CodeGenFunctionPointersTests.cs (17)
2526var nopiaReference = CreateCompilation(NoPiaInterfaces).EmitToImageReference(embedInteropTypes: true); 2559var nopiaReference = CreateCompilation(NoPiaInterfaces).EmitToImageReference(embedInteropTypes: true); 2586var nopiaReference = CreateCompilation(NoPiaInterfaces).EmitToImageReference(embedInteropTypes: true); 2593}", references: new[] { nopiaReference }, parseOptions: TestOptions.RegularPreview, options: TestOptions.UnsafeReleaseDll).EmitToImageReference(); 2622internal class A {}", assemblyName: "A").EmitToImageReference(); 2630}", references: new[] { aRef }, assemblyName: "B", parseOptions: TestOptions.RegularPreview, options: TestOptions.UnsafeReleaseDll).EmitToImageReference(); 2652public class A {}", assemblyName: "A").EmitToImageReference(); 2660}", references: new[] { aRef }, assemblyName: "B", parseOptions: TestOptions.RegularPreview, options: TestOptions.UnsafeReleaseDll).EmitToImageReference(); 6280var metadataRef = baseComp.EmitToImageReference(); 7583var comp1 = CreateEmptyCompilation(source2, references: new[] { coreLib.EmitToImageReference() }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 7652var comp1 = CreateEmptyCompilation(source2, references: new[] { coreLib.EmitToImageReference() }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 7737var comp2 = CreateCompilationWithFunctionPointers(source2, new[] { reference.EmitToImageReference() }); 8667validate(comp0.EmitToImageReference()); 10220var usageComp = CreateCompilationWithFunctionPointers(usage, new[] { definitionComp.EmitToImageReference() }); 10274var usageComp = CreateCompilationWithFunctionPointers(usage, new[] { definitionComp.EmitToImageReference() }); 10327var differentComp = CreateCompilationWithFunctionPointers(source2, new[] { refComp.EmitToImageReference() }); 10392var differentComp = CreateCompilationWithFunctionPointers(source2, new[] { refComp.EmitToImageReference() });
CodeGen\CodeGenInParametersTests.cs (11)
2797CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "9"); 2828CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "9"); 2859CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "9"); 2889CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "False"); 2919CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "3"); 4803var libUser = CreateCompilation(libUser_cs, references: new[] { libOrig.EmitToImageReference() }); 4828var comp = CreateCompilation(src, references: new[] { libChanged.EmitToImageReference(), libUser.EmitToImageReference() }); 4869var libUser = CreateCompilation(libUser_cs, references: new[] { libOrig.EmitToImageReference() }); 4908var comp = CreateCompilation(src, references: new[] { libChanged.EmitToImageReference(), libUser.EmitToImageReference() });
CodeGen\CodeGenInterfaceImplementation.cs (1)
365references: new[] { asmRef, comp1.EmitToImageReference() },
CodeGen\CodeGenIterators.cs (1)
3739var verifier = CompileAndVerify(src, expectedOutput: "10 42 42", references: [libComp.EmitToImageReference()]).VerifyDiagnostics();
CodeGen\CodeGenNullCoalescingAssignmentTests.cs (2)
2669var aRef = CreateCompilation(aSource).EmitToImageReference(); 2671var bRef = CreateCompilation(bSource, new[] { aRef }).EmitToImageReference();
CodeGen\CodeGenOverridingAndHiding.cs (3)
2658new[] { referencedCompilation.EmitToImageReference() }, 2763new[] { referencedCompilation.EmitToImageReference() }, 3482references: new[] { asmfile, comp1.EmitToImageReference() },
CodeGen\CodeGenReadonlyStructTests.cs (7)
108var ref1 = comp1.EmitToImageReference(); 326var ref1 = comp1.EmitToImageReference(); 909var clientComp = CreateCompilation("", references: new[] { comp.EmitToImageReference() }); 996var ref1 = comp1.EmitToImageReference(); 1561var comp = CreateCompilation("", references: new[] { externalComp.EmitToImageReference() }); 1831var image = CreateCompilation(external).EmitToImageReference(); 1907var image = CreateCompilation(external).EmitToImageReference();
CodeGen\CodeGenTests.cs (1)
13516comp = CreateCompilation(code, references: new[] { reference.EmitToImageReference() });
CodeGen\CodeGenTupleTest.cs (66)
357references: new[] { comp1.EmitToImageReference() }); 412references: new[] { SystemRuntimeFacadeRef, ValueTupleRef, comp1.EmitToImageReference() }); 572}", references: new[] { comp.EmitToImageReference() }, 753}", references: new[] { comp.EmitToImageReference() }, 1696var comp3 = CreateCompilationWithMscorlib40(source2, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef, compLib.EmitToImageReference() }, 5938var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.EmitToImageReference() }); 13001var comp = CreateCompilationWithMscorlib40(source, references: new[] { libComp.EmitToImageReference() }); 13922var comp4 = CreateCompilationWithMscorlib40(source1, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef, comp2.EmitToImageReference() }, 14087var comp4 = CreateCompilationWithMscorlib40(source1, references: (new[] { comp2.EmitToImageReference() }).Concat(s_valueTupleRefs), 14775var consumer2 = CreateCompilationWithMscorlib40(source, options: TestOptions.ReleaseExe, references: new[] { lib.EmitToImageReference() }); 15036var consumer2 = CreateCompilationWithMscorlib40(source, options: TestOptions.ReleaseExe, references: new[] { lib.EmitToImageReference() }); 15422var consumer2 = CreateCompilationWithMscorlib46(source, options: TestOptions.ReleaseExe, references: new[] { lib.EmitToImageReference() }); 15683var consumer2 = CreateCompilationWithMscorlib46(source, options: TestOptions.ReleaseExe, references: new[] { lib.EmitToImageReference() }); 16770var comp2 = CreateCompilation(source, references: new[] { libComp.EmitToImageReference() }); 19776var comp4 = CreateCompilationWithMscorlib461(source2, references: new[] { comp2.EmitToImageReference() }); 22810var comp = CreateCompilationWithMscorlib40(source, assemblyName: "comp", references: new[] { libComp.EmitToImageReference() }, options: TestOptions.DebugExe); 23174var ref0 = comp0.EmitToImageReference(); 23192var ref1 = comp1.EmitToImageReference(); 23222var ref0v1 = comp0v1.EmitToImageReference(); 23230var ref0v2 = comp0v2.EmitToImageReference(); 23237var ref1 = comp1.EmitToImageReference(); 23248var ref2 = comp2.EmitToImageReference(); 25318var corlibWithoutVTRef = corlibWithoutVT.EmitToImageReference(); 25322var corlibWithVTRef = corlibWithVT.EmitToImageReference(); 25326var libWithVTRef = libWithVT.EmitToImageReference(); 25344var libWithVTRef2 = CreateEmptyCompilation(valuetuple_cs, references: new[] { corlibWithoutVTRef }, parseOptions: parseOptions).EmitToImageReference(); 26422var libRef = useImageReference ? lib.EmitToImageReference() : lib.ToMetadataReference(); 26446references: new[] { comp.EmitToImageReference(), libRef, SystemRuntimeFacadeRef, ValueTupleRef }, 26466var missingContainerRef = useImageReference ? missingContainer.EmitToImageReference() : missingContainer.ToMetadataReference(); 26484var libRef = useImageReference ? lib.EmitToImageReference() : lib.ToMetadataReference(); 26511references: new[] { comp.EmitToImageReference(), libRef, SystemRuntimeFacadeRef, ValueTupleRef, missingContainerRef }, 26529var missingContainerRef = useImageReference ? missingContainer.EmitToImageReference() : missingContainer.ToMetadataReference(); 26543var libRef = useImageReference ? lib.EmitToImageReference() : lib.ToMetadataReference(); 26568references: new[] { comp.EmitToImageReference(), libRef, missingContainerRef, SystemRuntimeFacadeRef, ValueTupleRef }, 26576references: new[] { comp.EmitToImageReference(), libRef, missingContainerRef, SystemRuntimeFacadeRef, ValueTupleRef }, 26590var missingRef = useImageReference ? missing.EmitToImageReference() : missing.ToMetadataReference(); 26608var libRef = useImageReference ? lib.EmitToImageReference() : lib.ToMetadataReference(); 26631var executeComp = CreateCompilation(executable_cs, references: new[] { comp.EmitToImageReference(), libRef, missingRef }, options: TestOptions.DebugExe); 26642var refA = comp.EmitToImageReference(); 26647var refB = comp.EmitToImageReference(); 26681var lib = CreateEmptyCompilation(lib_cs, references: new[] { MscorlibRef, vtLib.EmitToImageReference() }); 26692var comp = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to vt 26701var compWithFakeVt = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeVtLib.EmitToImageReference() }); // reference to fake vt 26716var comp2 = CreateEmptyCompilation(client2_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to vt 26727var comp2WithFakeVt = CreateEmptyCompilation(client2_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeVtLib.EmitToImageReference() }); // reference to fake vt 26783var lib = CreateEmptyCompilation(lib_cs, references: new[] { MscorlibRef, vtLib.EmitToImageReference() }); 26798var comp = CreateEmptyCompilation(client2_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to vt 26809var compWithFakeVt = CreateEmptyCompilation(client2_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeVtLib.EmitToImageReference() }); // reference to fake vt 26847var lib = CreateEmptyCompilation(lib_cs + tuplelib_cs + tupleattributes_cs, references: new[] { MscorlibRef, containerLib.EmitToImageReference() }); 26858var comp = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to container 26867var compWithFakeContainer = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeContainerLib.EmitToImageReference() }); // reference to fake container 26922var lib = CreateEmptyCompilation(lib_cs + tuplelib_cs + tupleattributes_cs, references: new[] { MscorlibRef, containerLib.EmitToImageReference() }); 26933var comp = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to container 26942var compWithFakeContainer = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeContainerLib.EmitToImageReference() }); // reference to fake container 27044var comp1ImageRef = new[] { comp1.EmitToImageReference() }; 27128var comp1ImageRef = new[] { comp1.EmitToImageReference() }; 27202var comp1ImageRef = new[] { comp1.EmitToImageReference() }; 27280var comp1ImageRef = new[] { comp1.EmitToImageReference() }; 27543var comp2 = CreateCompilation(source1, references: new[] { comp1.EmitToImageReference() }, options: TestOptions.DebugDll); 27970var comp2 = CreateCompilation(client, references: new[] { comp.EmitToImageReference() }, targetFramework: TargetFramework.Mscorlib40); 28059var comp2 = CreateCompilation(client, references: new[] { comp.EmitToImageReference() }, targetFramework: TargetFramework.Mscorlib40);
CodeGen\SwitchTests.cs (1)
3039var reference = compVerifier.Compilation.EmitToImageReference();
CodeGen\UnsafeTests.cs (2)
5424var lib = CreateCompilationWithMscorlib461(lib_cs, references: new[] { missing.EmitToImageReference() }, options: TestOptions.DebugDll); 5439var comp = CreateCompilationWithMscorlib461(source, references: new[] { lib.EmitToImageReference() }, options: TestOptions.UnsafeDebugDll);
CodeGen\WinMdDelegateTests.cs (2)
146assemblyName: "WinRTDelegateLibrary").EmitToImageReference(); 154assemblyName: "NonWinRTDelegateLibrary").EmitToImageReference();
Emit\BinaryCompatibility.cs (3)
34var lib0Image = CreateCompilationWithMscorlib46(lib0, options: TestOptions.ReleaseDll, assemblyName: "lib").EmitToImageReference(); 46var lib1Image = CreateCompilationWithMscorlib46(lib1, options: TestOptions.ReleaseDll, assemblyName: "lib").EmitToImageReference(); 58var clientImage = CreateCompilationWithMscorlib46(client, references: new[] { lib0Image }, options: TestOptions.ReleaseDll).EmitToImageReference();
Emit\CompilationEmitTests.cs (33)
1033var piaImageReference = pia.EmitToImageReference(embedInteropTypes: true); 1112var piaImageReference = pia.EmitToImageReference(embedInteropTypes: true); 1808var image1 = comp1.EmitToImageReference(EmitOptions.Default); 1816var image2 = comp2.EmitToImageReference(EmitOptions.Default.WithEmitMetadataOnly(true).WithIncludePrivateMembers(false)); 1890var libImage = libComp.EmitToImageReference(emitOptions); 2131var realImage = comp.EmitToImageReference(EmitOptions.Default); 2162var realImage2 = comp.EmitToImageReference(emitRegularWithoutPrivateMembers); 2190var metadataImage = comp.EmitToImageReference(emitMetadataOnly); 2219var refImage = comp.EmitToImageReference(emitRefOnly); 2268var realImage = comp.EmitToImageReference(EmitOptions.Default); 2278var metadataImage = comp.EmitToImageReference(emitMetadataOnly); 2290var refImage = comp.EmitToImageReference(emitRefOnly); 2335var realImage = comp.EmitToImageReference(EmitOptions.Default); 2345var metadataImage = comp.EmitToImageReference(emitMetadataOnly); 2357var refImage = comp.EmitToImageReference(emitRefOnly); 2402var realImage = comp.EmitToImageReference(EmitOptions.Default); 2412var metadataImage = comp.EmitToImageReference(emitMetadataOnly); 2424var refImage = comp.EmitToImageReference(emitRefOnly); 2463var refImage = comp.EmitToImageReference(emitRefOnly); 2508var refImage = comp.EmitToImageReference(emitRefOnly); 4682var imageRef = refCompilation.EmitToImageReference(); 4766var imageRef = refCompilation.EmitToImageReference(); 4812var imageRef = refCompilation.EmitToImageReference(); 4867var imageRef = refCompilation.EmitToImageReference(); 4899var imageRef = refCompilation.EmitToImageReference(); 4946var imageRef = refCompilation.EmitToImageReference(); 4976var imageRef = refCompilation.EmitToImageReference(); 5024var imageRef = refCompilation.EmitToImageReference(); 5264var ref1 = comp1.EmitToImageReference(); 5268var ref2 = comp2.EmitToImageReference(); 5311var ref1 = comp1.EmitToImageReference(); 5315var ref2 = comp2.EmitToImageReference(); 5549var modRef = CreateCompilation("public class A { }", options: TestOptions.ReleaseModule, assemblyName: "refMod").EmitToImageReference();
Emit\CovariantReturnTests.cs (7)
231return compilation.EmitToImageReference(options: new CodeAnalysis.Emit.EmitOptions(runtimeMetadataVersion: "v5.1")); 337var csharpReference = csharpCompilation.EmitToImageReference(); 393var csharpReference = csharpCompilation.EmitToImageReference(); 497assemblyName: "ref0").VerifyEmitDiagnostics().EmitToImageReference(); 507assemblyName: "ref1").VerifyEmitDiagnostics().EmitToImageReference(); 518assemblyName: "ref1").VerifyEmitDiagnostics().EmitToImageReference(); 529assemblyName: "ref2").VerifyEmitDiagnostics().EmitToImageReference();
Emit\EmitMetadataTests.cs (3)
2715references: new[] { comAssembly.EmitToImageReference(embedInteropTypes: true) }, 2870references: new[] { reference.EmitToImageReference() }, 2922references: new[] { reference.EmitToImageReference() },
Emit\EntryPointTests.cs (1)
1576new MetadataReference[] { netModule.EmitToImageReference() },
Emit\InAttributeModifierTests.cs (46)
45verifier = CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5"); 79CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5"); 103CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5"); 130CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5"); 154CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5"); 180CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5"); 207CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5"); 2533CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 2580CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 2635CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 2683CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 2730CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 2775CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 2820CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 2865CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 2910CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 2955CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3000CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3046CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3092CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3138CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3184CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3232CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3280CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3335CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3383CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3431CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3477CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3523CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3569CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3615CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3661CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5", symbolValidator: validator); 3694CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5"); 3727CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5"); 3770CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5"); 3812CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5"); 4201CompileAndVerify(source: userCode, expectedOutput: "5", references: new[] { testRef.EmitToImageReference() }, options: TestOptions.ReleaseExe, symbolValidator: validator); 4248CompileAndVerify(source: userCode, expectedOutput: "5", references: new[] { testRef.EmitToImageReference() }, options: TestOptions.ReleaseExe, symbolValidator: validator); 4297CompileAndVerify(source: userCode, expectedOutput: "5", references: new[] { testRef.EmitToImageReference() }, options: TestOptions.ReleaseExe, symbolValidator: validator); 4349CompileAndVerify(source: userCode, expectedOutput: "5", references: new[] { testRef.EmitToImageReference() }, options: TestOptions.ReleaseExe, symbolValidator: validator); 4402CompileAndVerify(source: userCode, expectedOutput: "5", references: new[] { testRef.EmitToImageReference() }, options: TestOptions.ReleaseExe, symbolValidator: validator); 4414var ref1 = CreateCompilation(refCode).EmitToImageReference(); 4415var ref2 = CreateCompilation(refCode).EmitToImageReference(); 4457var corlibWithoutInAttributeRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 4465var ref1 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutInAttributeRef }).EmitToImageReference(); 4466var ref2 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutInAttributeRef }).EmitToImageReference();
Emit\NoPiaEmbedTypes.cs (66)
76references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 121references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 198references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 267references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 327references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 378references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 428references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 477references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 527references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 577references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 627references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 677references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 727references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 825compilation = CreateEmptyCompilation(consumer, references: new MetadataReference[] { MscorlibRef_v20, piaCompilation.EmitToImageReference(embedInteropTypes: true) }, options: TestOptions.ReleaseExe); 875compilation = CreateEmptyCompilation(consumer, references: new MetadataReference[] { MscorlibRef_v20, piaCompilation.EmitToImageReference(embedInteropTypes: true) }, options: TestOptions.DebugExe); 1165references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 1724references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 1831references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 1920references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 2008new MetadataReference[] { MscorlibRef_v4_0_30316_17626, piaCompilation.EmitToImageReference(embedInteropTypes: true) }, 2069references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 2136references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 2192references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 2308references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 2395references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 2476references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 2539references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 2701references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 2773references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 2837references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 2898references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 2964references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 3030references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 3065var dispIdDefinition = CreateCompilation(dispId, options: TestOptions.ReleaseDll, assemblyName: "DispId").EmitToImageReference(aliases: ImmutableArray.Create("dispId")); 3109references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 3143var empty = CreateCompilation("", options: TestOptions.ReleaseDll).EmitToImageReference(); 3310references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 3377references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 3445references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 3595references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 3660references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 3717references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 3764references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 3846references: new MetadataReference[] { piaCompilation1.EmitToImageReference(embedInteropTypes: true), 3847piaCompilation2.EmitToImageReference(embedInteropTypes: true)}); 3910references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 4162references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 4246references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 4323references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 4388references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 4453references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true), CSharpRef }); 4513references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true), CSharpRef }); 4573references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true), CSharpRef }); 4639references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true), CSharpRef }); 4721references: new MetadataReference[] { piaCompilation2.EmitToImageReference(embedInteropTypes: true) }); 4796references: new MetadataReference[] { piaCompilation2.EmitToImageReference(embedInteropTypes: true) }); 4893references: new MetadataReference[] { piaCompilation2.EmitToImageReference(embedInteropTypes: true) }); 4971references: new MetadataReference[] { piaCompilation2.EmitToImageReference(embedInteropTypes: true) }); 5043references: new MetadataReference[] { piaCompilation2.EmitToImageReference(embedInteropTypes: true) }); 5209references: new MetadataReference[] { piaCompilation2.EmitToImageReference(embedInteropTypes: true) }); 5260references: new MetadataReference[] { piaCompilation1.EmitToImageReference(embedInteropTypes: true), SystemRuntimeFacadeRef, ValueTupleRef }); 5288references: new MetadataReference[] { piaCompilation2.EmitToImageReference(embedInteropTypes: true), piaCompilation1.ToMetadataReference(), ValueTupleRef, SystemRuntimeFacadeRef }); 5296references: new MetadataReference[] { piaCompilation2.EmitToImageReference(), piaCompilation1.ToMetadataReference(), ValueTupleRef, SystemRuntimeFacadeRef }); 5370references: new MetadataReference[] { piaCompilation2.EmitToImageReference(embedInteropTypes: true) }); 5641references: new MetadataReference[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 5707var piaRef2 = piaCompilation.EmitToImageReference(embedInteropTypes: true);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (73)
CodeGen\CodeGenSpanBasedStringConcatTests.cs (9)
639var corlib = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 714var corlib = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 788var corlib = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 2180var corlib = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 2258var corlib = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 2335var corlib = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 4833var corlib = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 4914var corlib = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 4994var corlib = CreateEmptyCompilation(corlib_cs).EmitToImageReference();
Emit\EditAndContinue\AssemblyReferencesTests.cs (3)
398var compilation0 = CreateEmptyCompilation(src0, new[] { MscorlibRef, lib0.EmitToImageReference() }, assemblyName: "C", options: TestOptions.DebugDll); 399var compilation1 = compilation0.WithSource(src1).WithReferences(new[] { MscorlibRef, lib1.EmitToImageReference() }); 400var compilation2 = compilation1.WithSource(src2).WithReferences(new[] { MscorlibRef, lib2.EmitToImageReference() });
Emit\EditAndContinue\SymbolMatcherTests.cs (7)
31var reference = compilation.EmitToImageReference(); 547var peRef0 = compilation0.EmitToImageReference(); 945var peRef0 = compilation0.EmitToImageReference(); 1102var peRef0 = compilation0.EmitToImageReference(); 1523var peRef0 = compilation0.EmitToImageReference(); 1583var peRef0 = compilation0.EmitToImageReference(); 1653var peRef0 = compilation0.EmitToImageReference();
Emit\NumericIntPtrTests.cs (10)
939var ref2 = comp.EmitToImageReference(); 1001var ref2 = comp.EmitToImageReference(); 1194var ref2 = comp.EmitToImageReference(); 2812var ref0 = comp.EmitToImageReference(); 2842var ref0 = comp.EmitToImageReference(); 3057var ref2 = comp.EmitToImageReference(); 9031var refA = comp.EmitToImageReference(); 10336comp = CreateEmptyCompilation(source, references: new[] { corlib.EmitToImageReference() }, parseOptions: parseOptions); 10722var image = comp.EmitToImageReference(); 11153var comp = CreateEmptyCompilation(source, references: new[] { corlib.EmitToImageReference() });
Emit\UnmanagedTypeModifierTests.cs (26)
660}", references: new[] { reference.Compilation.EmitToImageReference() }, expectedOutput: @" 685}", references: new[] { parent.Compilation.EmitToImageReference() }, symbolValidator: module => 702}", references: new[] { parent.Compilation.EmitToImageReference(), child.Compilation.EmitToImageReference() }, expectedOutput: @" 740}", references: new[] { reference.Compilation.EmitToImageReference() }, expectedOutput: "Child"); 763}", references: new[] { parent.Compilation.EmitToImageReference() }, symbolValidator: module => 779}", references: new[] { parent.Compilation.EmitToImageReference(), child.Compilation.EmitToImageReference() }, expectedOutput: "Child"); 815}", references: new[] { reference.Compilation.EmitToImageReference() }, expectedOutput: "Child"); 838}", references: new[] { parent.Compilation.EmitToImageReference() }, symbolValidator: module => 854}", references: new[] { parent.Compilation.EmitToImageReference(), child.Compilation.EmitToImageReference() }, expectedOutput: "Child"); 890}", references: new[] { reference.Compilation.EmitToImageReference() }, expectedOutput: "Child"); 913}", references: new[] { parent.Compilation.EmitToImageReference() }, symbolValidator: module => 929}", references: new[] { parent.Compilation.EmitToImageReference(), child.Compilation.EmitToImageReference() }, expectedOutput: "Child"); 966}", references: new[] { reference.Compilation.EmitToImageReference() }, expectedOutput: "Child"); 989}", references: new[] { parent.Compilation.EmitToImageReference() }, symbolValidator: module => 1006}", references: new[] { parent.Compilation.EmitToImageReference(), child.Compilation.EmitToImageReference() }, expectedOutput: "Child"); 1086references: new[] { reference.Compilation.EmitToImageReference() }, 1108var ref1 = CreateCompilation(refCode).EmitToImageReference(); 1109var ref2 = CreateCompilation(refCode).EmitToImageReference(); 1143var corlibWithoutUnmanagedTypeRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 1151var ref1 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutUnmanagedTypeRef }).EmitToImageReference(); 1152var ref2 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutUnmanagedTypeRef }).EmitToImageReference();
PDB\PDBUsingTests.cs (18)
808var refA = comp.EmitToImageReference(aliases: ImmutableArray.Create("A2")); 858var refA1 = comp.EmitToImageReference(aliases: ImmutableArray.Create("A2")); 868var refA4 = comp.EmitToImageReference(aliases: ImmutableArray.Create("A5")); 944var refA1 = comp.EmitToImageReference(aliases: ImmutableArray.Create("A2")); 954var refA4 = comp.EmitToImageReference(aliases: ImmutableArray.Create("A5")); 1030var refA1 = comp.EmitToImageReference(aliases: ImmutableArray.Create("A2", "A3")); 1040var refA4 = comp.EmitToImageReference(aliases: ImmutableArray.Create("A5")); 1123var refA1 = comp.EmitToImageReference(aliases: ImmutableArray.Create("A2", "A3")); 1133var refA4 = comp.EmitToImageReference(aliases: ImmutableArray.Create("A5")); 1216var refA1 = comp.EmitToImageReference(aliases: ImmutableArray.Create("A2")); 1226var refA4 = comp.EmitToImageReference(aliases: ImmutableArray.Create("A5")); 1308var refA1 = comp.EmitToImageReference(aliases: ImmutableArray.Create("A2")); 1318var refA4 = comp.EmitToImageReference(aliases: ImmutableArray.Create("A5")); 2599var libRef = CreateCompilation(libSource, assemblyName: "Lib").EmitToImageReference(); 2694var libRef = lib.EmitToImageReference(aliases: ImmutableArray.Create("Q")); 3153var libRef = CreateCompilation(sourceLib, assemblyName: "ImportedNoPiaTypesAssemblyName").EmitToImageReference(embedInteropTypes: true); 3225var libRef1 = CreateCompilation(sourceLib1).EmitToImageReference(); 3226var libRef2 = CreateCompilation(sourceLib2, new[] { libRef1 }, assemblyName: "LibRef2").EmitToImageReference();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (405)
Attributes\AttributeTests.cs (41)
116var compWithReferenceToLib = CreateCompilation(reference_cs, references: new[] { origLibComp.EmitToImageReference() }); 119var newLibComp = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.EmitToImageReference() }, assemblyName: "lib"); 149var compWithReferenceToLib = CreateCompilation(reference_cs, references: new[] { origLibComp.EmitToImageReference() }); 152var newLibComp = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.EmitToImageReference() }, assemblyName: "lib"); 189var compWithReferenceToLib = CreateCompilation(reference_cs, references: new[] { origLibComp.EmitToImageReference() }); 192var newLibComp = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.EmitToImageReference() }, assemblyName: "lib"); 238var compWithReferenceToLib = CreateCompilation(reference_cs, references: new[] { origLibComp.EmitToImageReference() }); 241var newLibComp = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.EmitToImageReference() }, assemblyName: "lib"); 274var compWithReferenceToLib = CreateCompilation(reference_cs, references: new[] { origLibComp.EmitToImageReference() }); 278references: new[] { compWithReferenceToLib.EmitToImageReference(), newComp.EmitToImageReference() }, assemblyName: "lib"); 311var compWithReferenceToLib = CreateCompilation(reference_cs, references: new[] { origLibComp.EmitToImageReference() }); 314var newLibComp = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.EmitToImageReference(), newComp.EmitToImageReference() }, assemblyName: "lib"); 320var newLibComp3 = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.EmitToImageReference(), newComp.EmitToImageReference() }, assemblyName: "lib"); 342var compWithDerivedAndReferenceToLib = CreateCompilation(typeForward_cs + derivedDefinition_cs, references: new[] { origLibComp.EmitToImageReference() }); 348var newLibComp = CreateCompilation(typeForward_cs, references: new[] { compWithDerivedAndReferenceToLib.EmitToImageReference(), compWithC.EmitToImageReference() }, assemblyName: "lib"); 384var compWithReferenceToLib = CreateCompilation(reference_cs, references: new[] { origLibComp.EmitToImageReference() }); 388references: new[] { compWithReferenceToLib.EmitToImageReference(), newComp.EmitToImageReference() }, assemblyName: "lib"); 422var compWithReferenceToLib = CreateCompilation(reference_cs, references: new[] { origLibComp.EmitToImageReference() }); 425var newLibComp = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.EmitToImageReference(), newComp.EmitToImageReference() }, assemblyName: "lib"); 457var compWithReferenceToLib = CreateCompilation(reference_cs, references: new[] { origLibComp.EmitToImageReference() }); 460var newLibComp = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.EmitToImageReference(), newComp.EmitToImageReference() }, assemblyName: "lib"); 997CreateCompilation(usageSource, references: new[] { definitionComp.EmitToImageReference() }, options: WithNullableEnable()) 5707var r1 = c1.EmitToImageReference(); 5710var r2 = c2.EmitToImageReference(); 8555var ref1 = comp.EmitToImageReference(); 8594var ref1 = comp.EmitToImageReference(); 9918var comp2 = CreateCompilation("", new[] { comp.EmitToImageReference() }); 10236var libRef = CreateCompilation(lib_cs, parseOptions: TestOptions.RegularPreview).EmitToImageReference(); 10286var libRef = CreateCompilation(lib_cs, parseOptions: TestOptions.RegularPreview).EmitToImageReference(); 10312var libRef = CreateCompilation(lib_cs, parseOptions: TestOptions.RegularPreview).EmitToImageReference(); 10338var libRef = CreateCompilation(lib_cs, parseOptions: TestOptions.RegularPreview).EmitToImageReference(); 10469comp2 = CreateCompilation(source2, references: new[] { comp1.EmitToImageReference() }, parseOptions: TestOptions.Regular9); 10540comp2 = CreateCompilation(source2, references: new[] { comp1.EmitToImageReference() }, parseOptions: TestOptions.Regular9); 11063var comp2 = CreateVisualBasicCompilation(vbSource, referencedAssemblies: TargetFrameworkUtil.GetReferences(TargetFramework.Standard).Concat(comp.EmitToImageReference()));
Attributes\AttributeTests_Assembly.cs (32)
422compilation = CreateCompilationWithMscorlib40("", new MetadataReference[] { compilation.EmitToImageReference() }, TestOptions.ReleaseDll, assemblyName: assemblyNameBase + "20"); 451compilation = CreateCompilationWithMscorlib40("", new MetadataReference[] { compilation.EmitToImageReference() }, TestOptions.ReleaseDll, assemblyName: assemblyNameBase + "25"); 470compilation = CreateCompilationWithMscorlib40("", new MetadataReference[] { compilation.EmitToImageReference() }, TestOptions.ReleaseDll, assemblyName: assemblyNameBase + "40"); 505compilation = CreateCompilationWithMscorlib40("", new MetadataReference[] { compilation.EmitToImageReference() }, TestOptions.ReleaseDll, assemblyName: assemblyNameBase + "60"); 815", options: TestOptions.ReleaseDll, references: new[] { hash_module_Comp.EmitToImageReference() }); 1434var netmodule2Ref = compilation.EmitToImageReference(); 1841var assembly = CreateCompilation(assemblySrc, new[] { module.EmitToImageReference() }, assemblyName: "C"); 1946var assembly = CreateCompilation(assemblySrc, new[] { module.EmitToImageReference() }, assemblyName: "C"); 1971var assembly = CreateCompilation(assemblySrc, new[] { module1.EmitToImageReference(), module2.EmitToImageReference() }, assemblyName: "C"); 1996var assembly = CreateCompilation(assemblySrc, new[] { module1.EmitToImageReference() }, assemblyName: "C"); 2024var assembly = CreateCompilation(assemblySrc, new[] { module1.EmitToImageReference(), module2.EmitToImageReference() }, assemblyName: "C"); 2049var assembly = CreateCompilation(assemblySrc, new[] { module1.EmitToImageReference() }, assemblyName: "C"); 2077var assembly = CreateCompilation(assemblySrc, new[] { module1.EmitToImageReference(), module2.EmitToImageReference() }, assemblyName: "C"); 2100var assembly = CreateCompilation(assemblySrc, new[] { module1.EmitToImageReference() }, assemblyName: "C"); 2120references: new MetadataReference[] { compMod1.EmitToImageReference(), compMod2.EmitToImageReference() }, 2152references: new MetadataReference[] { compMod1.EmitToImageReference(), compMod2.EmitToImageReference() }, 2182references: new MetadataReference[] { compMod1.EmitToImageReference(), compMod2.EmitToImageReference() }, 2214references: new MetadataReference[] { compMod1.EmitToImageReference(), compMod2.EmitToImageReference() }, 2239references: new MetadataReference[] { compMod1.EmitToImageReference() }, 2286var attributeDefinition1 = CreateCompilation(attribute1, options: TestOptions.ReleaseDll, assemblyName: "A1").EmitToImageReference(); 2291var moduleWithAttribute = CreateCompilation(module, references: new[] { attributeDefinition1 }, options: TestOptions.ReleaseModule, assemblyName: "M1").EmitToImageReference(); 2318var attributeDefinition2 = CreateCompilation(attribute2, options: TestOptions.ReleaseDll, assemblyName: "A1").EmitToImageReference(); 2337var c1Definition = CreateCompilation(c1, options: TestOptions.ReleaseDll, assemblyName: "A1").EmitToImageReference(); 2347var module1WithAttribute = CreateCompilation(module1, references: new[] { c1Definition }, options: TestOptions.ReleaseModule, assemblyName: "M1").EmitToImageReference(); 2376var module2WithAttribute = CreateCompilation(module2, references: new[] { c1Definition }, options: TestOptions.ReleaseModule, assemblyName: "M1").EmitToImageReference();
Attributes\AttributeTests_CallerInfoAttributes.cs (2)
681var ref1 = comp1.EmitToImageReference(); 1567var ref1 = comp1.EmitToImageReference();
Attributes\AttributeTests_Dynamic.cs (2)
1191var ref0 = comp.EmitToImageReference(); 1228var ref0 = comp.EmitToImageReference();
Attributes\AttributeTests_Embedded.cs (1)
505var compilation2 = CreateCompilation("", references: new[] { compilation1.EmitToImageReference() });
Attributes\AttributeTests_Experimental.cs (2)
89var comp2A = CreateCompilation(source2, new[] { comp1.EmitToImageReference() }); 559var comp2 = CreateCompilationWithMscorlib40AndSystemCore(source2, references: new[] { comp1.EmitToImageReference() });
Attributes\AttributeTests_IsByRefLike.cs (2)
611var compilation_BinaryReference = CreateCompilationWithMscorlib40(code, options: options, references: new[] { comAssembly.EmitToImageReference(embedInteropTypes: true) }); 914CreateCompilation(text, new[] { libComp.EmitToImageReference() }).VerifyEmitDiagnostics(
Attributes\AttributeTests_IsUnmanaged.cs (8)
132}").EmitToImageReference(); 159}").EmitToImageReference(); 185}").EmitToImageReference(); 221}").EmitToImageReference(); 249}").EmitToImageReference(); 276}").EmitToImageReference(); 302}").EmitToImageReference(); 339}").EmitToImageReference();
Attributes\AttributeTests_LifetimeAnnotation.cs (1)
56var ref0 = comp.EmitToImageReference();
Attributes\AttributeTests_MarshalAs.cs (1)
1532references: new[] { comp1.EmitToImageReference() }, // it has to be real assembly, Comp2comp reference OK
Attributes\AttributeTests_NativeInteger.cs (4)
63var ref0 = comp.EmitToImageReference(); 835var ref1 = comp.EmitToImageReference(); 845var ref2 = comp.EmitToImageReference(); 1386var ref1 = comp.EmitToImageReference();
Attributes\AttributeTests_Nullable.cs (27)
43Func<CSharpCompilation, MetadataReference> getReference = c => useImageReferences ? c.EmitToImageReference() : c.ToMetadataReference(); 108Func<CSharpCompilation, MetadataReference> getReference = c => useImageReferences ? c.EmitToImageReference() : c.ToMetadataReference(); 206Func<CSharpCompilation, MetadataReference> getReference = c => useImageReferences ? c.EmitToImageReference() : c.ToMetadataReference(); 372var ref0 = comp0.EmitToImageReference(); 529var refA = comp.EmitToImageReference(); 564var refA = comp.EmitToImageReference(); 598var ref0 = comp0.EmitToImageReference(); 646var ref0 = comp0.EmitToImageReference(); 699var ref0 = comp0.EmitToImageReference(); 1103var comp2 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), parseOptions: TestOptions.Regular8, references: new[] { comp.EmitToImageReference() }); 1158var comp2 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), parseOptions: TestOptions.Regular8, references: new[] { comp.EmitToImageReference() }); 1208var comp2 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), parseOptions: TestOptions.Regular8, references: new[] { comp.EmitToImageReference() }); 1381comp2 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), parseOptions: TestOptions.Regular8, references: new[] { comp.EmitToImageReference() }); 1434var comp2 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), parseOptions: TestOptions.Regular8, references: new[] { comp.EmitToImageReference() }); 1489comp2 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), parseOptions: TestOptions.Regular8, references: new[] { comp.EmitToImageReference() }); 1546comp2 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), parseOptions: TestOptions.Regular8, references: new[] { comp.EmitToImageReference() }); 2240var ref0 = comp0.EmitToImageReference(); 2493var ref0 = comp0.EmitToImageReference(); 4145var ref0 = comp.EmitToImageReference(); 4162var ref1 = comp.EmitToImageReference(); 4250var ref0 = comp.EmitToImageReference(); 4294var ref0 = comp.EmitToImageReference(); 4348var ref0 = comp.EmitToImageReference(); 4394var ref0 = comp0.EmitToImageReference(); 4794var comp2 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), parseOptions: TestOptions.Regular8, references: new[] { comp.EmitToImageReference() }); 4924var comp2 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), parseOptions: TestOptions.Regular8, references: new[] { comp.EmitToImageReference() }); 5284return comp.EmitToImageReference();
Attributes\AttributeTests_NullableContext.cs (4)
53var ref0 = comp.EmitToImageReference(); 168var ref0 = comp.EmitToImageReference(); 263var ref0 = comp0.EmitToImageReference(); 276var ref1 = comp1.EmitToImageReference();
Attributes\AttributeTests_NullablePublicOnly.cs (3)
54var ref1 = comp.EmitToImageReference(); 239var ref0 = comp.EmitToImageReference(); 464var ref0 = comp.EmitToImageReference();
Attributes\AttributeTests_ReadOnlyStruct.cs (1)
603var compilation_BinaryReference = CreateCompilationWithMscorlib40(code, options: options, references: new[] { comAssembly.EmitToImageReference(embedInteropTypes: true) });
Attributes\AttributeTests_RefReadOnly.cs (3)
1330var compilation_BinaryReference = CreateCompilationWithMscorlib40(code, options: options, references: new[] { comAssembly.EmitToImageReference(embedInteropTypes: true) }); 1519").EmitToImageReference(); 2224").EmitToImageReference();
Attributes\AttributeTests_RefSafetyRules.cs (2)
152var refA = CreateCompilation(sourceA, parseOptions: TestOptions.Regular10).EmitToImageReference(); 203var refA = CreateCompilation(sourceA).EmitToImageReference();
Attributes\AttributeTests_Synthesized.cs (7)
123var reference = CreateCompilation(source).EmitToImageReference(); 145var reference = CreateCompilation(source, options: TestOptions.UnsafeReleaseDll).EmitToImageReference(); 1800var reference = CreateCompilationWithMscorlib461(source, options: referenceOptions).EmitToImageReference(options: new EmitOptions(metadataOnly: true)); 1899var reference = CreateCompilationWithMscorlib461(source, options: referenceOptions).EmitToImageReference(options: new EmitOptions(metadataOnly: true)); 1935var mslibRef = mslibComp.EmitToImageReference(); 1939var mslibNoStringRef = mslibNoStringComp.EmitToImageReference(); 1956var diagLibRef = diagLibComp.EmitToImageReference();
Attributes\AttributeTests_Tuples.cs (2)
178var ref0 = comp.EmitToImageReference(); 216var ref0 = comp.EmitToImageReference();
Attributes\AttributeTests_WellKnownAttributes.cs (28)
576var libAssemblyRef = libComp.EmitToImageReference(); 3849CompileAndVerify(source2, references: new[] { compDll.EmitToImageReference() }, expectedOutput: expectedOutput); 3957CompileAndVerify(source2, references: new[] { compDll.EmitToImageReference() }, expectedOutput: expectedOutput); 4032CreateCompilation(source2, references: new[] { compDll.EmitToImageReference() }).VerifyDiagnostics( 4111CreateCompilation(source2, references: new[] { compDll.EmitToImageReference() }).VerifyDiagnostics( 4274CreateCompilation(source2, references: new[] { compDll.EmitToImageReference() }).VerifyDiagnostics( 4893var client2 = CreateCompilation("", references: new[] { lib_comp.EmitToImageReference() }); 4968var comp = CreateCompilationWithMscorlib46(source, references: new[] { lib.EmitToImageReference() }); 4970var comp2 = CreateCompilationWithMscorlib46(errors, references: new[] { comp.EmitToImageReference() }); 8602verify(comp1.EmitToImageReference()); 8657verify(comp1.EmitToImageReference()); 8701verify(comp1.EmitToImageReference()); 8744verify(comp1.EmitToImageReference()); 8843verifyReference(comp1.EmitToImageReference(), options, expectedDiagnostics); 8896verify(comp1.EmitToImageReference()); 8944verify(comp1.EmitToImageReference()); 9023verify(comp1.EmitToImageReference()); 9078verify(comp1.EmitToImageReference()); 9127verify(comp1.EmitToImageReference()); 9178verify(comp1.EmitToImageReference()); 9507verify(comp1.EmitToImageReference()); 9650var comp2 = CreateCompilation(source2, new[] { comp1.EmitToImageReference() }); 9872compilation2 = CreateEmptyCompilation(source2, WinRtRefs.Concat(new[] { compilation1.EmitToImageReference() }), TestOptions.ReleaseDll); 9907references: WinRtRefs.Append(CreateEmptyCompilation(new[] { libSrc }, WinRtRefs, TestOptions.ReleaseDll).EmitToImageReference()).ToArray(), 9979var compilation2 = CreateCompilationWithMscorlib40AndSystemCore(source2, new[] { compilation1.EmitToImageReference() }); 10062var compilation2 = CreateCompilationWithMscorlib40AndSystemCore(source2, new[] { compilation1.EmitToImageReference() }); 12745var comp = CompileAndVerify(source, references: new[] { metadata_comp.EmitToImageReference() }); 13599var refA = comp.EmitToImageReference();
Attributes\InternalsVisibleToAndStrongNameTests.cs (14)
988var other = CreateCompilation(cs0281, references: new[] { friendClass.EmitToImageReference() }, assemblyName: "cs0281", options: TestOptions.SigningReleaseDll, parseOptions: parseOptions); 1032var other = CreateCompilation(cs0281, references: new[] { friendClass.EmitToImageReference() }, assemblyName: "cs0281", options: TestOptions.SigningReleaseDll, parseOptions: parseOptions); 1482references: new[] { comp.EmitToImageReference() }, 1604var reference = other.EmitToImageReference(); 1628var reference = other.EmitToImageReference(); 1825references: new[] { other.EmitToImageReference() }, 1848references: new[] { other.EmitToImageReference() }, 2897var libRef = CreateCompilation(lib_cs, options: TestOptions.SigningReleaseDll, parseOptions: parseOptions).EmitToImageReference(); 2934var libRef = CreateCompilation(lib_cs, options: TestOptions.SigningReleaseDll).EmitToImageReference(); 2986comp = CreateCompilation(source1, new[] { lib.EmitToImageReference() }, assemblyName: "Issue57742_01"); 3021comp = CreateCompilation(source1, new[] { lib.EmitToImageReference() }, assemblyName: "Issue57742_02"); 3070MetadataReference imageReference = lib.EmitToImageReference(); 3194MetadataReference imageReference = lib.EmitToImageReference(); 3253comp = CreateCompilation(source1, new[] { lib.EmitToImageReference() }, assemblyName: "Issue57742_05");
FieldKeywordTests.cs (1)
8296var refA = comp.EmitToImageReference(
FirstClassSpanTests.cs (5)
1601var comp1 = CreateCompilation(source1).VerifyDiagnostics().EmitToImageReference(); 2049.EmitToImageReference(); 2148.EmitToImageReference(); 2386.EmitToImageReference(); 2619.EmitToImageReference();
FlowAnalysis\RegionAnalysisTests.cs (1)
8047var libraryReference = CreateCompilation(libSource).EmitToImageReference();
FlowAnalysis\StructTests.cs (3)
727var moduleReference = comp1.EmitToImageReference(); 770var moduleReference = comp1.EmitToImageReference(); 803var moduleReference = comp1.EmitToImageReference();
OverloadResolutionPriorityTests.cs (4)
258var derivedReference = useMetadataReference ? derivedComp.ToMetadataReference() : derivedComp.EmitToImageReference(); 307var derivedReference = useMetadataReference ? derivedComp.ToMetadataReference() : derivedComp.EmitToImageReference(); 1789var vbRef = vb.EmitToImageReference(); 1797var verifier = CompileAndVerify(executable, references: [attrRef.EmitToImageReference(), vbRef]).VerifyDiagnostics();
RefReadonlyParameterTests.cs (17)
1305var comp1Ref = comp1.EmitToImageReference(); 1330var comp1bRef = comp1b.EmitToImageReference(); 1372var comp1v1Ref = comp1v1.EmitToImageReference(); 1387var comp2Ref = comp2.EmitToImageReference(); 1413var comp4Ref = comp4.EmitToImageReference(); 1419var comp1v2Ref = comp1v2.EmitToImageReference(); 1433var comp1v3Ref = comp1v3.EmitToImageReference(); 1440var comp1v4Ref = comp1v4.EmitToImageReference(); 1467var comp1Ref = comp1.EmitToImageReference(); 4547? CreateCompilation(source2, new[] { CreateCompilation(source1).VerifyDiagnostics(warning1).EmitToImageReference() }, options: TestOptions.ReleaseExe) 4598? CreateCompilation(source2, new[] { CreateCompilation(source1).VerifyDiagnostics(warning1).EmitToImageReference() }, options: TestOptions.ReleaseExe) 4736? CreateCompilation(source2, new[] { CreateCompilation(source1).VerifyDiagnostics(warnings1).EmitToImageReference() }, options: TestOptions.ReleaseExe) 4837? CreateCompilation(source2, new[] { CreateCompilation(source1).VerifyDiagnostics(warning1).EmitToImageReference() }, options: TestOptions.ReleaseExe) 5251var comp1Ref = comp1.EmitToImageReference(); 6675var comp1v1Ref = emit ? comp1v1.EmitToImageReference() : comp1v1.ToMetadataReference(); 6684var comp1v2Ref = emit ? comp1v2.EmitToImageReference() : comp1v2.ToMetadataReference(); 6693var comp2Ref = emit ? comp2.EmitToImageReference() : comp2.ToMetadataReference();
RefStructInterfacesTests.cs (6)
645MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()]; 949MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()]; 1063MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()]; 1544MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()]; 1639MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()]; 2120MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()];
Semantics\CollectionExpressionTests.cs (12)
9199var refA = comp.EmitToImageReference(); 9221var refB = comp.EmitToImageReference(); 12185var refA = comp.EmitToImageReference(); 12197var refB = comp.EmitToImageReference(); 13703var reference = CreateEmptyCompilation(runtime, assemblyName: "System.Runtime").VerifyDiagnostics().EmitToImageReference(); 15589var refA = comp.EmitToImageReference(); 16378var refA = comp.EmitToImageReference(); 16392var refB = comp.EmitToImageReference(); 19858var refA = comp.EmitToImageReference(); 19873var refB = comp.EmitToImageReference(); 22562var refA = comp.EmitToImageReference(); 25651var refA = comp.EmitToImageReference();
Semantics\ExperimentalAttributeTests.cs (72)
55: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 103var comp = CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 130var attrRef = attrComp.EmitToImageReference(); 155var attrRef = attrComp.EmitToImageReference(); 169var comp = CreateCompilation(src, references: new[] { CreateCompilation(libSrc, references: new[] { attrRef }).EmitToImageReference(), attrRef }); 195var attrRef = attrComp.EmitToImageReference(); 211var comp = CreateCompilation(src, references: new[] { CreateCompilation(libSrc, references: new[] { attrRef }).EmitToImageReference(), attrRef }); 231var attrRef = attrComp.EmitToImageReference(); 237var moduleRef = moduleComp.EmitToImageReference(); 261var attrRef = attrComp.EmitToImageReference(); 267var moduleRef = moduleComp.EmitToImageReference(); 279var comp = CreateCompilation(src, references: new[] { CreateCompilation(libSrc, references: new[] { attrRef, moduleRef }).EmitToImageReference(), attrRef }); 316var comp = CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 346var comp = CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 372var comp = CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 387var attrRef = attrComp.EmitToImageReference(); 412var attrRef = attrComp.EmitToImageReference(); 426var comp = CreateCompilation(src, references: new[] { CreateCompilation(libSrc, references: new[] { attrRef }).EmitToImageReference(), attrRef }); 452var attrRef = attrComp.EmitToImageReference(); 480var attrRef = attrComp.EmitToImageReference(); 496var comp = CreateCompilation(src, references: new[] { CreateCompilation(libSrc, references: new[] { attrRef }).EmitToImageReference(), attrRef }); 522var attrRef = attrComp.EmitToImageReference(); 535var moduleRef = moduleComp.EmitToImageReference(); 548var assemblyRef = assemblyComp.EmitToImageReference(); 571var attrRef = attrComp.EmitToImageReference(); 604var attrRef = attrComp.EmitToImageReference(); 621var comp = CreateCompilation(src, references: new[] { CreateCompilation(libSrc, references: new[] { attrRef }).EmitToImageReference(), attrRef }); 644var attrRef = attrComp.EmitToImageReference(); 672var attrRef = attrComp.EmitToImageReference(); 691var comp = CreateCompilation(src, references: new[] { CreateCompilation(libSrc, references: new[] { attrRef }).EmitToImageReference(), attrRef }); 732: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 779: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 822var comp = CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 855: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 880: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 888var missingRef = CreateCompilation("public class Base { }", assemblyName: "missing").EmitToImageReference(); 901var comp = CreateCompilation(src, references: new[] { CreateCompilation(libSrc, references: new[] { missingRef }).EmitToImageReference() }); 918var attrRef = CreateCompilation(experimentalAttributeSrc).EmitToImageReference(); 955var attrRef = CreateCompilation(experimentalAttributeSrc).EmitToImageReference(); 983var attrRef = CreateCompilation(experimentalAttributeSrc).EmitToImageReference(); 1020var attrRef = CreateCompilation(experimentalAttributeSrc).EmitToImageReference(); 1062: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 1091: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 1122: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 1153: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 1184: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 1215: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 1246: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 1273: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 1297: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 1323: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 1346: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 1366: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 1744var comp = CreateCompilation(src, references: new[] { libComp.EmitToImageReference() }); 1804var comp = CreateCompilation(src, references: new[] { libComp.EmitToImageReference() }); 1845var comp = CreateCompilation(src, references: new[] { libComp.EmitToImageReference() }); 1886var comp = CreateCompilation(src, references: new[] { libComp.EmitToImageReference() }); 1968: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 2049: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 2079: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 2113: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 2143: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 2176: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 2206: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 2236: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 2263: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 2294: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 2337: CreateCompilation(src, references: new[] { CreateCompilation(libsSrc).EmitToImageReference() }); 2407: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 2436: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 2466: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() }); 2496: CreateCompilation(src, references: new[] { CreateCompilation(new[] { libSrc, experimentalAttributeSrc }).EmitToImageReference() });
Semantics\LockTests.cs (3)
1513.EmitToImageReference(); 1556.EmitToImageReference(); 1587.EmitToImageReference();
Semantics\ParamsCollectionTests.cs (29)
1039var myCollectionRef = myCollection.EmitToImageReference(); 1064var comp = CreateCompilation(src, references: [myCollectionRef, builder.EmitToImageReference()], targetFramework: TargetFramework.Net80, options: TestOptions.ReleaseExe); 4019verify(comp1.EmitToImageReference()); 4086verify(comp1.EmitToImageReference()); 4201verify(comp1.EmitToImageReference()); 4325verify(comp1.EmitToImageReference()); 4401verify(comp1.EmitToImageReference()); 6347var comp1Ref = CreateCompilation(src1).EmitToImageReference(); 6397var comp1Ref = CreateCompilation(src1).EmitToImageReference(); 6562var comp0Ref = CreateCompilation(src0).EmitToImageReference(); 6640var comp0Ref = CreateCompilation(src0).EmitToImageReference(); 6887MetadataReference comp1Ref = comp1.EmitToImageReference(); 6900var comp = CreateCompilation(src, references: new[] { comp1Ref, comp2.EmitToImageReference() }, targetFramework: TargetFramework.StandardAndCSharp, options: TestOptions.ReleaseExe); 7257var comp1Ref = CreateCompilation(src1).EmitToImageReference(); 7381var comp1Ref = CreateCompilation(src1).EmitToImageReference(); 7434var comp1Ref = CreateCompilation(src1).EmitToImageReference(); 7789MetadataReference comp1Ref = comp1.EmitToImageReference(); 7802var comp = CreateCompilation(src, references: new[] { comp1Ref, comp2.EmitToImageReference() }, targetFramework: TargetFramework.StandardAndCSharp, options: TestOptions.ReleaseExe); 7980var comp1Ref = CreateCompilation(src1).EmitToImageReference(); 8066var comp1Ref = CreateCompilation(src1).EmitToImageReference(); 13160var compilation_BinaryReference = CreateCompilationWithMscorlib40(code, options: options, references: new[] { comAssembly.EmitToImageReference(embedInteropTypes: true) }); 13220var compilation_BinaryReference = CreateCompilationWithMscorlib40(code, options: options, references: new[] { comAssembly.EmitToImageReference(embedInteropTypes: true) }); 13244var comp1Ref = comp1.EmitToImageReference(); 13283var compilation_BinaryReference = CreateCompilationWithMscorlib40(code, options: options, references: new[] { comp1Ref, comAssembly.EmitToImageReference(embedInteropTypes: true) }); 13344var comp2 = CreateCompilation(src2, references: [image ? comp1.EmitToImageReference() : comp1.ToMetadataReference()], options: TestOptions.ReleaseExe); 13410var comp2 = CreateCompilation(src2, references: [image ? comp1.EmitToImageReference() : comp1.ToMetadataReference()], options: TestOptions.ReleaseExe); 13474var comp2 = CreateCompilation(src2, references: [image ? comp1.EmitToImageReference() : comp1.ToMetadataReference()], options: TestOptions.ReleaseExe); 13508var comp1Ref = comp1.EmitToImageReference(); 13609var comp1Ref = comp1.EmitToImageReference();
Semantics\PatternMatchingTests.cs (4)
8558var refA = comp.EmitToImageReference(); 10162var refA = comp.EmitToImageReference(); 10967var refA = comp.EmitToImageReference(); 11325var refA = comp.EmitToImageReference();
Semantics\PatternMatchingTests_ListPatterns.cs (14)
1650var csCompilation = CreateCompilation(csSource, references: new[] { vbCompilation.EmitToImageReference() }); 1797var csCompilation = CreateCompilation(csSource, references: new[] { vbCompilation.EmitToImageReference() }); 1827var csCompilation = CreateCompilation(csSource, references: new[] { vbCompilation.EmitToImageReference() }); 3257.EmitToImageReference(); 3268.EmitToImageReference(); 3352.EmitToImageReference(); 3366.EmitToImageReference(); 3431var rangeComp = CreateCompilation(new[] { range_cs, TestSources.Index }, references: new[] { missingComp.EmitToImageReference() }, assemblyName: "range"); 3433var rangeRef = rangeComp.EmitToImageReference(); 3450var comp = CreateCompilation(source, references: new[] { libComp.EmitToImageReference(), rangeRef }); 3552var libComp = CreateCompilation(lib_cs, references: new[] { missingComp.EmitToImageReference() }, assemblyName: "lib"); 3555var comp = CreateCompilation(new[] { source, TestSources.Index, TestSources.Range }, references: new[] { libComp.EmitToImageReference() }); 5348.EmitToImageReference(); 5360.EmitToImageReference();
Semantics\PatternMatchingTests5.cs (8)
2073var ref1 = CreateCompilation(INumberBaseDefinition, assemblyName: "A").EmitToImageReference(); 2074var ref2 = CreateCompilation(INumberBaseDefinition, assemblyName: "B").EmitToImageReference(); 2120var ref1 = CreateCompilation(INumberBaseDefinition, assemblyName: "A").EmitToImageReference(aliases: ImmutableArray.Create("A")); 2121var ref2 = CreateCompilation(INumberBaseDefinition, assemblyName: "B").EmitToImageReference(); 2234var ref1 = CreateCompilation(INumberBaseDefinition, assemblyName: "A").EmitToImageReference(); 2235var ref2 = CreateCompilation(INumberBaseDefinition, assemblyName: "B").EmitToImageReference(); 2298var ref1 = CreateCompilation(INumberBaseDefinition).EmitToImageReference(aliases: ImmutableArray.Create("A")); 2299var ref2 = CreateCompilation(INumberBaseDefinition).EmitToImageReference();
Semantics\PrimaryConstructorTests.cs (1)
508var comp2 = CreateCompilation(src2, references: new[] { comp.EmitToImageReference() });
Semantics\RecordTests.cs (38)
4205var comp1Ref = CreateCompilation(source1).EmitToImageReference(); 4211var comp2Ref = CreateCompilation(new[] { source2, IsExternalInitTypeDefinition }, references: new[] { comp1Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference(); 4236var comp1Ref = CreateCompilation(new[] { source1, IsExternalInitTypeDefinition }, assemblyName: "Clone_12", parseOptions: TestOptions.Regular9).EmitToImageReference(); 4242var comp2Ref = CreateCompilation(new[] { source2, IsExternalInitTypeDefinition }, references: new[] { comp1Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference(); 4271var comp1Ref = CreateCompilation(new[] { source1, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular9).EmitToImageReference(); 4277var comp2Ref = CreateCompilation(new[] { source2, IsExternalInitTypeDefinition }, assemblyName: "Clone_13", references: new[] { comp1Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference(); 4283var comp3Ref = CreateCompilation(new[] { source3, IsExternalInitTypeDefinition }, references: new[] { comp1Ref, comp2Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference(); 4335var comp1Ref = CreateCompilation(source1).EmitToImageReference(); 4341var comp2Ref = CreateCompilation(new[] { source2, IsExternalInitTypeDefinition }, references: new[] { comp1Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference(); 4366var comp1Ref = CreateCompilation(new[] { source1, IsExternalInitTypeDefinition }, assemblyName: "Clone_15", parseOptions: TestOptions.Regular9).EmitToImageReference(); 4372var comp2Ref = CreateCompilation(new[] { source2, IsExternalInitTypeDefinition }, references: new[] { comp1Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference(); 4428var comp1Ref = CreateCompilation(new[] { source1, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular9).EmitToImageReference(); 4434var comp2Ref = CreateCompilation(new[] { source2, IsExternalInitTypeDefinition }, assemblyName: "Clone_16", references: new[] { comp1Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference(); 4440var comp3Ref = CreateCompilation(new[] { source3, IsExternalInitTypeDefinition }, references: new[] { comp1Ref, comp2Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference(); 9548}", references: new[] { comp1.EmitToImageReference() }).VerifyDiagnostics(); 9801var refA = useCompilationReference ? comp.ToMetadataReference() : comp.EmitToImageReference(); 10571var refA = useCompilationReference ? comp.ToMetadataReference() : comp.EmitToImageReference(); 10825var refA = comp.EmitToImageReference(); 10873var refA = comp.EmitToImageReference(); 10951var refA = compA.EmitToImageReference(); 11023var refA = compA.EmitToImageReference(); 11113var refA = compA.EmitToImageReference(); 12615var refA = useCompilationReference ? compA.ToMetadataReference() : compA.EmitToImageReference(); 13341var refA = compA.EmitToImageReference(); 16283var ref0 = comp.EmitToImageReference(); 17232var ref0 = comp.EmitToImageReference(); 17328var ref0 = comp.EmitToImageReference(); 17424var ref0 = comp.EmitToImageReference(); 20674CompileAndVerify(source2, references: new[] { useImageReference ? comp1.EmitToImageReference() : comp1.ToMetadataReference() }, expectedOutput: 20853references: new[] { emitRef ? comp.EmitToImageReference() : comp.ToMetadataReference() }, 21023references: new[] { emitRef ? comp.EmitToImageReference() : comp.ToMetadataReference() }, 23800var refA = useCompilationReference ? comp.ToMetadataReference() : comp.EmitToImageReference(); 24276var ref0 = comp.EmitToImageReference(); 24341var ref0 = comp.EmitToImageReference(); 24411var ref0 = comp.EmitToImageReference(); 24490var ref0 = comp.EmitToImageReference(); 26086var compRef = CreateCompilation(src).EmitToImageReference(); 30188var refA = useCompilationReference ? compA.ToMetadataReference() : compA.EmitToImageReference();
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (10)
IOperation\IOperationTests_IIsPatternExpression.cs (2)
1317var compilation = CreateCompilation(source, new[] { vbCompilation.EmitToImageReference() }, parseOptions: TestOptions.Regular8); 1390var compilation = CreateCompilation(source, new[] { vbCompilation.EmitToImageReference() });
IOperation\IOperationTests_INoPiaObjectCreationOperation.cs (7)
73VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(consumer, expectedOperationTree, expectedDiagnostics, references: new[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 131VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(consumer, expectedOperationTree, expectedDiagnostics, references: new[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 180VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(consumer, expectedOperationTree, expectedDiagnostics, references: new[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 272VerifyFlowGraphAndDiagnosticsForTest<MethodDeclarationSyntax>(consumer, expectedFlowGraph, expectedDiagnostics, references: new[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 363VerifyFlowGraphAndDiagnosticsForTest<MethodDeclarationSyntax>(consumer, expectedFlowGraph, expectedDiagnostics, references: new[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 429VerifyFlowGraphAndDiagnosticsForTest<MethodDeclarationSyntax>(consumer, expectedFlowGraph, expectedDiagnostics, references: new[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) }); 573VerifyFlowGraphAndDiagnosticsForTest<MethodDeclarationSyntax>(consumer, expectedFlowGraph, expectedDiagnostics, references: new[] { piaCompilation.EmitToImageReference(embedInteropTypes: true) });
IOperation\IOperationTests_IParameterReferenceExpression.cs (1)
987references: new[] { MscorlibRef, SystemRef, compilation0.EmitToImageReference(embedInteropTypes: true) });
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (518)
Semantics\AccessCheckTests.cs (2)
1446var refA = comp.EmitToImageReference(); 1479var refA = comp.EmitToImageReference();
Semantics\BindingAsyncTasklikeMoreTests.cs (5)
1168var ref0 = compilation0.EmitToImageReference(); 1260var ref0 = compilation0.EmitToImageReference(); 1331var ref0 = compilation0.EmitToImageReference(); 1405var ref0 = compilation0.EmitToImageReference(); 1479var ref0 = compilation0.EmitToImageReference();
Semantics\BindingTests.cs (14)
778", assemblyName: "DerivedAssembly1", references: new List<MetadataReference>() { baseAssembly.EmitToImageReference() }).VerifyDiagnostics(); 791", references: new List<MetadataReference>() { derivedAssembly.EmitToImageReference() }) 817", assemblyName: "DerivedAssembly2", references: new List<MetadataReference>() { baseAssembly.EmitToImageReference() }).VerifyDiagnostics(); 830", references: new List<MetadataReference>() { derivedAssembly.EmitToImageReference() }) 856", assemblyName: "DerivedAssembly3", references: new List<MetadataReference>() { baseAssembly.EmitToImageReference() }).VerifyDiagnostics(); 867}", references: new List<MetadataReference>() { derivedAssembly.EmitToImageReference() }) 1614comp3 = CreateCompilationWithMscorlib461(source3, new MetadataReference[] { comp2.EmitToImageReference(), comp1.EmitToImageReference().WithEmbedInteropTypes(true) }); 1670comp3 = CreateCompilationWithMscorlib461(source3, new MetadataReference[] { comp2.EmitToImageReference(), comp1.EmitToImageReference().WithEmbedInteropTypes(true) }); 1721comp3 = CreateCompilationWithMscorlib461(source3, new MetadataReference[] { comp2.EmitToImageReference(), comp1.EmitToImageReference().WithEmbedInteropTypes(true) }); 1772comp3 = CreateCompilationWithMscorlib461(source3, new MetadataReference[] { comp2.EmitToImageReference(), comp1.EmitToImageReference().WithEmbedInteropTypes(true) });
Semantics\DeconstructionTests.cs (2)
1604var libMissingRef = libMissingComp.EmitToImageReference(); 1607var libRef = libComp.EmitToImageReference();
Semantics\DelegateTypeTests.cs (20)
13564var comp1aRef = comp1a.EmitToImageReference(); 13573var comp2Ref = comp2.EmitToImageReference(); 13605CompileAndVerify(source3, [comp2Ref, comp1b.EmitToImageReference()], parseOptions: TestOptions.Regular12, symbolValidator: validateSymbols, expectedOutput: expectedOutput).VerifyDiagnostics(); 13606CompileAndVerify(source3, [comp2Ref, comp1b.EmitToImageReference()], parseOptions: TestOptions.Regular13, symbolValidator: validateSymbols, expectedOutput: expectedOutput).VerifyDiagnostics(); 13607verifier = CompileAndVerify(source3, [comp2Ref, comp1b.EmitToImageReference()], symbolValidator: validateSymbols, expectedOutput: expectedOutput).VerifyDiagnostics(); 13681var comp1aRef = comp1a.EmitToImageReference(); 13691var comp2Ref = comp2.EmitToImageReference(); 13700var comp1bRef = comp1b.EmitToImageReference(); 13814var comp1aRef = comp1a.EmitToImageReference(); 13824var comp2Ref = comp2.EmitToImageReference(); 13833var comp1bRef = comp1b.EmitToImageReference(); 13930var comp1aRef = comp1a.EmitToImageReference(); 13939var comp2Ref = comp2.EmitToImageReference(); 13975var comp1bRef = comp1b.EmitToImageReference(); 14227var refAttribute = comp.EmitToImageReference(); 14238var refA = comp.EmitToImageReference(); 14302var refA = comp.EmitToImageReference(); 17367var ref1 = comp1.EmitToImageReference(embedInteropTypes: true); 17390var ref1 = comp1.EmitToImageReference(embedInteropTypes: true); 18862CreateCompilation(source2, new[] { comp.EmitToImageReference() }).VerifyEmitDiagnostics(
Semantics\GenericConstraintsTests.cs (28)
194).EmitToImageReference(); 230).EmitToImageReference(); 269).EmitToImageReference(); 308).EmitToImageReference(); 358var reference = CreateCompilation(code).EmitToImageReference(); 553}").EmitToImageReference(); 599}").EmitToImageReference(); 817}").EmitToImageReference(); 845}").EmitToImageReference(); 873}").EmitToImageReference(); 915var reference = CreateCompilation(code).EmitToImageReference(); 1070}").EmitToImageReference(); 1114}").EmitToImageReference(); 1298}").EmitToImageReference(); 1326}").EmitToImageReference(); 1354}").EmitToImageReference(); 1397var reference = CreateCompilation(code).EmitToImageReference(); 1555}").EmitToImageReference(); 1599}").EmitToImageReference(); 1981}").EmitToImageReference(); 2017}").EmitToImageReference(); 2052").EmitToImageReference(); 2093var reference = CreateCompilation(code).EmitToImageReference(); 2245}").EmitToImageReference(); 2368").EmitToImageReference(); 2403").EmitToImageReference(); 2412}", references: new[] { reference }).EmitToImageReference(); ; 2447}").EmitToImageReference();
Semantics\GlobalUsingDirectiveTests.cs (8)
3359var compWithReferenceToLib = CreateCompilation(reference_cs, references: new[] { origLibComp.EmitToImageReference() }); 3362MetadataReference newCompImageRef = newComp.EmitToImageReference(); 3364references: new[] { compWithReferenceToLib.EmitToImageReference(), newCompImageRef }, assemblyName: "lib", parseOptions: TestOptions.RegularPreview); 3373references: new[] { compWithReferenceToLib.EmitToImageReference(), newCompImageRef }, assemblyName: "lib", parseOptions: TestOptions.RegularPreview); 3381references: new[] { compWithReferenceToLib.EmitToImageReference(), newCompImageRef }, assemblyName: "lib", parseOptions: TestOptions.RegularPreview); 3397references: new[] { compWithReferenceToLib.EmitToImageReference(), newCompImageRef }, assemblyName: "lib", parseOptions: TestOptions.RegularPreview); 3413references: new[] { compWithReferenceToLib.EmitToImageReference(), newCompImageRef }, assemblyName: "lib", parseOptions: TestOptions.RegularPreview); 3429references: new[] { compWithReferenceToLib.EmitToImageReference(), newCompImageRef }, assemblyName: "lib", parseOptions: TestOptions.RegularPreview);
Semantics\ImplicitObjectCreationTests.cs (9)
4240var libComp = CreateCompilation(lib, references: new[] { missingComp.EmitToImageReference() }); 4253var comp = CreateCompilation(source, references: new[] { libComp.EmitToImageReference() }); 4281var libComp = CreateCompilation(lib, references: new[] { missingComp.EmitToImageReference() }); 4295var comp = CreateCompilation(source, references: new[] { libComp.EmitToImageReference() }); 4324var libComp = CreateCompilation(lib, references: new[] { missingComp.EmitToImageReference() }); 4336var comp = CreateCompilation(source, references: new[] { libComp.EmitToImageReference() }); 4356var libComp = CreateCompilation(lib, references: new[] { missingComp.EmitToImageReference() }); 4369var comp = CreateCompilation(source, references: new[] { libComp.EmitToImageReference() }); 4630var compilation2 = CreateCompilation(source2, references: new[] { compilation1.EmitToImageReference() });
Semantics\InheritanceBindingTests.cs (3)
3007var comp2 = CreateCompilation(new[] { source2 }, references: new[] { comp12.EmitToImageReference() }, assemblyName: "lib2"); 3024var comp3 = CreateCompilation(new[] { source3 }, references: new[] { comp11.EmitToImageReference(), comp2.EmitToImageReference() }, assemblyName: "lib3");
Semantics\InitOnlyMemberTests.cs (21)
78references: new[] { useMetadataImage ? lib.EmitToImageReference() : lib.ToMetadataReference() }); 115references: new[] { useMetadataImage ? lib.EmitToImageReference() : lib.ToMetadataReference() }); 149references: new[] { useMetadataImage ? lib.EmitToImageReference() : lib.ToMetadataReference() }); 187references: new[] { useMetadataImage ? lib.EmitToImageReference() : lib.ToMetadataReference() }); 217references: new[] { useMetadataImage ? lib.EmitToImageReference() : lib.ToMetadataReference() }); 228references: new[] { useMetadataImage ? lib.EmitToImageReference() : lib.ToMetadataReference() }); 347references: new[] { useMetadataImage ? lib.EmitToImageReference() : lib.ToMetadataReference() }); 1046var comp = CreateCompilation(new[] { source, main }, references: new[] { emitImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }, 1051comp = CreateCompilation(new[] { main }, references: new[] { emitImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }, 1082var comp = CreateCompilation(new[] { main }, references: new[] { emitImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }, 1130var comp = CreateCompilation(new[] { source, main }, references: new[] { emitImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }, 1135comp = CreateCompilation(new[] { main }, references: new[] { emitImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }, 1618references: new[] { emitImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }, 1814references: new[] { emitAsImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }); 2126references: new[] { emitAsImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }); 2231references: new[] { emitAsImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }); 3085references: new[] { emitAsImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }, 4652.EmitToImageReference(); 4655.EmitToImageReference(); 4658.EmitToImageReference(); 4661.EmitToImageReference();
Semantics\InteractiveUsingTests.cs (4)
322var lib1 = CreateCompilation(string.Format(libSourceTemplate, 1), assemblyName: "Lib1").EmitToImageReference(); 323var lib2 = CreateCompilation(string.Format(libSourceTemplate, 2), assemblyName: "Lib2").EmitToImageReference(); 515var lib = CreateCompilation(libSource).EmitToImageReference(); 556var lib = CreateCompilation(libSource).EmitToImageReference();
Semantics\InterpolationTests.cs (24)
1846foreach (var reference in new[] { comp1.EmitToImageReference(), comp1.ToMetadataReference() }) 2262foreach (var reference in new[] { comp1.EmitToImageReference(), comp1.ToMetadataReference() }) 4424var handlerRef = CreateCompilation(handlerSource).EmitToImageReference(); 4441var handlerRef = CreateCompilation(handlerSource).EmitToImageReference(); 6846var comp = CreateCompilation(@"C.M(1, $"""");", references: new[] { vbComp.EmitToImageReference() }); 6940var comp = CreateCompilation(@"C.M($"""");", references: new[] { vbComp.EmitToImageReference() }); 7015var comp = CreateCompilation(@"C.M(1, $"""");", references: new[] { vbComp.EmitToImageReference() }); 7093var comp = CreateCompilation(@"C.M(1, $"""");", references: new[] { vbComp.EmitToImageReference() }); 7168var comp = CreateCompilation(@"C.M($"""");", references: new[] { vbComp.EmitToImageReference() }); 7276var comp = CreateCompilation(@"C.M(1, $"""");", references: new[] { vbComp.EmitToImageReference() }); 7316var comp = CreateCompilation(@"C.M(1, $"""");", references: new[] { vbComp.EmitToImageReference() }); 7356var comp = CreateCompilation(@"C.M(1, $"""");", references: new[] { vbComp.EmitToImageReference() }); 7396var comp = CreateCompilation(@"C.M(1, $"""");", references: new[] { vbComp.EmitToImageReference() }); 7473var comp = CreateCompilation(@"C.M($"""");", references: new[] { vbComp.EmitToImageReference() }); 7550var comp = CreateCompilation(@"_ = new C($"""");", references: new[] { vbComp.EmitToImageReference() }); 7631var comp = CreateCompilation(@"C<CustomHandler>.M($"""");", references: new[] { vbComp.EmitToImageReference() }); 7803var comp = CreateCompilation("", references: new[] { vbComp.EmitToImageReference() }); 7968comp = CreateCompilation(executableCode, new[] { dependency.EmitToImageReference() }); 8253foreach (var d in new[] { dependency.EmitToImageReference(), dependency.ToMetadataReference() }) 8310foreach (var d in new[] { dependency.EmitToImageReference(), dependency.ToMetadataReference() }) 8432foreach (var d in new[] { dependency.EmitToImageReference(), dependency.ToMetadataReference() }) 9165CreateCompilation(@"C.M(1, """", " + expression + @");", new[] { comp.EmitToImageReference() }).VerifyDiagnostics( 13220var comp = CreateCompilation(code, new[] { vbComp.EmitToImageReference() }); 17514var comp = CreateCompilation(code, references: new[] { vbComp.EmitToImageReference() });
Semantics\LambdaTests.cs (1)
448comp1.EmitToImageReference(),
Semantics\NativeIntegerTests.cs (32)
186var ref2 = comp.EmitToImageReference(); 702var ref2 = comp.EmitToImageReference(); 846var ref1 = comp.EmitToImageReference(); 884var ref2 = comp.EmitToImageReference(); 957var ref1 = comp.EmitToImageReference(); 1001var ref2 = comp.EmitToImageReference(); 1050var refA1 = comp.EmitToImageReference(); 1053var refA2 = comp.EmitToImageReference(); 1138var ref1 = comp.EmitToImageReference(EmitOptions.Default.WithRuntimeMetadataVersion("0.0.0.0")); 1218var ref1 = comp.EmitToImageReference(); 1470verifyReference(comp.EmitToImageReference(EmitOptions.Default.WithRuntimeMetadataVersion("0.0.0.0")), includesIEquatable: true); 1496verifyReference(comp.EmitToImageReference(EmitOptions.Default.WithRuntimeMetadataVersion("0.0.0.0")), includesIEquatable: false); 1513var ref2 = comp.EmitToImageReference(); 1595var ref2 = comp.EmitToImageReference(); 1648var ref2 = comp.EmitToImageReference(); 2432var refA = compA.EmitToImageReference(); 3118var ref2 = comp.EmitToImageReference(); 3162var ref2 = comp.EmitToImageReference(); 3197var ref2 = comp.EmitToImageReference(); 3259var ref2 = comp.EmitToImageReference(); 3302var ref2 = comp.EmitToImageReference(); 3361var ref2 = comp.EmitToImageReference(); 3451var ref1 = comp.EmitToImageReference(); 3533var ref2 = comp.EmitToImageReference(); 3566var ref2 = comp.EmitToImageReference(); 3599var ref2 = comp.EmitToImageReference(); 4598var refA = comp.EmitToImageReference(options: EmitOptions.Default.WithRuntimeMetadataVersion("4.0.0.0")); 6942var ref0 = comp.EmitToImageReference(); 6971var ref0 = comp.EmitToImageReference(); 7004var ref0 = comp.EmitToImageReference(); 7219var ref2 = comp.EmitToImageReference(); 13281var refA = comp.EmitToImageReference();
Semantics\NonTrailingNamedArgumentsTests.cs (1)
339var verifier2 = CompileAndVerify(source, expectedOutput: "1 2.", parseOptions: TestOptions.Regular7_2, references: new[] { lib.EmitToImageReference() });
Semantics\NullableContextTests.cs (2)
275var refA = CreateCompilation(sourceA).EmitToImageReference(); 542var refA = CreateCompilation(sourceA).EmitToImageReference();
Semantics\NullableReferenceTypesTests.cs (236)
8527comp2 = CreateCompilation(new[] { client }, options: WithNullableEnable(), references: new[] { c.EmitToImageReference() }); 8707var ref0 = comp0.EmitToImageReference(); 8814var metadataRefs0 = new[] { comp0.EmitToImageReference() }; 8837metadataRefs0 = new[] { comp0.EmitToImageReference() }; 8867metadataRefs0 = new[] { comp0.EmitToImageReference() }; 8948var comp1B = CreateCompilation(source1, references: new[] { comp0.EmitToImageReference() }); 8998var comp1B = CreateCompilation(source1, references: new[] { comp0.EmitToImageReference() }); 9084references: new[] { comp0.EmitToImageReference() }); 9175references: new[] { comp0.EmitToImageReference() }); 9244var ref0 = comp0.EmitToImageReference(); 9248var ref1 = comp1.EmitToImageReference(); 9334var ref0 = comp0.EmitToImageReference(); 9338var ref1 = comp1.EmitToImageReference(); 9370ref0 = comp0.EmitToImageReference(); 9374ref1 = comp1.EmitToImageReference(); 9430comp1 = CreateCompilation(source1, references: new[] { comp0.EmitToImageReference() }); 9503var lib2 = CreateCompilation(lib2_cs, references: new[] { lib.EmitToImageReference() }, assemblyName: "lib2"); 9509var comp = CreateCompilation(source_cs, references: new[] { lib2.EmitToImageReference() }); 9654parseOptions: TestOptions.Regular8, references: new[] { obliviousComp.EmitToImageReference(), libComp.EmitToImageReference() }); 9805parseOptions: TestOptions.Regular8, references: new[] { obliviousComp.EmitToImageReference(), libComp.EmitToImageReference() }); 9924parseOptions: TestOptions.Regular8, references: new[] { obliviousComp.EmitToImageReference(), libComp.EmitToImageReference() }); 10033parseOptions: TestOptions.Regular8, references: new[] { obliviousComp.EmitToImageReference(), libComp.EmitToImageReference() }); 10162parseOptions: TestOptions.Regular8, references: new[] { obliviousComp.EmitToImageReference(), libComp.EmitToImageReference() }); 10279parseOptions: TestOptions.Regular8, references: new[] { obliviousComp.EmitToImageReference(), libComp.EmitToImageReference() }); 10316parseOptions: TestOptions.Regular8, references: new[] { obliviousComp.EmitToImageReference() }); 10442parseOptions: TestOptions.Regular8, references: new[] { obliviousComp.EmitToImageReference() }); 14336foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 14388foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 17888compilation = CreateCompilation("", references: new[] { compilation.EmitToImageReference() }, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.All)); 19789" }, options: WithNullableEnable(), references: new[] { c0.EmitToImageReference() }); 19854" }, options: WithNullableEnable(), references: new[] { c0.EmitToImageReference() }); 19904" }, options: WithNullableEnable(), references: new[] { c0.EmitToImageReference() }); 19966" }, options: WithNullableEnable(), references: new[] { c0.EmitToImageReference() }); 20019" }, options: WithNullableEnable(), references: new[] { c0.EmitToImageReference() }); 20096" }, options: WithNullableEnable(), references: new[] { c0.EmitToImageReference() }); 20154" }, options: WithNullableEnable(), references: new[] { c0.EmitToImageReference() }); 20288" }, options: WithNullableEnable(), references: new[] { c0.EmitToImageReference() }); 23114", references: new[] { libComp.EmitToImageReference() }, parseOptions: TestOptions.Regular9); 23348", new[] { libComp.EmitToImageReference() }, parseOptions: TestOptions.Regular9); 23568" }, references: new[] { libComp.EmitToImageReference() }, parseOptions: TestOptions.Regular8); 25489", references: new[] { libComp.EmitToImageReference() }, parseOptions: TestOptions.Regular9); 25559", references: new[] { libComp.EmitToImageReference() }, parseOptions: TestOptions.Regular9); 25699", references: new[] { libComp.EmitToImageReference() }, parseOptions: TestOptions.Regular9); 28909", references: new[] { lib.EmitToImageReference() }); 28939", references: new[] { lib.EmitToImageReference() }); 29109", references: new[] { lib.EmitToImageReference() }); 29139", references: new[] { lib.EmitToImageReference() }); 30160var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 30388var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 30607var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 30785var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 32021var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33142var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33177var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33212var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33249var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33291var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33421var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33456var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33495var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33550var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33590var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33637var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33684var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33762var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33812var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33924var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 33999var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 34309var reference = CreateNullableCompilation(new[] { source1, NotNullIfNotNullAttributeDefinition }).EmitToImageReference(); 36692" }, options: WithNullableEnable(), references: new[] { libComp.EmitToImageReference() }); 36785" }, options: WithNullableEnable(), references: new[] { obliviousComp.EmitToImageReference() }); 36991var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 37151var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 37188var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 37235var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 38077var compilation2 = CreateCompilation("", references: new[] { compilation.EmitToImageReference() }); 40307var ref0 = comp.EmitToImageReference(); 40420var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 40525var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 40772var comp = CreateNullableCompilation(new[] { source, MaybeNullAttributeDefinition }, references: new[] { lib.EmitToImageReference() }); 40948var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 41083var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 41123var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 44289var ref0 = comp.EmitToImageReference(); 44351var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 44566var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 44876references: new[] { lib.EmitToImageReference() }); 44939var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 45503var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 45539var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 45575var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 45609var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 45644var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 45678var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 46237var ref0 = comp.EmitToImageReference(); 46287var ref0 = comp.EmitToImageReference(); 46794var ref0 = comp.EmitToImageReference(); 46850var ref0 = comp.EmitToImageReference(); 47455var ref0 = comp.EmitToImageReference(); 47503var ref0 = comp.EmitToImageReference(); 47544var ref0 = comp.EmitToImageReference(); 47683var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 47966var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 48076var comp = CreateNullableCompilation(source, references: new[] { lib.EmitToImageReference() }); 48419var comp2 = CreateNullableCompilation(source2, references: new[] { comp.EmitToImageReference() }); 56664var ref0 = comp0.EmitToImageReference(); 56713var ref0 = comp0.EmitToImageReference(); 56788var ref0 = comp0.EmitToImageReference(); 56852var ref0 = comp0.EmitToImageReference(); 56899var ref0 = comp0.EmitToImageReference(); 56945var ref0 = comp0.EmitToImageReference(); 57306var ref0 = comp0.EmitToImageReference(); 57552var ref0 = comp0.EmitToImageReference(); 57567var ref1 = comp1.EmitToImageReference(); 58435var ref0 = comp0.EmitToImageReference(); 58450var ref1 = comp1.EmitToImageReference(); 58861var comp1 = CreateCompilation(new[] { source1 }, options: WithNullableEnable(), references: new[] { comp0.EmitToImageReference() }); 58919var comp1 = CreateCompilation(new[] { source1 }, options: WithNullableEnable(), references: new[] { comp0.EmitToImageReference() }); 60343var ref0 = comp0.EmitToImageReference(); 60468var ref0 = comp0.EmitToImageReference(); 60530var ref0 = comp0.EmitToImageReference(); 60585var ref0 = comp0.EmitToImageReference(); 60663var ref0 = comp0.EmitToImageReference(); 60752var ref0 = comp0.EmitToImageReference(); 60857var ref0 = comp0.EmitToImageReference(); 61144var ref0 = comp0.EmitToImageReference(); 63867" }, options: WithNullableEnable(), references: new[] { notAnnotated.EmitToImageReference() }); 64605var ref0 = comp0.EmitToImageReference(); 64663var ref0 = comp0.EmitToImageReference(); 64736var ref0 = comp0.EmitToImageReference(); 75989var comp2 = CreateCompilation(source2, references: new[] { comp.EmitToImageReference() }, options: WithNullableEnable()); 76031var comp2 = CreateCompilation(source2, references: new[] { comp.EmitToImageReference() }, options: WithNullableEnable()); 77104references: new[] { c0.EmitToImageReference() }); 77145references: new[] { c0.EmitToImageReference() }); 77377c = CreateCompilation(new[] { source2 }, new[] { c1.EmitToImageReference() }, 77512c = CreateCompilation(new[] { source2 }, new[] { c1.EmitToImageReference() }, 77545c = CreateCompilation(new[] { source2 }, new[] { c1.EmitToImageReference() }, 77684c = CreateCompilation(new[] { source2 }, new[] { c1.EmitToImageReference() }, 77825c = CreateCompilation(new[] { source2 }, new[] { c1.EmitToImageReference() }, 77996c = CreateCompilation(new[] { source2 }, new[] { c1.EmitToImageReference() }, 78884references: new[] { compA.EmitToImageReference() }); 81402var ref0 = comp0.EmitToImageReference(); 81874var comp = CreateCompilation(source, references: new[] { libComp.EmitToImageReference() }, parseOptions: TestOptions.Regular7_3); 81881var comp2 = CreateCompilation(source, references: new[] { libComp.EmitToImageReference() }); 89236var comp1 = CreateCompilation(new[] { source1 }, options: WithNullableEnable(), references: new[] { comp0.EmitToImageReference() }); 92822var ref0 = comp0.EmitToImageReference(); 92880var ref0 = comp0.EmitToImageReference(); 92922var ref0 = comp0.EmitToImageReference(); 92993var ref0 = comp0.EmitToImageReference(); 93037var ref0 = comp0.EmitToImageReference(); 93110var ref0 = comp0.EmitToImageReference(); 93154var ref0 = comp0.EmitToImageReference(); 93255var ref0 = comp0.EmitToImageReference(); 93296var ref0 = comp0.EmitToImageReference(); 93343var ref0 = comp0.EmitToImageReference(); 93538var ref0 = comp0.EmitToImageReference(); 93594var ref0 = comp0.EmitToImageReference(); 93667var ref0 = comp0.EmitToImageReference(); 93795var ref0 = comp0.EmitToImageReference(); 93833var ref0 = comp0.EmitToImageReference(); 93919var ref0 = comp0.EmitToImageReference(); 94131var ref0 = comp0.EmitToImageReference(); 94145var ref1 = comp1.EmitToImageReference(); 95149var ref0 = comp0.EmitToImageReference(); 98324var comp2 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), references: new[] { comp1.EmitToImageReference() }) 98367references: new[] { comp1.EmitToImageReference() }, 98409var comp2 = CreateCompilation(new[] { source2 }, references: new[] { comp1.EmitToImageReference() }); 98775references: new[] { comp1.EmitToImageReference() }); 98846references: new[] { comp1.EmitToImageReference(), comp2.EmitToImageReference() }); 98915var comp2 = CreateCompilation(new[] { source2 }, references: new[] { comp1.EmitToImageReference() }); 99453var comp3 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), references: new[] { comp1.EmitToImageReference() }); 99459var comp5 = CreateCompilation(new[] { source2 }, options: WithNullableDisable(), references: new[] { comp1.EmitToImageReference() }); 101287foreach (var reference in new[] { comp1.ToMetadataReference(), comp1.EmitToImageReference() }) 101368foreach (var reference in new[] { comp1.ToMetadataReference(), comp1.EmitToImageReference() }) 104896var comp2 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), references: new[] { comp1.EmitToImageReference() }); 104972references: new[] { comp1.EmitToImageReference(), comp2.EmitToImageReference() }, 105600var comp2 = CreateCompilation(new[] { source2 }, references: new[] { comp1.EmitToImageReference() }); 106107foreach (var reference in new[] { comp1.ToMetadataReference(), comp1.EmitToImageReference() }) 107401var comp2 = CreateCompilation(new[] { source2 }, references: new[] { comp1.EmitToImageReference() }); 109251foreach (var reference in new[] { comp0.ToMetadataReference(), comp0.EmitToImageReference() }) 111003ref0 = comp.EmitToImageReference(); 111323var ref0 = comp0.EmitToImageReference(); 111342var ref0 = comp0.EmitToImageReference(); 111372var ref0 = comp0.EmitToImageReference(); 111408var ref0 = comp0.EmitToImageReference(); 111441var ref0 = comp0.EmitToImageReference(); 111477var ref0 = comp0.EmitToImageReference(); 111510var ref0 = comp0.EmitToImageReference(); 111551var ref0 = comp0.EmitToImageReference(); 111679comp = CreateCompilation(new[] { source }, options: WithNullableEnable(), references: new[] { comp0.EmitToImageReference() }); 111847var ref0 = comp0.EmitToImageReference(); 111889var ref0 = comp0.EmitToImageReference(); 111910var ref0 = comp0.EmitToImageReference(); 111984var ref0 = comp0.EmitToImageReference(); 112072var ref0 = comp0.EmitToImageReference(); 112127var ref0 = comp0.EmitToImageReference(); 112212var ref0 = comp0.EmitToImageReference(); 112280var ref0 = comp0.EmitToImageReference(); 112533var ref0 = comp0.EmitToImageReference(); 112556ref0 = comp0.EmitToImageReference(); 112568ref0 = comp0.EmitToImageReference(); 112670ref0 = comp0.EmitToImageReference(); 116159var comp2 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.EmitToImageReference() }); 116197var comp2 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.EmitToImageReference() }); 116234var comp2 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.EmitToImageReference() }); 116271var comp2 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.EmitToImageReference() }); 116313var comp2 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.EmitToImageReference() }); 116355var comp2 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.EmitToImageReference() }); 116396var comp2 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.EmitToImageReference() }); 116440var comp2 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.EmitToImageReference() }); 116481var comp2 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.EmitToImageReference() }); 116524var comp2 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.EmitToImageReference() }); 116632var compilation2 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.EmitToImageReference(), MinCorlibRef }); 116656var compilation4 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.EmitToImageReference() }); 116724var compilation6 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.EmitToImageReference(), MscorlibRef }); 138718var comp1 = CreateCompilation(source1, assemblyName: nameof(source1)).VerifyDiagnostics().EmitToImageReference(); 143442var comp = CreateCompilation(source, references: new[] { vbComp.EmitToImageReference() }); 143476var comp = CreateCompilation(source, references: new[] { vbComp.EmitToImageReference() }); 143512var comp = CreateCompilation(source, references: new[] { vbComp.EmitToImageReference() }); 143554var comp = CreateCompilation(source, references: new[] { vbComp.EmitToImageReference() }); 144960.EmitToImageReference(); 155815var nullableAttrRef = useImageReference ? nullableAttrComp.EmitToImageReference() : nullableAttrComp.ToMetadataReference(); 155834var libRef = useImageReference ? lib.EmitToImageReference() : lib.ToMetadataReference(); 155858references: new[] { comp.EmitToImageReference(), libRef, nullableAttrRef }, 156547var ref0 = comp.EmitToImageReference(); 156595var ref0 = comp.EmitToImageReference(); 157009var ref0 = comp.EmitToImageReference(); 157045var ref0 = comp.EmitToImageReference();
Semantics\NullableTests.cs (1)
1800references: new MetadataReference[] { complib.EmitToImageReference() },
Semantics\OverloadResolutionTests.cs (7)
11523CreateCompilation(code, references: new[] { libComp.EmitToImageReference() }).VerifyDiagnostics( 11754var ref0 = CreateCompilation(source0).EmitToImageReference(); 11755var ref1 = CreateCompilation(source1, references: new[] { ref0 }).EmitToImageReference(); 11803var ref0 = CreateCompilation(source0).EmitToImageReference(); 11804var ref1 = CreateCompilation(source1, references: new[] { ref0 }).EmitToImageReference(); 11853var ref0 = CreateCompilation(source0).EmitToImageReference(); 11854var ref1 = CreateCompilation(source1, references: new[] { ref0 }).EmitToImageReference();
Semantics\QueryTests.cs (1)
4557", references: new[] { vb.EmitToImageReference() }, expectedOutput: "2");
Semantics\RawInterpolationTests_Handler.cs (23)
214foreach (var reference in new[] { comp1.EmitToImageReference(), comp1.ToMetadataReference() }) 632foreach (var reference in new[] { comp1.EmitToImageReference(), comp1.ToMetadataReference() }) 2701var handlerRef = CreateCompilation(handlerSource).EmitToImageReference(); 2717var handlerRef = CreateCompilation(handlerSource).EmitToImageReference(); 5104"""""");", references: new[] { vbComp.EmitToImageReference() }); 5210"""""");", references: new[] { vbComp.EmitToImageReference() }); 5297"""""");", references: new[] { vbComp.EmitToImageReference() }); 5387"""""");", references: new[] { vbComp.EmitToImageReference() }); 5474"""""");", references: new[] { vbComp.EmitToImageReference() }); 5561"""""");", references: new[] { vbComp.EmitToImageReference() }); 5608"""""");", references: new[] { vbComp.EmitToImageReference() }); 5655"""""");", references: new[] { vbComp.EmitToImageReference() }); 5744"""""");", references: new[] { vbComp.EmitToImageReference() }); 5833"""""");", references: new[] { vbComp.EmitToImageReference() }); 5926"""""");", references: new[] { vbComp.EmitToImageReference() }); 5971var comp = CreateCompilation("", references: new[] { vbComp.EmitToImageReference() }); 6155comp = CreateCompilation(executableCode, new[] { dependency.EmitToImageReference() }); 6428foreach (var d in new[] { dependency.EmitToImageReference(), dependency.ToMetadataReference() }) 6487foreach (var d in new[] { dependency.EmitToImageReference(), dependency.ToMetadataReference() }) 6611foreach (var d in new[] { dependency.EmitToImageReference(), dependency.ToMetadataReference() }) 7360CreateCompilation(@"C.M(1, """", " + expression + @");", new[] { comp.EmitToImageReference() }).VerifyDiagnostics( 9815var comp = CreateCompilation(code, new[] { vbComp.EmitToImageReference() }); 12921var comp = CreateCompilation(code, references: new[] { vbComp.EmitToImageReference() });
Semantics\ReadOnlyStructsTests.cs (4)
1611var moduleMetadata = CreateCompilation(csharp, options: TestOptions.DebugModule, targetFramework: TargetFramework.Mscorlib461).EmitToImageReference(); 1616var dllMetadata = CreateCompilation(csharp, options: TestOptions.DebugDll, targetFramework: TargetFramework.Mscorlib461).EmitToImageReference(); 1639var moduleMetadata = CreateCompilation(csharp, options: TestOptions.DebugModule, targetFramework: TargetFramework.Mscorlib461).EmitToImageReference(); 1644var dllMetadata = CreateCompilation(csharp, options: TestOptions.DebugDll, targetFramework: TargetFramework.Mscorlib461).EmitToImageReference();
Semantics\RecordStructTests.cs (4)
188var comp2 = CreateCompilation(src2, references: new[] { comp.EmitToImageReference() }); 2285var corlibRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 2387var corlibRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 5085CompileAndVerify(source2, references: new[] { useImageReference ? comp1.EmitToImageReference() : comp1.ToMetadataReference() }, expectedOutput: @"
Semantics\RefEscapingTests.cs (2)
8238comp1 = CreateCompilation(source1, references: new[] { comp0.EmitToImageReference() }, parseOptions: TestOptions.Regular11); 8248comp1 = CreateCompilation(source1, references: new[] { comp0.EmitToImageReference() }, parseOptions: TestOptions.Regular10);
Semantics\RefExtensionMethodsTests.cs (7)
396CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "55"); 566CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "55"); 941CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "55"); 2336references: new[] { reference.EmitToImageReference() }).VerifyDiagnostics( 2342CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5"); 2440references: new[] { reference.EmitToImageReference() }).VerifyDiagnostics( 2446CompileAndVerify(code, references: new[] { reference.EmitToImageReference() }, expectedOutput: "5");
Semantics\RefFieldTests.cs (20)
542var refB = comp.EmitToImageReference(); 1488var comp = CreateCompilation(source, references: new[] { spanReference.EmitToImageReference() }, options: TestOptions.UnsafeReleaseDll, targetFramework: TargetFramework.Net70); 1544var comp = CreateCompilation(source, references: new[] { spanReference.EmitToImageReference() }, options: TestOptions.UnsafeReleaseDll, targetFramework: TargetFramework.Net70); 1596var comp = CreateCompilation(source, references: new[] { spanReference.EmitToImageReference() }, options: TestOptions.UnsafeReleaseDll, targetFramework: TargetFramework.Net70); 1652var comp = CreateCompilation(source, references: new[] { spanReference.EmitToImageReference() }, options: TestOptions.UnsafeReleaseDll, targetFramework: TargetFramework.Net70); 2004var refB = verifier.Compilation.EmitToImageReference(); 2229var refA = compA.EmitToImageReference(emitOptions); 2247var refB = compB.EmitToImageReference(); 2262references: new[] { refB, compA.EmitToImageReference() }, 10158var refA = comp.EmitToImageReference(); 15743var refA = comp.EmitToImageReference(embedInteropTypes: true); 20356var comp = CreateCompilation(source, references: new[] { lib.EmitToImageReference() }, parseOptions: TestOptions.Regular10, targetFramework: TargetFramework.Net70); 20369comp = CreateCompilation(source, references: new[] { lib.EmitToImageReference() }, parseOptions: TestOptions.Regular10); 26592var ref0 = comp.EmitToImageReference(Microsoft.CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("0.0.0.0")); 26601var ref1 = comp.EmitToImageReference(); 26649var refLowerVersion = comp.EmitToImageReference(); 26653var refHigherVersion = comp.EmitToImageReference(); 26662var ref1 = comp.EmitToImageReference(); 26717var ref0 = comp.EmitToImageReference(Microsoft.CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("0.0.0.0")); 26726var ref1 = comp.EmitToImageReference();
Semantics\SpanStackSafetyTests.cs (4)
1946references: new List<MetadataReference>() { MscorlibRef_v4_0_30316_17626, SystemCoreRef, CSharpRef, reference.EmitToImageReference() }, 1980references: new List<MetadataReference>() { MscorlibRef_v4_0_30316_17626, SystemCoreRef, CSharpRef, reference.EmitToImageReference() }, 2024references: new List<MetadataReference>() { MscorlibRef_v4_0_30316_17626, SystemCoreRef, CSharpRef, reference.EmitToImageReference() }, 2065references: new List<MetadataReference>() { MscorlibRef_v4_0_30316_17626, SystemCoreRef, CSharpRef, reference.EmitToImageReference() },
Semantics\StructConstructorTests.cs (1)
3665var refA = comp.EmitToImageReference(embedInteropTypes: true);
Semantics\UnsafeTests.cs (3)
61var ref1 = comp1.EmitToImageReference(); 5934var comp = CreateCompilation(src, options: TestOptions.UnsafeDebugDll, references: new[] { libComp.EmitToImageReference() }); 6345var metadata = CreateCompilation(externalCode).EmitToImageReference();
Semantics\UseSiteErrorTests.cs (19)
1075var xRef = CreateCompilation(xSource, assemblyName: "Test").EmitToImageReference(); 1107var xRef = CreateCompilation(xSource, assemblyName: "X").EmitToImageReference(); 1136var xRef = CreateCompilation(xSource, assemblyName: "X").EmitToImageReference(); 1661var missingRef = CreateCompilation(missingSource, assemblyName: "Missing").EmitToImageReference(); 1662var libRef = CreateCompilation(libSource, new[] { missingRef }).EmitToImageReference(); 1732var missingRef = CreateCompilation(missingSource, assemblyName: "Missing").EmitToImageReference(); 1733var libRef = CreateCompilation(libSource, new[] { missingRef }).EmitToImageReference(); 1787var missingRef = CreateCompilation(missingSource, assemblyName: "Missing").EmitToImageReference(); 1788var libRef = CreateCompilation(libSource, new[] { missingRef }).EmitToImageReference(); 1844var missingRef = CreateCompilation(missingSource, assemblyName: "Missing").EmitToImageReference(); 1845var libRef = CreateCompilation(libSource, new[] { missingRef }).EmitToImageReference(); 1901var missingRef = CreateCompilation(missingSource, assemblyName: "Missing").EmitToImageReference(); 1902var libRef = CreateCompilation(libSource, new[] { missingRef }).EmitToImageReference(); 1948var missingRef = CreateCompilation(missingSource, assemblyName: "Missing").EmitToImageReference(); 1949var libRef = CreateCompilation(libSource, new[] { missingRef }).EmitToImageReference(); 2233comp3 = CreateCompilation(source3, new MetadataReference[] { comp2.EmitToImageReference() }); 2322var compilation2 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.EmitToImageReference(), MinCorlibRef }); 2344var compilation4 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.EmitToImageReference() }); 2389var compilation6 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.EmitToImageReference(), MscorlibRef });
Semantics\WarningVersionTests.cs (9)
132var moduleReference = new[] { comp1.EmitToImageReference() }; 210var moduleReference = new[] { comp1.EmitToImageReference() }; 289var moduleReference = new[] { comp1.EmitToImageReference() }; 383var moduleReference = comp1.EmitToImageReference(); 411var moduleReference = new[] { comp1.EmitToImageReference() }; 498var moduleReference = new[] { comp1.EmitToImageReference() }; 585var moduleReference = new[] { comp1.EmitToImageReference() }; 672var moduleReference = comp1.EmitToImageReference(); 702var moduleReference = comp1.EmitToImageReference();
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.cs (1)
1240var comp0 = CreateCompilation(source0).VerifyDiagnostics().EmitToImageReference();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (663)
BadSymbolReference.cs (9)
796var libRef = CreateEmptyCompilation(libSource, new[] { MscorlibRef }, assemblyName: "System.Drawing").EmitToImageReference(); 815var comp3 = CreateEmptyCompilation(project3Source, new[] { MscorlibRef, comp1.EmitToImageReference(), comp2.EmitToImageReference() }, assemblyName: "Project3"); 1010lib4 = CreateCompilation(lib4Def, new[] { lib1.EmitToImageReference(), lib3.EmitToImageReference() }, TestOptions.ReleaseDll); 1249lib4 = CreateCompilation(lib4Def, new[] { lib1.EmitToImageReference(), lib3.EmitToImageReference() }, TestOptions.ReleaseDll); 1428lib4 = CreateCompilation(lib4Def, new[] { lib1.EmitToImageReference(), lib3.EmitToImageReference() }, TestOptions.ReleaseDll);
Compilation\CompilationAPITests.cs (25)
617var mtref = refcomp.EmitToImageReference(aliases: ImmutableArray.Create("a", "Alias(*#$@^%*&)")); 685var mtref = refcomp.EmitToImageReference(aliases: ImmutableArray.Create("a", "Alias(*#$@^%*&)")); 989references: new MetadataReference[] { netModule1.EmitToImageReference() }, 1003references: new MetadataReference[] { netModule2.EmitToImageReference() }, 1018references: new MetadataReference[] { netModule1.EmitToImageReference(), netModule2.EmitToImageReference() }, 1045references: new MetadataReference[] { netModule1.EmitToImageReference() }, 1059references: new MetadataReference[] { netModule1.EmitToImageReference() }, 1073references: new MetadataReference[] { netModule2.EmitToImageReference(), netModule3.EmitToImageReference() }, 1109references: new MetadataReference[] { netModule1.EmitToImageReference() }, 1134references: new MetadataReference[] { netModule1.EmitToImageReference() }, 1148references: new MetadataReference[] { netModule1.EmitToImageReference(), netModule2.EmitToImageReference() }, 3421{accessibility} class C<T> {{}}", new[] { useMetadataReference ? referenceComp.ToMetadataReference() : referenceComp.EmitToImageReference() }); 3442{accessibility} class C<T> {{}}", new[] { useMetadataReference ? referenceComp.ToMetadataReference() : referenceComp.EmitToImageReference() }); 3470MetadataReference reference = useMetadataReference ? referenceComp.ToMetadataReference() : referenceComp.EmitToImageReference(); 3498MetadataReference reference = useMetadataReference ? referenceComp.ToMetadataReference() : referenceComp.EmitToImageReference(); 3545return useMetadataReference ? referenceComp1.ToMetadataReference() : referenceComp1.EmitToImageReference(); 3585return useMetadataReference ? referenceComp1.ToMetadataReference() : referenceComp1.EmitToImageReference(); 3604var corlibReference = corlib.EmitToImageReference(); 3607var otherReference = other.EmitToImageReference(); 3639var corlibReference = corlib.EmitToImageReference(aliases: ImmutableArray.Create("corlib")); 3664var corlibReference = corlib.EmitToImageReference(); 3667var otherReference = other.EmitToImageReference(aliases: ImmutableArray.Create("other"));
Compilation\ReferenceManagerTests.cs (91)
39var ifaceImageRef = ifaceDef.EmitToImageReference(); 1733var refLib = ((MetadataImageReference)lib.EmitToImageReference()).WithEmbedInteropTypes(true); 1764var moduleRef = CreateCompilation("public class TypeFromModule : TypeDependedOnByModule { }", new[] { assemblyRef }, options: TestOptions.ReleaseModule, assemblyName: "lib2").EmitToImageReference(); 1815var moduleRef = CreateCompilation("public class C { }", options: TestOptions.ReleaseModule, assemblyName: "lib").EmitToImageReference(); 1865var moduleRef = module.EmitToImageReference(); 2066libBv1.EmitToImageReference(); 2067libBv2.EmitToImageReference(); 2089libAv1.EmitToImageReference(); 2180var refVectors40 = vectors40.EmitToImageReference(); 2181var refVectors41 = vectors41.EmitToImageReference(); 2248CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").EmitToImageReference(), 2317var bRef = CreateCompilationWithMscorlib461("public class B { }", assemblyName: "B").EmitToImageReference(); 2318var aRef = CreateCompilationWithMscorlib461("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference(); 2347var bRef = CreateCompilationWithMscorlib461("public class B { }", assemblyName: "B").EmitToImageReference(); 2348var aRef = CreateCompilationWithMscorlib461("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference(); 2379var bRef = CreateCompilationWithMscorlib461("public class B { }", assemblyName: "B").EmitToImageReference(); 2380var aRef = CreateCompilationWithMscorlib461("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference(); 2415var bRef = CreateCompilationWithMscorlib461("public class B { }", assemblyName: "B").EmitToImageReference(); 2416var aRef = CreateCompilationWithMscorlib461("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference(); 2451var bRef = CreateCompilationWithMscorlib461("public class B { }", assemblyName: "B").EmitToImageReference(); 2452var aRef = CreateCompilationWithMscorlib461("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference(); 2489var bRef = CreateCompilationWithMscorlib461("public class B { }", assemblyName: "B").EmitToImageReference(); 2490var aRef = CreateCompilationWithMscorlib461("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference(); 2491var dRef = CreateCompilationWithMscorlib461("public class D : A { }", new[] { aRef, bRef }, assemblyName: "D").EmitToImageReference(); 2527var bRef = CreateCompilationWithMscorlib46("public class B { }", assemblyName: "B").EmitToImageReference(); 2528var aRef = CreateCompilationWithMscorlib46("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference(); 2549var bRef = CreateCompilationWithMscorlib46("public class B { }", assemblyName: "B").EmitToImageReference(); 2550var aRef = CreateCompilationWithMscorlib46("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference(); 2577var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2578var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2579var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public class B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2581var aRef = CreateEmptyCompilation("public class A : B { }", new[] { MscorlibRef, b1Ref }, assemblyName: "A").EmitToImageReference(); 2582var dRef = CreateEmptyCompilation("public class D : B { }", new[] { MscorlibRef, b2Ref }, assemblyName: "D").EmitToImageReference(); 2631var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2632var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2633var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2634var b4Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2636var aRef = CreateEmptyCompilation(@"public interface A : B { }", new[] { MscorlibRef, b1Ref }, assemblyName: "A").EmitToImageReference(); 2637var dRef = CreateEmptyCompilation(@"public interface D : B { }", new[] { MscorlibRef, b2Ref }, assemblyName: "D").EmitToImageReference(); 2667var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2668var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2669var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2670var b4Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference(); 2672var aRef = CreateEmptyCompilation(@"public interface A : B { }", new[] { MscorlibRef, b1Ref }, assemblyName: "A").EmitToImageReference(); 2673var dRef = CreateEmptyCompilation(@"public interface D : B { }", new[] { MscorlibRef, b2Ref }, assemblyName: "D").EmitToImageReference(); 2703var dRef = CreateCompilationWithMscorlib46("public interface D { }", assemblyName: "D").EmitToImageReference(); 2719var dRef = CreateCompilationWithMscorlib46("public interface D { }", assemblyName: "D").EmitToImageReference(); 2742var bRef = CreateCompilationWithMscorlib46("public interface D { }", assemblyName: "B").EmitToImageReference(); 2768var dRef = CreateCompilationWithMscorlib46("public interface D { }", assemblyName: "D").EmitToImageReference(); 2795var bRef = CreateCompilationWithMscorlib46("public interface B { }", assemblyName: "B").EmitToImageReference(); 2796var dRef = CreateCompilationWithMscorlib46("public interface D { }", assemblyName: "D").EmitToImageReference(); 2798var mRef = CreateCompilationWithMscorlib46("public interface M : B { }", new[] { bRef }, options: TestOptions.ReleaseModule.WithModuleName("M.netmodule")).EmitToImageReference(); 2799var nRef = CreateCompilationWithMscorlib46("public interface N : D { }", new[] { dRef }, options: TestOptions.ReleaseModule.WithModuleName("N.netmodule")).EmitToImageReference(); 2801var aRef = CreateCompilationWithMscorlib46("public interface A : D { }", new[] { dRef }, assemblyName: "A").EmitToImageReference(); 2832var b1Ref = CreateCompilationWithMscorlib46(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class B { }", options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2833var b2Ref = CreateCompilationWithMscorlib46(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class B { }", options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2834var b3Ref = CreateCompilationWithMscorlib46(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public class B { }", options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2836var aRef = CreateCompilationWithMscorlib46(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class A : B { }", new[] { b1Ref }, options: s_signedDll, assemblyName: "A").EmitToImageReference(); 2873var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2874var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2876var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference(); 2877var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference(); 2886s_signedDll.WithMetadataReferenceResolver(resolverA), assemblyName: "A").EmitToImageReference(); 2939var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", references: new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2940var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", references: new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 2942var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference(); 2943var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference(); 2952s_signedDll.WithMetadataReferenceResolver(resolverA), assemblyName: "A").EmitToImageReference(); 2999var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3000var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3002var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference(); 3003var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference(); 3006s_signedDll, assemblyName: "A").EmitToImageReference(); 3043var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3044var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3045var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3046var b4Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3048var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference(); 3049var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference(); 3052s_signedDll, assemblyName: "A").EmitToImageReference(); 3109var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3110var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3111var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3112var b4Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference(); 3114var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference(); 3115var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference(); 3118s_signedDll, assemblyName: "A").EmitToImageReference(); 3179options: options, assemblyName: "A").EmitToImageReference(); 3182options: options, assemblyName: "B").EmitToImageReference(); 3219options: options, assemblyName: "A").EmitToImageReference(); 3222options: options, assemblyName: "B").EmitToImageReference();
Compilation\SemanticModelAPITests.cs (2)
1259var ref1 = comp1.EmitToImageReference(aliases: ImmutableArray.Create("X")); 3841var libRef = CreateCompilation("", assemblyName: "lib").EmitToImageReference(aliases: ImmutableArray.Create("Alias"));
Compilation\UsedAssembliesTests.cs (58)
70verify<PEAssemblySymbol>(source2, comp1.EmitToImageReference()); 397verify<PEAssemblySymbol>(source2, comp1.EmitToImageReference()); 431verify<PEAssemblySymbol>(source2, comp1.EmitToImageReference()); 456var comp1ImageRef = comp1.EmitToImageReference(); 508var comp0ImageRef = comp0.EmitToImageReference(); 522var comp1ImageRef = comp1.EmitToImageReference(); 578var comp0ImageRef = comp0.EmitToImageReference(); 592var comp1Ref = comp1.EmitToImageReference(); 605var comp2ImageRef = comp2.EmitToImageReference(); 627comp2ImageRef = comp2.EmitToImageReference(); 647comp2ImageRef = comp2.EmitToImageReference(); 1377verify<PEAssemblySymbol>(source2, comp1.EmitToImageReference()); 1632var comp6ImageRef = comp6.EmitToImageReference(); 1636var comp7ImageRef = comp7.EmitToImageReference(embedInteropTypes: false); 1695var comp1ImageRef = comp1.EmitToImageReference(); 1706var comp2ImageRef = comp2.EmitToImageReference(); 1804var comp1ImageRef = comp1.EmitToImageReference(); 1887var comp1ImageRef = comp1.EmitToImageReference(); 1945var comp6ImageRef = comp6.EmitToImageReference(); 1949var comp7ImageRef = comp7.EmitToImageReference(embedInteropTypes: false); 1970var comp1ImageRef = comp1.EmitToImageReference(); 2429var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true); 2442var comp1ImageRef = comp1.EmitToImageReference(); 2462var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false); 2497var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true); 2509var comp1ImageRef = comp1.EmitToImageReference(); 2513var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false); 2585var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true); 2597var comp1ImageRef = comp1.EmitToImageReference(); 2601var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false); 2673var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true); 2685var comp1ImageRef = comp1.EmitToImageReference(); 2689var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false); 2757var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true); 2770var comp1ImageRef = comp1.EmitToImageReference(); 2774var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false); 2846var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true); 2858var comp1ImageRef = comp1.EmitToImageReference(); 2862var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false); 2934var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true); 2946var comp1ImageRef = comp1.EmitToImageReference(); 2950var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false); 2998var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true); 3037var comp1ImageRef = comp1.EmitToImageReference(); 3041var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false); 3307var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true); 3347var comp1ImageRef = comp1.EmitToImageReference(); 3351var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false); 4923var comp1ImageRef = comp1.EmitToImageReference(); 5013var comp1ImageRef = comp1.EmitToImageReference(); 5068var comp1ImageRef = comp1.EmitToImageReference(); 5155var comp1ImageRef = comp1.EmitToImageReference(); 5197var comp0ImageRef = comp0.EmitToImageReference(); 5230var comp1ImageRef = comp1.EmitToImageReference(); 5413var comp1ImageRef = comp1.EmitToImageReference(); 5826comp0Ref = comp0.EmitToImageReference(); 5861comp0Ref = comp0.EmitToImageReference(); 5896comp0Ref = comp0.EmitToImageReference();
CrossLanguageTests.cs (1)
31var ref1 = vbcomp.EmitToImageReference(embedInteropTypes: true);
DocumentationComments\CrefTests.cs (2)
1865var lib1Ref = CreateCompilation(lib1Source, assemblyName: "A").EmitToImageReference(); 1866var lib2Ref = CreateCompilation(lib2Source, assemblyName: "B").EmitToImageReference();
SymbolDisplay\SymbolDisplayTests.cs (4)
2255var comp2 = CreateCompilation("", references: [comp1.EmitToImageReference()], options: TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All)); 5661var refA = compA.EmitToImageReference(); 5840var refA = compA.EmitToImageReference(); 5865var refA = compA.EmitToImageReference();
Symbols\AssemblyAndNamespaceTests.cs (1)
413var libRef = libComp.EmitToImageReference(aliases: ImmutableArray.Create("myTask"));
Symbols\CheckedUserDefinedOperatorsTests.cs (6)
6608var compilation3 = CreateCompilation(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.RegularPreview, references: new[] { compilation2.EmitToImageReference() }); 6758var compilation3 = CreateCompilation(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.RegularPreview, references: new[] { compilation2.EmitToImageReference() }); 6807var compilation3 = CreateCompilation(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.RegularPreview, references: new[] { compilation2.EmitToImageReference() }); 6856var compilation3 = CreateCompilation(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.RegularPreview, references: new[] { compilation2.EmitToImageReference() }); 7007var compilation3 = CreateCompilation(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.RegularPreview, references: new[] { compilation2.EmitToImageReference() }); 7052var compilation3 = CreateCompilation(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.RegularPreview, references: new[] { compilation2.EmitToImageReference() });
Symbols\CompilationCreationTests.cs (1)
2973var ref1 = lib1.EmitToImageReference(); // NOTE: can't use a compilation reference for a module.
Symbols\CorLibrary\CorTypes.cs (4)
364var comp1Ref = comp1.EmitToImageReference(); 539var comp1Ref = comp1.EmitToImageReference(); 813var comp1Ref = comp1.EmitToImageReference(); 1007var comp1Ref = comp1.EmitToImageReference();
Symbols\CovariantReturnTests.cs (19)
221}, assemblyName: "mscorlib").EmitToImageReference(options: new CodeAnalysis.Emit.EmitOptions(runtimeMetadataVersion: "v4.1")); 225}, assemblyName: "mscorlib").EmitToImageReference(options: new CodeAnalysis.Emit.EmitOptions(runtimeMetadataVersion: "v4.2")); 229}, assemblyName: "mscorlib").EmitToImageReference(options: new CodeAnalysis.Emit.EmitOptions(runtimeMetadataVersion: "v5.0")); 233}, assemblyName: "mscorlib").EmitToImageReference(options: new CodeAnalysis.Emit.EmitOptions(runtimeMetadataVersion: "v5.1")); 237}, assemblyName: "mscorlib").EmitToImageReference(options: new CodeAnalysis.Emit.EmitOptions(runtimeMetadataVersion: "v4.9")); 482var compAsImage = comp.EmitToImageReference(); 1413var baseMetadata = CreateCompilationWithCovariantReturns(s0).EmitToImageReference(); 1475var baseMetadata = CreateCompilationWithCovariantReturns(s0).EmitToImageReference(); 1539var baseMetadata = CreateCompilationWithCovariantReturns(s0).EmitToImageReference(); 2578var csRef = csComp.EmitToImageReference(); 2811var ref0 = CreateCompilationWithoutCovariantReturns(s0).EmitToImageReference(); 2821assemblyName: "ref1").EmitToImageReference(); 2832assemblyName: "ref1").EmitToImageReference(); 2905var ref0 = CreateCompilationWithoutCovariantReturns(s0).EmitToImageReference(); 2912var ref1a = CreateCompilationWithoutCovariantReturns(s1a, references: new[] { ref0 }, assemblyName: "ref1").EmitToImageReference(); 2920var ref1b = CreateCompilationWithCovariantReturns(s1b, references: new[] { ref0 }, assemblyName: "ref1").EmitToImageReference(); 2972var ref0 = CreateCompilationWithoutCovariantReturns(s0).EmitToImageReference(); 2979var ref1a = CreateCompilationWithoutCovariantReturns(s1a, references: new[] { ref0 }, assemblyName: "ref1").EmitToImageReference(); 2987var ref1b = CreateCompilationWithCovariantReturns(s1b, references: new[] { ref0 }, assemblyName: "ref1").EmitToImageReference();
Symbols\DefaultInterfaceImplementationTests.cs (183)
166foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 361var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 501var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 1676foreach (var reference in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() }) 1742foreach (var reference in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() }) 2203var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 2265foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 2334foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 2407foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 2480foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 2650var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 4405var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, 4489var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, 5965var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, 6030var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugDll, 6619var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 7429var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, 7496var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugDll, 9280foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 9470foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 9554var compilation4 = CreateCompilation(source2, new[] { compilation2.EmitToImageReference() }, options: TestOptions.DebugExe, 9849var compilation4 = CreateCompilation(source2, new[] { compilation2.EmitToImageReference() }, options: TestOptions.DebugExe, 9919var compilation4 = CreateCompilation(source2, new[] { compilation2.EmitToImageReference() }, options: TestOptions.DebugExe, 9992foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 10938var compilation4 = CreateCompilation(source2, new[] { compilation2.EmitToImageReference() }, options: TestOptions.DebugExe, 11755foreach (var reference in new[] { compilation3.ToMetadataReference(), compilation3.EmitToImageReference() }) 11905foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 12020foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 12143foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 12234foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 12296foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 12358foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 12635foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 12723foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 12811foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 14956foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 15135foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 15261foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 15683var compilation4 = CreateCompilation(source2, new[] { compilation2.EmitToImageReference() }, options: TestOptions.DebugExe, 15762var compilation4 = CreateCompilation(source2, new[] { compilation2.EmitToImageReference() }, options: TestOptions.DebugExe, 15862foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 17541var compilation4 = CreateCompilation(source2, new[] { compilation2.EmitToImageReference() }, options: TestOptions.DebugExe, 18326foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 18492foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 19922var compilation4 = CreateCompilation(source2, new[] { compilation2.EmitToImageReference() }, options: TestOptions.DebugExe, 20424foreach (var reference in new[] { compilation3.ToMetadataReference(), compilation3.EmitToImageReference() }) 28499foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 28640foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 28765foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 29192var compilation4 = CreateCompilation(source2, new[] { compilation2.EmitToImageReference() }, options: TestOptions.DebugExe, 29274var compilation4 = CreateCompilation(source2, new[] { compilation2.EmitToImageReference() }, options: TestOptions.DebugExe, 29374foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 30944var compilation4 = CreateCompilation(source2, new[] { compilation2.EmitToImageReference() }, options: TestOptions.DebugExe, 31166foreach (var reference in new[] { compilation3.ToMetadataReference(), compilation3.EmitToImageReference() }) 32022foreach (var reference in new[] { compilation3.ToMetadataReference(), compilation3.EmitToImageReference() }) 32156foreach (var reference in new[] { compilation3.ToMetadataReference(), compilation3.EmitToImageReference() }) 32287var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe); 32547foreach (var reference in new[] { compilation3.ToMetadataReference(), compilation3.EmitToImageReference() }) 32991var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 34173var compilation3 = CreateCompilation(source3, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 34210var compilation6 = CreateCompilation(source2 + source3, new[] { compilation4.EmitToImageReference() }, options: TestOptions.DebugDll, 34311var refs1 = new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }; 34499var refs2 = new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }; 34703var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugDll, 34912var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 34997var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugDll, 35092var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugDll, 35190var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugDll, 35285var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugDll, 35467foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 35576foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 35689foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 35802foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 35908foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 36013foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 36111foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 36225foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 36402foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 36427foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() }) 36590foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 36615foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() }) 36778foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 36803foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() }) 37018var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: options, 38418foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 38444foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() }) 38770var refs1 = new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }; 38836var refs2 = new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }; 39015var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugDll, 39193var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 40050var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 41105var compilation3 = CreateCompilation(source3, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 41141var compilation6 = CreateCompilation(source2 + source3, new[] { compilation4.EmitToImageReference() }, options: TestOptions.DebugDll, 41267var refs1 = new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }; 41498var refs2 = new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }; 41688var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugDll, 41869var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 42037foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 42064foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() }) 42241foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 42268foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() }) 42445foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 42472foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() }) 43839var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 43976var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 44106var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 44218var references = new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }; 45106var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 45259var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 45398var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 45590var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 45727var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugExe, 45900(comp0:compilation0.EmitToImageReference(), comp1:compilation1.EmitToImageReference()) }) 46032foreach (var reference in new[] { compilation0.ToMetadataReference(), compilation0.EmitToImageReference() }) 46158foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 46301foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 46596MetadataReference metadataReference = compilation1.EmitToImageReference(); 47229MetadataReference metadataReference = compilation1.EmitToImageReference(); 47321MetadataReference metadataReference = compilation1.EmitToImageReference(); 47397MetadataReference metadataReference = compilation1.EmitToImageReference(); 47527MetadataReference metadataReference = compilation1.EmitToImageReference(); 47608MetadataReference metadataReference = compilation1.EmitToImageReference(); 47682MetadataReference metadataReference0 = compilation0.EmitToImageReference(); 47714MetadataReference metadataReference3 = compilation3.EmitToImageReference(); 47743MetadataReference metadataReference6 = compilation6.EmitToImageReference(); 47815MetadataReference metadataReference0 = compilation0.EmitToImageReference(); 47847MetadataReference metadataReference3 = compilation3.EmitToImageReference(); 47876MetadataReference metadataReference6 = compilation6.EmitToImageReference(); 47943MetadataReference metadataReference = compilation1.EmitToImageReference(); 48010MetadataReference metadataReference = compilation1.EmitToImageReference(); 48086MetadataReference metadataReference = compilation1.EmitToImageReference(); 48143MetadataReference metadataReference = compilation1.EmitToImageReference(); 48210MetadataReference metadataReference = compilation1.EmitToImageReference(); 48307MetadataReference metadataReference = compilation1.EmitToImageReference(); 48377MetadataReference metadataReference = compilation1.EmitToImageReference(); 48441MetadataReference metadataReference = compilation1.EmitToImageReference(); 48520MetadataReference metadataReference = compilation1.EmitToImageReference(); 48592MetadataReference metadataReference = compilation1.EmitToImageReference(); 48664MetadataReference metadataReference = compilation1.EmitToImageReference(); 48734MetadataReference metadataReference = compilation1.EmitToImageReference(); 48897MetadataReference metadataReference = compilation1.EmitToImageReference(); 48963MetadataReference metadataReference = compilation1.EmitToImageReference(); 49070MetadataReference metadataReference = compilation1.EmitToImageReference(); 49302MetadataReference metadataReference = compilation1.EmitToImageReference(); 49542MetadataReference metadataReference = compilation1.EmitToImageReference(); 49658foreach (var reference in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() }) 49774foreach (var reference in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() }) 50575foreach (var reference in new[] { piaCompilation.ToMetadataReference(embedInteropTypes: true), piaCompilation.EmitToImageReference(embedInteropTypes: true) }) 50620foreach (var reference in new[] { piaCompilation.ToMetadataReference(embedInteropTypes: true), piaCompilation.EmitToImageReference(embedInteropTypes: true) }) 50684var attributesRef = attributes.EmitToImageReference(); 50750var pia2Reference = pia2Compilation.EmitToImageReference(); 50755foreach (var reference2 in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 50805foreach (var reference in new[] { piaCompilation.ToMetadataReference(embedInteropTypes: true), piaCompilation.EmitToImageReference(embedInteropTypes: true) }) 51068foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 51235foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 51379foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 51516foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 51663foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 51803foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 51909foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 52508foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 52704foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 52865foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 53032foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 53204foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 53366foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 53501foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 54198foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 57486foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 57662foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 57816foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 57971foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 58130foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 58279foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 58403foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 59250foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 66749foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 66929foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 68189foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 68699var compilation3 = CreateCompilation(source2, new[] { compilation1.EmitToImageReference() }, options: TestOptions.DebugDll, 68864foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 68949foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
Symbols\DestructorTests.cs (1)
525var vbRef = CreateVisualBasicCompilation("VB", vb).EmitToImageReference();
Symbols\EnumTests.cs (4)
321var refA = comp.EmitToImageReference(); 333var refB = comp.EmitToImageReference(); 365var refA = comp.EmitToImageReference(); 377var refB = comp.EmitToImageReference();
Symbols\ExtendedPartialMethodsTests.cs (7)
2090verify(comp1.EmitToImageReference()); 2236verify(comp1.EmitToImageReference()); 2279verify(comp1.EmitToImageReference()); 2322verify(comp1.EmitToImageReference()); 2363verify(comp1.EmitToImageReference()); 2484verify(comp1.EmitToImageReference()); 2592var vbComp = CreateVisualBasicCompilation(vb, referencedAssemblies: TargetFrameworkUtil.GetReferences(TargetFramework.Standard).Add(comp.EmitToImageReference()));
Symbols\GenericConstraintTests.cs (5)
291var comp2 = CreateCompilation(source, new MetadataReference[] { comp1.EmitToImageReference() }); 7297new[] { metadataComp.EmitToImageReference() }, 7357var metadataComp = CreateCompilation(code, new[] { remappedComp11.EmitToImageReference() }, assemblyName: "intermediate", targetFramework: TargetFramework.NetStandard20); 7364new[] { metadataComp.EmitToImageReference(), remappedComp12.EmitToImageReference() },
Symbols\InterfaceImplementationTests.cs (1)
2755var comp1 = CreateCompilation("", references: new[] { comp0.EmitToImageReference() });
Symbols\Metadata\MetadataMemberTests.cs (4)
629var comp2 = CreateCompilation("", new[] { comp1.EmitToImageReference() }); 670var comp2 = CreateCompilation("", new[] { comp1.EmitToImageReference() }); 734var compilation = CreateCompilation("", options: options, references: new[] { compilation0.EmitToImageReference() }); 796var compilation = CreateCompilation("", options: TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.Internal), references: new[] { compilation0.EmitToImageReference() });
Symbols\Metadata\MetadataTypeTests.cs (1)
283var compilation2 = CreateEmptyCompilation(source2, new MetadataReference[] { Net40.References.mscorlib, Net40.References.SystemCore, compilation1.EmitToImageReference() },
Symbols\Metadata\PE\LoadingEvents.cs (1)
467var reference = CreateCompilation(source).EmitToImageReference();
Symbols\Metadata\PE\NoPia.cs (2)
1385var referencePIAImage = compilationPIA.EmitToImageReference(embedInteropTypes: true); 1391var referenceBaseImage = compilationBase.EmitToImageReference();
Symbols\Metadata\PE\TypeForwarders.cs (13)
1619var modRef1 = modCompilation.EmitToImageReference(); 1835var cB_ImageRef = cB.EmitToImageReference(); 1843var cC_v1_ImageRef = cC_v1.EmitToImageReference(); 1849var cA_v2_ImageRef = cA_v2.EmitToImageReference(); 1855var cD_ImageRef = cD.EmitToImageReference(); 1919var refA1 = compA1.EmitToImageReference(aliases: ImmutableArray.Create("A")); 1923var refB1 = compB1.EmitToImageReference(aliases: ImmutableArray.Create("B")); 1946var refBImpl = compBImpl.EmitToImageReference(); 1954comp = CreateCompilation(sourceProgram, references: new[] { refA1, compB2.EmitToImageReference(aliases: ImmutableArray.Create("B")), refBImpl }); 1983var refA1 = compA1.EmitToImageReference(aliases: ImmutableArray.Create("A")); 1987var refB1 = compB1.EmitToImageReference(aliases: ImmutableArray.Create("B")); 2010var refBImpl = compBImpl.EmitToImageReference(); 2018comp = CreateCompilation(sourceProgram, references: new[] { refA1, compB2.EmitToImageReference(aliases: ImmutableArray.Create("B")), refBImpl });
Symbols\MissingSpecialMember.cs (2)
492var publicLibRef = CreateEmptyCompilation(string.Format(libSourceTemplate, "public"), new[] { corlibRef }, parseOptions: parseOptions).EmitToImageReference(); 493var internalLibRef = CreateEmptyCompilation(string.Format(libSourceTemplate, "internal"), new[] { corlibRef }, parseOptions: parseOptions).EmitToImageReference();
Symbols\ModuleInitializers\ModuleInitializersTests.cs (2)
832var ref1 = comp1.EmitToImageReference(); 849var ref2 = comp2.EmitToImageReference();
Symbols\OverriddenOrHiddenMembersTests.cs (16)
2900var ref1 = comp1.EmitToImageReference(); 2903var ref2 = comp2.EmitToImageReference(); 2948var ref1 = comp1.EmitToImageReference(); 2951var ref2 = comp2.EmitToImageReference(); 2996var ref1 = comp1.EmitToImageReference(); 2999var ref2 = comp2.EmitToImageReference(); 3043var ref1 = comp1.EmitToImageReference(); 3046var ref2 = comp2.EmitToImageReference(); 3090var ref1 = comp1.EmitToImageReference(); 3093var ref2 = comp2.EmitToImageReference(); 3137var ref1 = comp1.EmitToImageReference(); 3140var ref2 = comp2.EmitToImageReference(); 3209var ref1 = comp1.EmitToImageReference(); 3212var ref2 = comp2.EmitToImageReference(); 3264var ref1 = comp1.EmitToImageReference(); 3267var ref2 = comp2.EmitToImageReference();
Symbols\PartialPropertiesTests.cs (2)
1142var reference = comp.EmitToImageReference(); 1189var reference = comp.EmitToImageReference();
Symbols\PEParameterSymbolTests.cs (1)
76").EmitToImageReference();
Symbols\RelaxedShiftOperatorTests.cs (1)
59var compilation3 = CreateCompilation(source1, options: TestOptions.DebugExe, references: new[] { compilation0.EmitToImageReference() },
Symbols\RequiredMembersTests.cs (37)
511comp = CreateCompilation(derived, references: new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 553MetadataReference baseReference = useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference(); 557comp = CreateCompilation(derivedDerived, new[] { baseReference, useMetadataReference ? derivedComp.ToMetadataReference() : derivedComp.EmitToImageReference() }); 599comp = CreateCompilation(derived, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 650var baseReference = useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference(); 655comp = CreateCompilation(derivedDerived, new[] { baseReference, useMetadataReference ? derivedComp.ToMetadataReference() : derivedComp.EmitToImageReference() }); 729var baseReference = useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference(); 802comp = CreateCompilation("#pragma warning disable CS0649 // Never assigned" + derived, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 1608comp = CreateCompilation(creation, references: new[] { useMetadataReference ? cComp.ToMetadataReference() : cComp.EmitToImageReference() }); 1635comp = CreateCompilation(creation, references: new[] { useMetadataReference ? cComp.ToMetadataReference() : cComp.EmitToImageReference() }); 1678comp = CreateCompilation(creation, references: new[] { useMetadataReference ? cComp.ToMetadataReference() : cComp.EmitToImageReference() }); 1703comp = CreateCompilation(creation, references: new[] { useMetadataReference ? cComp.ToMetadataReference() : cComp.EmitToImageReference() }); 2026comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2063var baseRef = useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference(); 2068comp = CreateCompilation(code, new[] { baseRef, useMetadataReference ? derivedComp.ToMetadataReference() : derivedComp.EmitToImageReference() }); 2120comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2153comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2184comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2352comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2387comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2426comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2458comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 3239var comp = CreateCompilation(c, new[] { il, originalComp.EmitToImageReference() }); 3284var comp = CreateCompilation(c, new[] { il, originalComp.EmitToImageReference() }); 3328var comp = CreateCompilation(c, new[] { il, originalComp.EmitToImageReference() }); 3369var comp = CreateCompilation(c, new[] { il, originalComp.EmitToImageReference() }); 3413var comp = CreateCompilation(c, new[] { il, originalComp.EmitToImageReference() }); 4664comp = CreateCompilation(derived, new[] { baseComp.EmitToImageReference() }); 4709comp = CreateCompilation(derived, new[] { baseComp.EmitToImageReference() }); 4754comp = CreateCompilation(derived, new[] { baseComp.EmitToImageReference() }); 4798comp = CreateCompilation(derived, new[] { baseComp.EmitToImageReference() }); 4844comp = CreateCompilation(derived, new[] { baseComp.EmitToImageReference() }); 5220comp = CreateCompilation(derived, new[] { baseComp.EmitToImageReference() }); 5366comp = CreateCompilation(derived, new[] { baseComp.EmitToImageReference() }); 5682var comp = CreateCompilationWithIL(code, ilSource: il, references: new[] { attrComp.EmitToImageReference() }); 5896comp = CreateCompilation(code, references: new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 5975comp = CreateCompilation(code, references: new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() });
Symbols\Retargeting\NoPia.cs (10)
1537references: new MetadataReference[] { pia.EmitToImageReference(embedInteropTypes: true) }); 1591references: new MetadataReference[] { pia.EmitToImageReference(embedInteropTypes: true) }); 1644references: new MetadataReference[] { pia.EmitToImageReference(embedInteropTypes: true) }); 1686references: new MetadataReference[] { pia.EmitToImageReference(embedInteropTypes: true) }); 1741references: new MetadataReference[] { pia.EmitToImageReference(embedInteropTypes: true) }); 1809references: new MetadataReference[] { pia.EmitToImageReference(embedInteropTypes: true), lib.EmitToImageReference() }); 2603references: new[] { module1.EmitToImageReference() }); 2663foreach (MetadataReference piaRef in new[] { piaCompilation.EmitToImageReference(), piaCompilation.ToMetadataReference() }) 2667foreach (MetadataReference consumer1Ref in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() })
Symbols\Source\BaseClassTests.cs (1)
1894var metadataRef = CreateCompilation(source).EmitToImageReference(embedInteropTypes: true);
Symbols\Source\ClsComplianceTests.cs (23)
495var lib1 = CreateCompilation(libSource1, assemblyName: "lib1", parseOptions: TestOptions.Regular11).EmitToImageReference(); 496var lib2 = CreateCompilation(libSource2, assemblyName: "lib2", parseOptions: TestOptions.Regular11).EmitToImageReference(); 497var lib3 = CreateCompilation(libSource3, assemblyName: "lib3", parseOptions: TestOptions.Regular11).EmitToImageReference(); 561var lib1 = CreateCompilation(libSource1, assemblyName: "lib1", options: TestOptions.UnsafeDebugDll).EmitToImageReference(); 562var lib2 = CreateCompilation(libSource2, assemblyName: "lib2", options: TestOptions.UnsafeDebugDll).EmitToImageReference(); 563var lib3 = CreateCompilation(libSource3, assemblyName: "lib3", options: TestOptions.UnsafeDebugDll).EmitToImageReference(); 582lib1 = CreateCompilation(libSource1, assemblyName: "lib1").EmitToImageReference(); 583lib2 = CreateCompilation(libSource2, assemblyName: "lib2").EmitToImageReference(); 584lib3 = CreateCompilation(libSource3, assemblyName: "lib3").EmitToImageReference(); 643var libCompliant = CreateCompilationWithMscorlib46(libCompliant_cs).EmitToImageReference(); 651var libNotCompliant = CreateCompilationWithMscorlib46(libNotCompliant_cs).EmitToImageReference(); 2366var trueModuleRef = CreateCompilation("[assembly:System.CLSCompliant(true)][module:System.CLSCompliant(true)]", options: TestOptions.ReleaseModule, assemblyName: "true").EmitToImageReference(); 2367var falseModuleRef = CreateCompilation("[assembly:System.CLSCompliant(false)][module:System.CLSCompliant(false)]", options: TestOptions.ReleaseModule, assemblyName: "false").EmitToImageReference(); 2368var noneModuleRef = CreateCompilation("", options: TestOptions.ReleaseModule, assemblyName: "none").EmitToImageReference(); 2401var trueModuleRef = CreateCompilation("[assembly:System.CLSCompliant(true)]", options: TestOptions.ReleaseModule, assemblyName: "true").EmitToImageReference(); 2402var falseModuleRef = CreateCompilation("[assembly:System.CLSCompliant(false)]", options: TestOptions.ReleaseModule, assemblyName: "false").EmitToImageReference(); 2403var noneModuleRef = CreateCompilation("", options: TestOptions.ReleaseModule, assemblyName: "none").EmitToImageReference(); 2434var trueModuleRef = CreateCompilation("[assembly:System.CLSCompliant(true)][module:System.CLSCompliant(true)]", options: TestOptions.ReleaseModule, assemblyName: "true").EmitToImageReference(); 2435var falseModuleRef = CreateCompilation("[assembly:System.CLSCompliant(false)][module:System.CLSCompliant(false)]", options: TestOptions.ReleaseModule, assemblyName: "false").EmitToImageReference(); 3459var libRef = CreateCompilation(libSource).EmitToImageReference(); 3646var libRef = CreateCompilation(libSource).EmitToImageReference(); 3756var libRef = CreateCompilation(libSource, assemblyName: "lib").EmitToImageReference(); 3879var comp2 = CreateCompilation(source2, new[] { comp1.EmitToImageReference() }, TestOptions.ReleaseDll.WithConcurrentBuild(false));
Symbols\Source\EventTests.cs (5)
416var libAssemblyRef = libComp.EmitToImageReference(); 462var libAssemblyRef = libComp.EmitToImageReference(); 536var libAssemblyRef = libComp.EmitToImageReference(); 595var libAssemblyRef = libComp.EmitToImageReference(); 627var libAssemblyRef = libComp.EmitToImageReference();
Symbols\Source\ExternAliasTests.cs (5)
38s_goo1 = comp.EmitToImageReference(aliases: ImmutableArray.Create("Bar")); 63s_goo2 = comp.EmitToImageReference(aliases: ImmutableArray.Create("Bar")); 317var goo1Alias = comp.EmitToImageReference(aliases: ImmutableArray.Create("global")); 396var ref1 = comp1.EmitToImageReference(aliases: ImmutableArray.Create("X")); 399var ref2 = comp2.EmitToImageReference(aliases: ImmutableArray.Create("X"));
Symbols\Source\FileModifierTests.cs (9)
4153var comp2 = CreateCompilation("", references: new[] { comp.EmitToImageReference() }); 4184var comp2 = CreateCompilation("", references: new[] { comp.EmitToImageReference() }); 4249var comp2 = CreateCompilation("", references: new[] { comp.EmitToImageReference() }); 4277firstIsMetadataReference ? ref1.ToMetadataReference() : ref1.EmitToImageReference(), 4278secondIsMetadataReference ? ref2.ToMetadataReference() : ref2.EmitToImageReference() 4428var referencingImageComp = CreateCompilation("", new[] { comp.EmitToImageReference() }); 4505var reference = useMetadataReference ? comp0.ToMetadataReference() : comp0.EmitToImageReference(); 5110var comp2 = CreateCompilation(new[] { (source2, "File2.cs") }, references: new[] { useMetadataReference ? comp1.ToMetadataReference() : comp1.EmitToImageReference() }); 5116comp1 = CreateCompilation(new[] { (source1, "File1.cs") }, references: new[] { useMetadataReference ? comp2.ToMetadataReference() : comp2.EmitToImageReference() });
Symbols\Source\NullablePublicAPITests.cs (4)
463var comp1Emit = comp1.EmitToImageReference(); 468var comp2Emit = comp2.EmitToImageReference(); 1049var comp1Emit = comp1.EmitToImageReference(); 1054var comp2Emit = comp2.EmitToImageReference();
Symbols\Source\RecordTests.cs (1)
1355emitReference ? comp.EmitToImageReference() : comp.ToMetadataReference()
Symbols\StaticAbstractMembersInInterfacesTests.cs (49)
6387references: new[] { compilation1.EmitToImageReference() }); 6488references: new[] { compilation1.EmitToImageReference() }); 6617references: new[] { compilation1.EmitToImageReference() }); 6753references: new[] { compilation1.EmitToImageReference() }); 6882references: new[] { compilation1.EmitToImageReference() }); 7011references: new[] { compilation1.EmitToImageReference() }); 16190foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 16671foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 16759foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 16851foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 16933foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 17015foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 17086foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 17160foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 17247foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 17346foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 17452foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 19918foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 19992foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 20075foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 20155foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 21283foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 21343foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 21446foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 21566foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 21689foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 21798foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 21900foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 23208foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 24769foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 24884foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 25011foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 25082foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 25895foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 27434foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 27549foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 27677foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 27748foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 28882foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 29507foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 29624foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 29730foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 31714references: new[] { compilation0.EmitToImageReference() }); 33094foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 33161foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 33228foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 33295foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 33665var compilation3 = CreateCompilation(source2, options: TestOptions.DebugDll, references: new[] { compilation1.EmitToImageReference() }, 33722var compilation3 = CreateCompilation(source2, options: TestOptions.DebugDll, references: new[] { compilation1.EmitToImageReference() },
Symbols\SymbolDistinguisherTests.cs (19)
33var libRef = CreateCompilation(tree, assemblyName: "Metadata").EmitToImageReference(); 158var libRef = CreateCompilation(source, assemblyName: "Metadata").EmitToImageReference(); 182var libRef = CreateCompilation(tree, assemblyName: "Metadata").EmitToImageReference(); 208var libRef = CreateCompilation(tree, assemblyName: "Metadata").EmitToImageReference(); 233var libRef = CreateCompilation(tree, assemblyName: "Metadata", options: TestOptions.UnsafeReleaseDll).EmitToImageReference(); 258var libRef = CreateCompilation(tree, assemblyName: "Metadata").EmitToImageReference(); 280var libRef = CreateCompilation(tree, assemblyName: "Metadata").EmitToImageReference(); 297var libRef = CreateCompilation("public class dynamic { }", assemblyName: "Metadata").EmitToImageReference(); 350var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference(); 384var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference(); 418var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference(); 450var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference(); 482var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference(); 511var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference(); 546var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference(); 611var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference(); 648var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference(); 679var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference(); 740var ref1 = compilation1.EmitToImageReference();
Symbols\SymbolErrorTests.cs (23)
6911var mod3Ref = CreateCompilation(mod3Source, options: TestOptions.ReleaseModule, assemblyName: "ErrTestMod03").EmitToImageReference(); 6996var mod3Ref = CreateCompilation(mod3Source, options: TestOptions.ReleaseModule, assemblyName: "ErrTestMod03").EmitToImageReference(); 7067var ModuleA01Ref = CreateCompilation(ModuleA01, options: TestOptions.ReleaseModule, assemblyName: "ModuleA01").EmitToImageReference(); 7075var ModuleB01Ref = CreateCompilation(ModuleB01, options: TestOptions.ReleaseModule, assemblyName: "ModuleB01").EmitToImageReference(); 7229var moduleRef2 = CreateCompilation(mod2Source, options: TestOptions.ReleaseModule, assemblyName: "mod_1_2").EmitToImageReference(); 7274EmitToImageReference(); 7286EmitToImageReference(); 7292EmitToImageReference(); 7298EmitToImageReference(); 7304EmitToImageReference(); 16438var ref1 = vbcomp.EmitToImageReference(embedInteropTypes: true); 20404var comp4 = CreateCompilation(source3, new[] { comp2.EmitToImageReference() }, options: TestOptions.ReleaseDll); 20683var referenceC = CreateCompilation(codeC, assemblyName: "C").EmitToImageReference(); 20698var referenceB = CreateCompilation(codeB, references: new MetadataReference[] { referenceC }, assemblyName: "B").EmitToImageReference(); 20747var referenceC = CreateCompilation(codeC, assemblyName: "C").EmitToImageReference(); 20762var referenceB = CreateCompilation(codeB, references: new MetadataReference[] { referenceC }, assemblyName: "B").EmitToImageReference(); 20810var referenceD = CreateCompilation(codeD, assemblyName: "D").EmitToImageReference(); 20877var dReference = CreateCompilation(dCode, assemblyName: "D").EmitToImageReference(); 21011var referenceC = CreateCompilation(codeC, assemblyName: "C").EmitToImageReference(); 21026var referenceB = CreateCompilation(codeB, references: new MetadataReference[] { referenceC }, assemblyName: "B").EmitToImageReference(); 21053var referenceE = CreateCompilation(codeC, assemblyName: "E").EmitToImageReference(); 21576var comp2Ref = comp2.EmitToImageReference(); 21671var comp2Ref = comp2.EmitToImageReference();
Symbols\TypeTests.cs (1)
808assemblyName: "System.Console").EmitToImageReference();
Symbols\UnsignedRightShiftTests.cs (7)
1999var compilation3 = CreateCompilation(source1, options: TestOptions.DebugExe, references: new[] { compilation0.EmitToImageReference() }, 2251var compilation3 = CreateCompilation(source1, options: TestOptions.DebugExe, references: new[] { compilation0.EmitToImageReference() }, 2288var compilation3 = CreateCompilation(source1, options: TestOptions.DebugDll, references: new[] { compilation0.EmitToImageReference() }, 3443foreach (var reference in new[] { compilation0.ToMetadataReference(), compilation0.EmitToImageReference() }) 3495foreach (var reference in new[] { compilation0.ToMetadataReference(), compilation0.EmitToImageReference() }) 3547foreach (var reference in new[] { compilation0.ToMetadataReference(), compilation0.EmitToImageReference() }) 3599foreach (var reference in new[] { compilation0.ToMetadataReference(), compilation0.EmitToImageReference() })
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\FieldAndValueKeywordTests.cs (1)
1210var refA = comp.EmitToImageReference();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (8)
CSharpTestBase.cs (8)
663CreateCompilation(RefSafetyRulesAttributeDefinition).EmitToImageReference(); 2267references: new[] { reference.EmitToImageReference() }, 2285references: new List<MetadataReference>() { NetFramework.mscorlib, NetFramework.SystemCore, NetFramework.MicrosoftCSharp, reference.EmitToImageReference() }, 2312references: new List<MetadataReference>() { reference.EmitToImageReference() }, 2323references: new List<MetadataReference>() { reference.EmitToImageReference() }, 2334references: new List<MetadataReference>() { reference.EmitToImageReference() }, 2351references: new List<MetadataReference>() { reference.EmitToImageReference() }, 2369references: new List<MetadataReference>() { reference.EmitToImageReference() },
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
Metadata\WinMdEventTests.cs (1)
242assemblyName: "EventLibrary").EmitToImageReference();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (1)
51references: [TestBase.MscorlibRef]).EmitToImageReference();
Microsoft.CodeAnalysis.Test.Utilities (3)
CommonTestBase.cs (2)
490references.Add(referencedCompilation.EmitToImageReference()); 497return useCompilationReference ? comp.ToMetadataReference() : comp.EmitToImageReference();
Mocks\Silverlight.cs (1)
99references: [mscorlibCompilation.EmitToImageReference()],
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\SuppressMessageAttributeCompilerTests.cs (1)
61references: new[] { TestBase.MscorlibRef }).EmitToImageReference();
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (41)
Attributes\AssemblyAttributes.vb (23)
550</compilation>, {compilation.EmitToImageReference()}, TestOptions.ReleaseDll) 581</compilation>, {compilation.EmitToImageReference()}, TestOptions.ReleaseDll) 614</compilation>, {compilation.EmitToImageReference()}, TestOptions.ReleaseDll) 663</compilation>, {compilation.EmitToImageReference()}, TestOptions.ReleaseDll) 1017</compilation>, options:=TestOptions.ReleaseDll, references:={hash_module_Comp.EmitToImageReference()}) 1346Dim modRef = DirectCast(consoleappCompilation.EmitToImageReference(), MetadataImageReference) 1457Dim modRef = DirectCast(consoleappCompilation.EmitToImageReference(), MetadataImageReference) 1641Dim netmodule2Ref = comp.EmitToImageReference() 1927Dim assembly = CreateCompilationWithMscorlib40(assemblySrc, references:={[module].EmitToImageReference()}) 2077{compMod1.EmitToImageReference(), compMod2.EmitToImageReference()}, 2127{compMod1.EmitToImageReference(), compMod2.EmitToImageReference()}, 2175{compMod1.EmitToImageReference(), compMod2.EmitToImageReference()}, 2224{compMod1.EmitToImageReference(), compMod2.EmitToImageReference()}, 2259Dim attributeDefinition1 = CreateCompilation(attribute1, options:=TestOptions.ReleaseDll).EmitToImageReference() 2268Dim moduleWithAttribute = CreateCompilation([module], references:={attributeDefinition1}, options:=TestOptions.ReleaseModule).EmitToImageReference() 2301Dim attributeDefinition2 = CreateCompilation(attribute2, options:=TestOptions.ReleaseDll).EmitToImageReference() 2323Dim c1Definition = CreateCompilation(c1, options:=TestOptions.ReleaseDll).EmitToImageReference() 2339Dim module1WithAttribute = CreateCompilation(module1, references:={c1Definition}, options:=TestOptions.ReleaseModule).EmitToImageReference() 2374Dim module2WithAttribute = CreateCompilation(module2, references:={c1Definition}, options:=TestOptions.ReleaseModule).EmitToImageReference()
Attributes\InternalsVisibleToAndStrongNameTests.vb (8)
675Dim reference = c1.EmitToImageReference() 711Dim reference = c1.EmitToImageReference() 1163Dim comp3 = CreateCompilation(src, references:={comp.EmitToImageReference()}, 1221{other.EmitToImageReference()}, 2483comp = CreateCompilation(source, {other.EmitToImageReference()}) 2521comp = CreateCompilation(source, {other.EmitToImageReference()}) 2568Dim imageReference As MetadataReference = other.EmitToImageReference() 2685Dim imageReference As MetadataReference = other.EmitToImageReference()
Emit\CompilationEmitTests.vb (7)
1506Dim metadataImage = comp.EmitToImageReference(emitMetadataOnly) 1540Dim refImage = comp.EmitToImageReference(emitRefOnly) 1608Dim metadataImage = comp.EmitToImageReference(emitMetadataOnly) 1627Dim refImage = comp.EmitToImageReference(emitRefOnly) 1687Dim metadataImage = comp.EmitToImageReference(emitMetadataOnly) 1707Dim refImage = comp.EmitToImageReference(emitRefOnly) 1739Dim refImage = comp.EmitToImageReference(emitRefOnly)
Emit\EditAndContinue\AssemblyReferencesTests.vb (3)
254Dim compilation0 = CreateCompilationWithMscorlib40({src0}, {lib0.EmitToImageReference()}, assemblyName:="C", options:=TestOptions.DebugDll) 255Dim compilation1 = compilation0.WithSource(src1).WithReferences({MscorlibRef, lib1.EmitToImageReference()}) 256Dim compilation2 = compilation1.WithSource(src2).WithReferences({MscorlibRef, lib2.EmitToImageReference()})
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (47)
Compilation\CompilationAPITests.vb (16)
875</compilation>, references:={netModule1.EmitToImageReference()}, options:=TestOptions.ReleaseModule) 887</compilation>, references:={netModule2.EmitToImageReference()}) 899</compilation>, references:={netModule1.EmitToImageReference(), netModule2.EmitToImageReference()}) 927</compilation>, references:={netModule1.EmitToImageReference()}, options:=TestOptions.ReleaseModule) 939</compilation>, references:={netModule1.EmitToImageReference()}, options:=TestOptions.ReleaseModule) 952</compilation>, references:={netModule2.EmitToImageReference(), netModule3.EmitToImageReference()}) 1011</compilation>, references:={netModule1.EmitToImageReference()}, options:=TestOptions.ReleaseModule) 1023</compilation>, references:={netModule1.EmitToImageReference(), netModule2.EmitToImageReference()}) 2551</compilation>, {moduleComp.EmitToImageReference()}) 2753Dim corlibWithoutValueTupleRef = CreateEmptyCompilation(corlib, assemblyName:="corlibWithoutValueTupleRef").EmitToImageReference() 2754Dim corlibWithValueTupleRef = CreateEmptyCompilation(corlib + tuple, assemblyName:="corlibWithValueTupleRef").EmitToImageReference() 2756Dim libWithIsExternalInitRef = CreateEmptyCompilation(tuple, references:={corlibWithoutValueTupleRef}, assemblyName:="libWithIsExternalInit").EmitToImageReference() 2757Dim libWithIsExternalInitRef2 = CreateEmptyCompilation(tuple, references:={corlibWithoutValueTupleRef}, assemblyName:="libWithIsExternalInit2").EmitToImageReference()
Semantics\NativeIntegerTests.vb (1)
22Dim ref0 = comp.EmitToImageReference()
Semantics\RequiredMembersTests.vb (30)
28Dim csharpReference = CreateCSharpCompilationWithRequiredMembers(csharp).EmitToImageReference() 249Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 272Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 293Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 309Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 351Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 380Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 403Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 419Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 601Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 621Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 641Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 657Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 673Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 693Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 714Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 736Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 1328End Module", {cComp.EmitToImageReference()}) 1360End Module", {cComp.EmitToImageReference()}) 1391Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 1408Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 1416Dim vbComp = CreateCompilation("", {cComp.EmitToImageReference()}) 1447Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 1601Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 1623Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 1652Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 1674Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 1712Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 1744Dim comp = CreateCompilation(vbCode, {cComp.EmitToImageReference()}) 2470End Module", {csharpComp.EmitToImageReference()}, targetFramework:=TargetFramework.Net70)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (4)
CompilationAPITests.vb (1)
115Return If(useMetadataReference, referenceComp.ToMetadataReference(), referenceComp.EmitToImageReference())
UsedAssembliesTests.vb (3)
427Dim comp2ImageRef = comp2.EmitToImageReference() 449comp2ImageRef = comp2.EmitToImageReference() 469comp2ImageRef = comp2.EmitToImageReference()