895 references to CreateEmptyCompilation
InteractiveHost.UnitTests (1)
AbstractInteractiveHostTests.cs (1)
197var compilation = CreateEmptyCompilation(
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (185)
CodeGen\CodeGenAsyncMainTests.cs (4)
362var corCompilation = CreateEmptyCompilation(corAssembly, options: TestOptions.DebugDll); 381var sourceCompilation = CreateEmptyCompilation(source, new[] { corCompilation.ToMetadataReference(), taskCompilation.ToMetadataReference() }, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 402var corCompilation = CreateEmptyCompilation(corAssembly, options: TestOptions.DebugDll); 421var sourceCompilation = CreateEmptyCompilation(source, new[] { corCompilation.ToMetadataReference(), taskCompilation.ToMetadataReference() }, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1));
CodeGen\CodeGenAsyncTests.cs (4)
3311var comp = CSharpTestBase.CreateEmptyCompilation(source, new[] { Net40.References.mscorlib }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers. 3341var comp = CSharpTestBase.CreateEmptyCompilation(source, new[] { Net40.References.mscorlib }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers. 3372var comp = CSharpTestBase.CreateEmptyCompilation(source, new[] { Net40.References.mscorlib }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers. 4991var compilation = CreateEmptyCompilation(new[] { Parse(source) });
CodeGen\CodeGenDeconstructTests.cs (2)
7834var comp1 = CreateEmptyCompilation(source1, WinRtRefs, TestOptions.ReleaseWinMD, TestOptions.Regular); 7881var comp1 = CreateEmptyCompilation(source1, WinRtRefs, TestOptions.ReleaseWinMD, TestOptions.Regular);
CodeGen\CodeGenExprLambdaTests.cs (4)
3587var comp = CreateEmptyCompilation( 5378var compilation = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 5440var compilation = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 5513var compilation = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
CodeGen\CodeGenFunctionPointersTests.cs (8)
7563var allInCoreLib = CreateEmptyCompilation(source1 + source2, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 7580var coreLib = CreateEmptyCompilation(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 7583var comp1 = CreateEmptyCompilation(source2, references: new[] { coreLib.EmitToImageReference() }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 7632var allInCoreLib = CreateEmptyCompilation(source1 + source2, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 7649var coreLib = CreateEmptyCompilation(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 7652var comp1 = CreateEmptyCompilation(source2, references: new[] { coreLib.EmitToImageReference() }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 7874var comp = CreateEmptyCompilation(new[] { @" 7914var comp = CreateEmptyCompilation(new[] { @"
CodeGen\CodeGenIterators.cs (3)
2390var compilation = CreateEmptyCompilation(new[] { Parse(source, options: parseOptions), Parse(corlib, options: parseOptions) }); 2435var compilation = CreateEmptyCompilation(new[] { Parse(source, options: TestOptions.Regular.WithNoRefSafetyRulesAttribute()) }); 2499var compilation = CreateEmptyCompilation(new[] { Parse(source, options: TestOptions.Regular.WithNoRefSafetyRulesAttribute()) });
CodeGen\CodeGenLockTests.cs (1)
1745return CreateEmptyCompilation(new string[] { text }, new[] { Net20.References.mscorlib });
CodeGen\CodeGenMscorlib.cs (21)
153var c = CreateEmptyCompilation(text, options: TestOptions.UnsafeReleaseDll); 204CreateEmptyCompilation( 223var compilation = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 247var compilation1 = CreateEmptyCompilation(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName()); 257var compilation2 = CreateEmptyCompilation(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 }); 281var compilation1 = CreateEmptyCompilation(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName()); 298var compilation2 = CreateEmptyCompilation(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 }); 318var compilation1 = CreateEmptyCompilation(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName()); 335var compilation2 = CreateEmptyCompilation(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 }); 356var compilation1 = CreateEmptyCompilation(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName()); 374var compilation2 = CreateEmptyCompilation(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 }); 415var compilation1 = CreateEmptyCompilation(source1, assemblyName: GetUniqueName()); 433var compilation2 = CreateEmptyCompilation(source2, new[] { reference1 }); 477var compilation1 = CreateEmptyCompilation(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName()); 490var compilation2 = CreateEmptyCompilation(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 }); 547CreateEmptyCompilation( 612var comp = CreateEmptyCompilation( 750var comp = CreateEmptyCompilation( 880var comp = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll).VerifyDiagnostics(); 1037var comp = CreateEmptyCompilation(text, options: TestOptions.UnsafeReleaseDll); 1163var comp = CreateEmptyCompilation(text, options: TestOptions.UnsafeReleaseDll);
CodeGen\CodeGenTests.cs (4)
10516CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()).VerifyEmitDiagnostics( 14564var compilation = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 14598var compilation = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 14634var compilation = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
CodeGen\CodeGenTupleEqualityTests.cs (1)
2628var comp = CreateEmptyCompilation(source);
CodeGen\CodeGenTupleTest.cs (38)
4105var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7), 25316var corlibWithoutVT = CreateEmptyCompilation(new[] { Parse(String.Format(versionTemplate, "1") + corlib_cs, options: parseOptions) }, assemblyName: "corlib"); 25320var corlibWithVT = CreateEmptyCompilation(new[] { Parse(String.Format(versionTemplate, "2") + corlib_cs + valuetuple_cs, options: parseOptions) }, assemblyName: "corlib"); 25324var libWithVT = CreateEmptyCompilation(valuetuple_cs, references: new[] { corlibWithoutVTRef }, parseOptions: parseOptions, options: TestOptions.DebugDll); 25344var libWithVTRef2 = CreateEmptyCompilation(valuetuple_cs, references: new[] { corlibWithoutVTRef }, parseOptions: parseOptions).EmitToImageReference(); 25345var comp4 = CreateEmptyCompilation("", references: new[] { libWithVTRef, libWithVTRef2, corlibWithoutVTRef }, parseOptions: parseOptions); 25688var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25733var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25759var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25804var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25830var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25869var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25902var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 26669var vtLib = CreateEmptyCompilation(trivial2uple + tupleattributes_cs, references: new[] { MscorlibRef }, assemblyName: "vt"); 26681var lib = CreateEmptyCompilation(lib_cs, references: new[] { MscorlibRef, vtLib.EmitToImageReference() }); 26692var comp = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to vt 26696var compWithMetadataReference = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.ToMetadataReference() }); // missing reference to vt 26700var fakeVtLib = CreateEmptyCompilation("", references: new[] { MscorlibRef }, assemblyName: "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 26771var vtLib = CreateEmptyCompilation(tuplelib_cs + tupleattributes_cs, references: new[] { MscorlibRef }, assemblyName: "vt"); 26783var lib = CreateEmptyCompilation(lib_cs, references: new[] { MscorlibRef, vtLib.EmitToImageReference() }); 26797var fakeVtLib = CreateEmptyCompilation("", references: new[] { MscorlibRef }, assemblyName: "vt"); 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 26835var containerLib = CreateEmptyCompilation("public class Container<T> { }", references: new[] { MscorlibRef }, assemblyName: "container"); 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 26862var compWithMetadataReference = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.ToMetadataReference() }); // missing reference to container 26866var fakeContainerLib = CreateEmptyCompilation("", references: new[] { MscorlibRef }, assemblyName: "container"); 26867var compWithFakeContainer = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeContainerLib.EmitToImageReference() }); // reference to fake container 26910var containerLib = CreateEmptyCompilation("public class Container<T> { public class Contained<U> { } }", references: new[] { MscorlibRef }, assemblyName: "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 26937var compWithMetadataReference = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.ToMetadataReference() }); // missing reference to container 26941var fakeContainerLib = CreateEmptyCompilation("", references: new[] { MscorlibRef }, assemblyName: "container"); 26942var compWithFakeContainer = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeContainerLib.EmitToImageReference() }); // reference to fake container
CodeGen\EventTests.cs (2)
646var compilation1 = CreateEmptyCompilation(source1, assemblyName: GetUniqueName(), parseOptions: parseOptions); 664var compilation2 = CreateEmptyCompilation(source2, new[] { reference1 }, parseOptions: parseOptions);
CodeGen\ForeachTest.cs (1)
630var comp = CreateEmptyCompilation(@"
CodeGen\PatternTests.cs (5)
99var compilation = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.ReleaseDll); 122var compilation = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 152var compilation = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 200var compilation = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll); 3315var compilation = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.ReleaseDll);
CodeGen\SwitchTests.cs (1)
4512var comp = CreateEmptyCompilation(
CodeGen\WinMdDelegateTests.cs (2)
142var winRtDelegateLibrary = CreateEmptyCompilation( 150var nonWinRtDelegateLibrary = CreateEmptyCompilation(
Emit\CompilationEmitTests.cs (67)
896var compWithMetadata = CreateEmptyCompilation("", references: new[] { MscorlibRef, metadataRef }, 1309CSharpCompilation moduleComp = CreateEmptyCompilation("", 2123CSharpCompilation comp = CreateEmptyCompilation(source, references: new[] { MscorlibRef }, 2132var compWithReal = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage }, 2163var compWithReal2 = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage2 }, 2191var compWithMetadata = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, metadataImage }, 2220var compWithRef = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage }, 2262CSharpCompilation comp = CreateEmptyCompilation(source, parseOptions: parseOptions, references: new[] { MscorlibRef }, 2269var compWithReal = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage }, 2279var compWithMetadata = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, metadataImage }, 2291var compWithRef = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage }, 2329CSharpCompilation comp = CreateEmptyCompilation(source, parseOptions: parseOptions, references: new[] { MscorlibRef }, 2336var compWithReal = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage }, 2346var compWithMetadata = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, metadataImage }, 2358var compWithRef = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage }, 2396CSharpCompilation comp = CreateEmptyCompilation(source, parseOptions: parseOptions, references: new[] { MscorlibRef }, 2403var compWithReal = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage }, 2413var compWithMetadata = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, metadataImage }, 2425var compWithRef = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage }, 2456CSharpCompilation comp = CreateEmptyCompilation(source, parseOptions: parseOptions, references: new[] { MscorlibRef }, 2464var compWithRef = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage }, 2501CSharpCompilation comp = CreateEmptyCompilation(source, parseOptions: parseOptions, references: new[] { MscorlibRef }, 2509var compWithRef = CreateEmptyCompilation("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage }, 2523CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2537CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2551CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2566CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2579CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2593CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2606CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2632CSharpCompilation comp = CreateEmptyCompilation("", references: new[] { MscorlibRef }, 2652CSharpCompilation comp = CreateEmptyCompilation(source, references: new[] { MscorlibRef }, 4678var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(Platform.Itanium), assemblyName: "PlatformMismatch"); 4690var useCompilation = CreateEmptyCompilation(useSource, 4696useCompilation = CreateEmptyCompilation(useSource, 4702useCompilation = CreateEmptyCompilation(useSource, 4708useCompilation = CreateEmptyCompilation(useSource, 4714useCompilation = CreateEmptyCompilation(useSource, 4722useCompilation = CreateEmptyCompilation(useSource, 4730useCompilation = CreateEmptyCompilation(useSource, 4738useCompilation = CreateEmptyCompilation(useSource, 4763var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(Platform.Itanium), assemblyName: "PlatformMismatch"); 4774var useCompilation = CreateEmptyCompilation(useSource, 4782useCompilation = CreateEmptyCompilation(useSource, 4790useCompilation = CreateEmptyCompilation(useSource, 4808var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(Platform.X86), assemblyName: "PlatformMismatch"); 4821var useCompilation = CreateEmptyCompilation(useSource, 4829useCompilation = CreateEmptyCompilation(useSource, 4837useCompilation = CreateEmptyCompilation(useSource, 4845useCompilation = CreateEmptyCompilation(useSource, 4864var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(Platform.X86), assemblyName: "PlatformMismatch"); 4876var useCompilation = CreateEmptyCompilation(useSource, 4895var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(Platform.AnyCpu), assemblyName: "PlatformMismatch"); 4908var useCompilation = CreateEmptyCompilation(useSource, 4914useCompilation = CreateEmptyCompilation(useSource, 4920useCompilation = CreateEmptyCompilation(useSource, 4926useCompilation = CreateEmptyCompilation(useSource, 4943var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(Platform.AnyCpu), assemblyName: "PlatformMismatch"); 4955var useCompilation = CreateEmptyCompilation(useSource, 4972var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(Platform.Itanium), assemblyName: "PlatformMismatch"); 4985var useCompilation = CreateEmptyCompilation(useSource, 4991useCompilation = CreateEmptyCompilation(useSource, 4997useCompilation = CreateEmptyCompilation(useSource, 5003useCompilation = CreateEmptyCompilation(useSource, 5020var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(Platform.Itanium), assemblyName: "PlatformMismatch"); 5033var useCompilation = CreateEmptyCompilation(useSource, 5043var comp = CreateEmptyCompilation("", new[] { TestReferences.SymbolsTests.netModule.x64COFF }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugDll);
Emit\CovariantReturnTests.cs (2)
226var compilation = CreateEmptyCompilation(new string[] { 244return CreateEmptyCompilation(
Emit\DeterministicTests.cs (4)
36var compilation = CreateEmptyCompilation(source, 55var compilation = CreateEmptyCompilation(source, assemblyName: "DeterminismTest", references: new[] { MscorlibRef, SystemCoreRef, CSharpRef }, options: options); 74var compilationDeterministic = CreateEmptyCompilation( 78var compilationNonDeterministic = CreateEmptyCompilation(
Emit\InAttributeModifierTests.cs (11)
1505CreateEmptyCompilation(code).VerifyDiagnostics( 1526CreateEmptyCompilation(code).VerifyDiagnostics( 1547CreateEmptyCompilation(code).VerifyDiagnostics( 1567CreateEmptyCompilation(code).VerifyDiagnostics( 1591CreateEmptyCompilation(code).VerifyDiagnostics( 1616CreateEmptyCompilation(code).VerifyDiagnostics( 1637CreateEmptyCompilation(code).VerifyDiagnostics( 4457var corlibWithoutInAttributeRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 4465var ref1 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutInAttributeRef }).EmitToImageReference(); 4466var ref2 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutInAttributeRef }).EmitToImageReference(); 4474CreateEmptyCompilation(user, references: new[] { ref1, ref2, corlibWithoutInAttributeRef })
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (58)
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 (7)
66var compilation0 = CreateEmptyCompilation(src1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: references); 137var md1 = AssemblyMetadata.CreateFromStream(CreateEmptyCompilation(srcPE, parseOptions: parseOptions, references: new[] { MscorlibRef, SystemRef }).EmitToStream()); 139var compilation0 = CreateEmptyCompilation(src1, parseOptions: parseOptions, references: new[] { MscorlibRef }); 211var compilation0 = CreateEmptyCompilation(src0, new[] { MscorlibRef, lib0.ToMetadataReference() }, assemblyName: "C", options: TestOptions.DebugDll); 315var compilation0 = CreateEmptyCompilation(src0, new[] { MscorlibRef, lib0.ToMetadataReference() }, assemblyName: "C", options: TestOptions.DebugDll); 398var compilation0 = CreateEmptyCompilation(src0, new[] { MscorlibRef, lib0.EmitToImageReference() }, assemblyName: "C", options: TestOptions.DebugDll); 482var compilation0 = CreateEmptyCompilation(src0, new[] { MscorlibRef, ref01, ref11 }, assemblyName: "C", options: TestOptions.DebugDll);
Emit\EditAndContinue\LocalSlotMappingTests.cs (2)
1147var compilation0 = CreateEmptyCompilation(source, options: TestOptions.DebugDll, references: new[] { MscorlibRef_v20 }); 1148var compilation1 = CreateEmptyCompilation(source, options: TestOptions.DebugDll, references: new[] { MscorlibRef_v20 });
Emit\NumericIntPtrTests.cs (27)
123var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9); 173var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9); 233var comp = CreateEmptyCompilation(sourceA); 266comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 328var comp = CreateEmptyCompilation(sourceA, options: TestOptions.UnsafeReleaseDll); 365comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9, options: TestOptions.UnsafeReleaseDll); 429var comp = CreateEmptyCompilation(sourceA, options: TestOptions.UnsafeReleaseDll); 485comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9, options: TestOptions.UnsafeReleaseDll); 540var comp = CreateEmptyCompilation(sourceA); 560comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 625var comp = CreateEmptyCompilation(sourceA); 670comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 767var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular9); 809var comp = CreateEmptyCompilation(sourceA); 842comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 6897var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9); 10327var comp = CreateEmptyCompilation(new[] { source, corlib_cs }, parseOptions: parseOptions); 10330var corlib = CreateEmptyCompilation(corlib_cs, parseOptions: parseOptions); 10333comp = CreateEmptyCompilation(source, references: new[] { corlib.ToMetadataReference() }, parseOptions: parseOptions); 10336comp = CreateEmptyCompilation(source, references: new[] { corlib.EmitToImageReference() }, parseOptions: parseOptions); 10543var comp = CreateEmptyCompilation(new[] { source, corlib_cs }); 10668var comp = CreateEmptyCompilation(sourceA); 10681comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 10912var libComp = CreateEmptyCompilation(lib_cs, references: new[] { MscorlibRef_v20 }, assemblyName: "lib"); 10952var comp = CreateEmptyCompilation(source, references: new[] { libComp.ToMetadataReference(), MscorlibRef_v46 }); 11152var corlib = CreateEmptyCompilation(corlib_cs); 11153var comp = CreateEmptyCompilation(source, references: new[] { corlib.EmitToImageReference() });
Emit\UnmanagedTypeModifierTests.cs (12)
426CreateEmptyCompilation(code).VerifyDiagnostics( 447CreateEmptyCompilation(code).VerifyDiagnostics( 467CreateEmptyCompilation(code).VerifyDiagnostics( 499CreateEmptyCompilation(code).VerifyDiagnostics( 526CreateEmptyCompilation(code).VerifyDiagnostics( 554CreateEmptyCompilation(code).VerifyDiagnostics( 581CreateEmptyCompilation(code).VerifyDiagnostics( 617CreateEmptyCompilation(code).VerifyDiagnostics( 1143var corlibWithoutUnmanagedTypeRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 1151var ref1 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutUnmanagedTypeRef }).EmitToImageReference(); 1152var ref2 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutUnmanagedTypeRef }).EmitToImageReference(); 1159CreateEmptyCompilation(user, references: new[] { ref1, ref2, corlibWithoutUnmanagedTypeRef })
PDB\PDBAsyncTests.cs (1)
2100var v = CreateEmptyCompilation(src, LatestVbReferences, options: TestOptions.DebugDll);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (102)
Attributes\AttributeTests.cs (1)
8477var comp2 = CreateEmptyCompilation(source3, assemblyName: "Temp2").ToMetadataReference();
Attributes\AttributeTests_Assembly.cs (6)
705compilation = CreateEmptyCompilation( 734compilation = CreateEmptyCompilation( 767compilation = CreateEmptyCompilation( 1176var netmoduleCompilation = CreateEmptyCompilation(netModuleSource, 1194var consoleappCompilation = CreateEmptyCompilation( 1235consoleappCompilation = CreateEmptyCompilation(
Attributes\AttributeTests_CallerInfoAttributes.cs (5)
72var compilation = CreateEmptyCompilation(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10); 138var compilation = CreateEmptyCompilation(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10); 203var compilation = CreateEmptyCompilation(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10); 318var compilation = CreateEmptyCompilation(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10); 375var compilation = CreateEmptyCompilation(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10);
Attributes\AttributeTests_Dynamic.cs (4)
1189var comp = CreateEmptyCompilation(source0, parseOptions: parseOptions); 1192comp = CreateEmptyCompilation(source1, references: new[] { ref0, SystemCoreRef }, parseOptions: parseOptions); 1226var comp = CreateEmptyCompilation(source0, parseOptions: parseOptions); 1229comp = CreateEmptyCompilation(source1, references: new[] { ref0, SystemCoreRef }, parseOptions: parseOptions);
Attributes\AttributeTests_Embedded.cs (4)
320CreateEmptyCompilation(code).VerifyEmitDiagnostics(CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("v4.0.30319"), 360CreateEmptyCompilation(code).VerifyEmitDiagnostics(CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("v4.0.30319"), 421CreateEmptyCompilation(code).VerifyEmitDiagnostics(CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("v4.0.30319"), 480CreateEmptyCompilation(code).VerifyEmitDiagnostics(CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("v4.0.30319"),
Attributes\AttributeTests_IsByRefLike.cs (1)
998var compilation1 = CreateEmptyCompilation(new[] { source1, compilerFeatureRequiredAttribute }, assemblyName: GetUniqueName());
Attributes\AttributeTests_MarshalAs.cs (2)
31var compilation = CreateEmptyCompilation(new SyntaxTree[0], new[] { assembly.GetReference() }, 63var compilation = CreateEmptyCompilation(
Attributes\AttributeTests_Nullable.cs (9)
30var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular8); 597var comp0 = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular7); 605var comp = CreateEmptyCompilation( 645var comp0 = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular7); 653var comp = CreateEmptyCompilation( 698var comp0 = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular7); 706var comp = CreateEmptyCompilation( 4393var comp0 = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 4412var comp = CreateEmptyCompilation(
Attributes\AttributeTests_Security.cs (1)
640var comp = CreateEmptyCompilation(source);
Attributes\AttributeTests_Synthesized.cs (7)
125var comp = CreateEmptyCompilation("", new[] { reference }, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.Internal)); 146var comp = CreateEmptyCompilation("", new[] { reference }, options: TestOptions.UnsafeReleaseDll.WithMetadataImportOptions(MetadataImportOptions.Internal)); 1262var compilation = CreateEmptyCompilation("", parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: options); 1934var mslibComp = CreateEmptyCompilation(new string[] { mslib }, parseOptions: parseOptions).VerifyDiagnostics(); 1938var mslibNoStringComp = CreateEmptyCompilation(new string[] { mslibNoString }, parseOptions: parseOptions).VerifyDiagnostics(); 1955var diagLibComp = CreateEmptyCompilation(new string[] { diagLibSource }, parseOptions: parseOptions, references: new[] { mslibRef }).VerifyDiagnostics(); 1959var comp = CreateEmptyCompilation(new SyntaxTree[] { Parse("", options: parseOptions) }, references: new[] { diagLibRef, mslibNoStringRef });
Attributes\AttributeTests_Tuples.cs (4)
176var comp = CreateEmptyCompilation(source0, parseOptions: parseOptions); 179comp = CreateEmptyCompilation(source1, 214var comp = CreateEmptyCompilation(source0, parseOptions: parseOptions); 217comp = CreateEmptyCompilation(source1,
Attributes\AttributeTests_WellKnownAttributes.cs (11)
9779var compilation1 = CreateEmptyCompilation(source1, WinRtRefs, TestOptions.ReleaseDll); 9872compilation2 = CreateEmptyCompilation(source2, WinRtRefs.Concat(new[] { compilation1.EmitToImageReference() }), TestOptions.ReleaseDll); 9905? CreateEmptyCompilation(new[] { (libSrc, "libSrc"), (src, "src") }, WinRtRefs, TestOptions.ReleaseDll) 9906: CreateEmptyCompilation((src, "src"), 9907references: WinRtRefs.Append(CreateEmptyCompilation(new[] { libSrc }, WinRtRefs, TestOptions.ReleaseDll).EmitToImageReference()).ToArray(), 10171var compilation1 = CreateEmptyCompilation(source1, WinRtRefs, TestOptions.ReleaseDll); 10208var compilation1 = CreateEmptyCompilation(source1, WinRtRefs, TestOptions.ReleaseDll); 10284var cscomp = CreateEmptyCompilation(cssource, new[] { MscorlibRef, ilReference }, TestOptions.ReleaseExe); 10392var cscomp = CreateEmptyCompilation(cssource, new[] { MscorlibRef, ilReference }, TestOptions.ReleaseExe); 13679CreateEmptyCompilation(code, references: WinRtRefs, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)).VerifyDiagnostics( 13731CreateEmptyCompilation(code, references: WinRtRefs, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)).VerifyDiagnostics(
Attributes\InternalsVisibleToAndStrongNameTests.cs (7)
2501var other = CreateEmptyCompilation( 2530var other = CreateEmptyCompilation( 2571var other = CreateEmptyCompilation(source, options: options, references: new[] { MscorlibRef_v4_0_30316_17626 }, parseOptions: parseOptions); 2589var other = CreateEmptyCompilation( 2621var other = CreateEmptyCompilation( 2646var other = CreateEmptyCompilation( 2676var other = CreateEmptyCompilation(
Diagnostics\GetDiagnosticsTests.cs (4)
385var compilation = CreateEmptyCompilation(string.Empty, parseOptions: new CSharpParseOptions().WithPreprocessorSymbols(new[] { "1" })); 409var compilation = CreateEmptyCompilation(string.Empty, parseOptions: new CSharpParseOptions().WithLanguageVersion((LanguageVersion)10000)); 419var compilation = CreateEmptyCompilation(string.Empty, parseOptions: new CSharpParseOptions().WithDocumentationMode(unchecked((DocumentationMode)100))); 433var compilation = CreateEmptyCompilation(new[] { syntaxTree1, syntaxTree2, syntaxTree3 });
FlowAnalysis\RegionAnalysisTests.cs (4)
6311var compilation = CreateEmptyCompilation(source); 6350var compilation = CreateEmptyCompilation(source); 6377var compilation = CreateEmptyCompilation(source); 6415var compilation = CreateEmptyCompilation(source);
Semantics\CollectionExpressionTests.cs (9)
4973var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute()); 5037var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute()); 5085var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute()); 5928var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute()); 6006var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute()); 13703var reference = CreateEmptyCompilation(runtime, assemblyName: "System.Runtime").VerifyDiagnostics().EmitToImageReference(); 19969var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }); 20970var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute()); 21118var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute());
Semantics\PatternMatchingTests.cs (2)
3958var compilation = CreateEmptyCompilation(source, options: TestOptions.DebugExe, 5647var compilation = CreateEmptyCompilation(source);
Semantics\PatternMatchingTests5.cs (4)
2384var comp = CreateEmptyCompilation(new[] { source, INumberBaseBCL, INumberBaseDefinition }); 2414var comp = CreateEmptyCompilation(new[] { source, INumberBaseBCL, INumberBaseDefinition }); 2432var comp = CreateEmptyCompilation(new[] { source, INumberBaseBCL, INumberBaseDefinition }); 2469var comp = CreateEmptyCompilation(new[] { source, INumberBaseBCL, INumberBaseDefinition });
Semantics\RecordTests.cs (17)
16281var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 16290comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 17230var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 17240comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 17326var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 17336comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 17422var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 17431comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 24274var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 24282comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 24339var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 24347comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 24409var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 24418comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 24488var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 24502comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 30163var compA = CreateEmptyCompilation(new[] { sourceA, IsExternalInitTypeDefinition }, references: TargetFrameworkUtil.GetReferences(TargetFramework.NetStandard20));
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (16)
IOperation\IOperationTests_IArgument.cs (8)
2456var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll); 2520var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll); 2608var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll); 2664var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll); 2722var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll); 2807var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll); 3861var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll); 3956var compilation = CreateEmptyCompilation(source, options: Test.Utilities.TestOptions.ReleaseDll);
IOperation\IOperationTests_IConstructorBodyOperation.cs (1)
1118var compilation = CreateEmptyCompilation(source);
IOperation\IOperationTests_IParameterReferenceExpression.cs (1)
985var compilation1 = CreateEmptyCompilation(
IOperation\IOperationTests_IVariableDeclaration.cs (6)
610var compilation = CreateEmptyCompilation(source); 632var compilation = CreateEmptyCompilation(source); 653var compilation = CreateEmptyCompilation(source); 674var compilation = CreateEmptyCompilation(source); 848var compilation = CreateEmptyCompilation(source); 870var compilation = CreateEmptyCompilation(source);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (214)
Semantics\AccessCheckTests.cs (1)
963c = CreateEmptyCompilation(source, TargetFrameworkUtil.GetReferences(TargetFramework.Standard).AddRange(new[] { r1, r2 }));
Semantics\AccessibilityTests.cs (1)
33CSharpCompilation c = CreateEmptyCompilation(new[] { t });
Semantics\BindingAsyncTasklikeMoreTests.cs (2)
1259var compilation0 = CreateEmptyCompilation(source0, references: new[] { MscorlibRef_v20 }); 1275var compilation = CreateEmptyCompilation(source, references: new[] { MscorlibRef_v20, ref0 });
Semantics\ColorColorTests.cs (4)
2082var refLib = CreateEmptyCompilation( 2100var main = CreateEmptyCompilation( 2127var refLib = CreateEmptyCompilation( 2145var main = CreateEmptyCompilation(sourceMain, assemblyName: "Main",
Semantics\DelegateTypeTests.cs (14)
4077var comp = CreateEmptyCompilation(sourceB, new[] { refA }, parseOptions: TestOptions.RegularPreview); 4178var comp = CreateEmptyCompilation(sourceB, new[] { refA }, parseOptions: TestOptions.RegularPreview); 4252var comp = CreateEmptyCompilation(sourceB, new[] { refA }, parseOptions: TestOptions.RegularPreview); 4343var comp = CreateEmptyCompilation(sourceB, new[] { refA }, parseOptions: TestOptions.RegularPreview); 4428var comp = CreateEmptyCompilation(sourceB, new[] { refA }); 4450var comp = CreateEmptyCompilation(sourceB, new[] { refA }); 4497var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }); 4549var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }); 4587var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 4623var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseExe); 4659var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 4692var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 10638var comp = CreateEmptyCompilation(source, new[] { GetCorlibWithInvalidActionAndFuncOfT() }); 18450CreateEmptyCompilation(source).VerifyDiagnostics(
Semantics\ForEachTests.cs (22)
1957var compilation = CreateEmptyCompilation(text); 1977var compilation = CreateEmptyCompilation(text); 1996var compilation = CreateEmptyCompilation(text); 2231var comp = CreateEmptyCompilation(text); 2283var comp = CreateEmptyCompilation(text); 2349var comp = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular7_3, skipUsesIsNullable: true); 2352comp = CreateEmptyCompilation(text, skipUsesIsNullable: true); 2390var comp = CreateEmptyCompilation(text); 2452var comp = CreateEmptyCompilation(text); 2522var comp = CreateEmptyCompilation(text); 2592var comp = CreateEmptyCompilation(text); 2637var comp = CreateEmptyCompilation(text); 2702var comp = CreateEmptyCompilation(text); 2765var comp = CreateEmptyCompilation(text); 2828var comp = CreateEmptyCompilation(text); 2881var comp = CreateEmptyCompilation(source); // Lots of errors, since corlib is missing. 3070var compilation1 = CreateEmptyCompilation(source1, assemblyName: GetUniqueName()); 3084var comp = CreateEmptyCompilation(text, new[] { reference1 }); 3442var comp1 = CreateEmptyCompilation(source1, options: TestOptions.DebugDll, assemblyName: "MissingBaseType1"); 3470var comp2 = CreateEmptyCompilation(source2, new[] { comp1.ToMetadataReference() }, options: TestOptions.DebugDll); 3485var comp3 = CreateEmptyCompilation(source3, options: TestOptions.DebugDll, assemblyName: "MissingBaseType2"); 3498var comp4 = CreateEmptyCompilation(source4, new[] { comp2.ToMetadataReference(), comp3.ToMetadataReference() });
Semantics\GenericConstraintsTests.cs (5)
641CreateEmptyCompilation(@" 1154CreateEmptyCompilation(@" 1639CreateEmptyCompilation(@" 1934CreateEmptyCompilation(@" 1952CreateEmptyCompilation(@"
Semantics\IndexAndRangeTests.cs (4)
614var comp = CreateEmptyCompilation(@" 845var compilation = CreateEmptyCompilation(@" 1149var compilation = CreateEmptyCompilation(@" 1191var compilation = CreateEmptyCompilation(@"
Semantics\InitOnlyMemberTests.cs (21)
4651var corlibWithoutIsExternalInitRef = CreateEmptyCompilation(corlib_cs, assemblyName: "corlibWithoutIsExternalInit") 4654var corlibWithIsExternalInitRef = CreateEmptyCompilation(corlib_cs + IsExternalInitTypeDefinition, assemblyName: "corlibWithIsExternalInit") 4657var libWithIsExternalInitRef = CreateEmptyCompilation(IsExternalInitTypeDefinition, references: new[] { corlibWithoutIsExternalInitRef }, assemblyName: "libWithIsExternalInit") 4660var libWithIsExternalInitRef2 = CreateEmptyCompilation(IsExternalInitTypeDefinition, references: new[] { corlibWithoutIsExternalInitRef }, assemblyName: "libWithIsExternalInit2") 4665var comp = CreateEmptyCompilation(new[] { source, IsExternalInitTypeDefinition }, references: new[] { corlibWithoutIsExternalInitRef }, assemblyName: "source"); 4672var comp = CreateEmptyCompilation(new[] { source }, references: new[] { corlibWithoutIsExternalInitRef, libWithIsExternalInitRef }, assemblyName: "source"); 4679var comp = CreateEmptyCompilation(new[] { source, IsExternalInitTypeDefinition }, references: new[] { corlibWithIsExternalInitRef }, assemblyName: "source"); 4686var comp = CreateEmptyCompilation(new[] { source, IsExternalInitTypeDefinition }, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef }, assemblyName: "source"); 4693var comp = CreateEmptyCompilation(source, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef, libWithIsExternalInitRef2 }); 4700var comp = CreateEmptyCompilation(source, references: new[] { libWithIsExternalInitRef, corlibWithIsExternalInitRef, libWithIsExternalInitRef2 }); 4707var comp = CreateEmptyCompilation(source, references: new[] { libWithIsExternalInitRef, libWithIsExternalInitRef2, corlibWithIsExternalInitRef }); 4714var comp = CreateEmptyCompilation(source, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef, libWithIsExternalInitRef2 }, 4725var comp = CreateEmptyCompilation(source, references: new[] { corlibWithoutIsExternalInitRef, libWithIsExternalInitRef, libWithIsExternalInitRef2 }); 4735var comp = CreateEmptyCompilation(source, references: new[] { corlibWithoutIsExternalInitRef, libWithIsExternalInitRef, libWithIsExternalInitRef2 }, 4746var comp = CreateEmptyCompilation(source, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef }); 4753var comp = CreateEmptyCompilation(source, references: new[] { libWithIsExternalInitRef, corlibWithIsExternalInitRef }); 4760var comp = CreateEmptyCompilation(source, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef }, 4814var corlibWithoutIsExternalInitRef = AsReference(CreateEmptyCompilation(corlib_cs), useCompilationReference); 4815var corlibWithIsExternalInitRef = AsReference(CreateEmptyCompilation(corlib_cs + IsExternalInitTypeDefinition), useCompilationReference); 4820var comp = CreateEmptyCompilation(source, references: new[] { corlibWithIsExternalInitRef }); 4828var comp = CreateEmptyCompilation(source, references: new[] { corlibWithoutIsExternalInitRef });
Semantics\InterpolationTests.cs (3)
1035CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugExe) 1068CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugExe) 1113var comp = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: Test.Utilities.TestOptions.UnsafeReleaseDll).VerifyDiagnostics();
Semantics\NativeIntegerTests.cs (50)
175var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 181comp = CreateEmptyCompilation(sourceA, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 188comp = CreateEmptyCompilation(sourceB, references: new[] { ref1 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 194comp = CreateEmptyCompilation(sourceB, references: new[] { ref2 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 695var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 699comp = CreateEmptyCompilation(sourceA, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 704comp = CreateEmptyCompilation(sourceB, references: new[] { ref1 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 708comp = CreateEmptyCompilation(sourceB, references: new[] { ref2 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute()); 856comp = CreateEmptyCompilation(sourceA, references: new[] { ref1 }, parseOptions: TestOptions.Regular9); 895comp = CreateEmptyCompilation(sourceB, references: new[] { ref2, refA }, parseOptions: TestOptions.Regular9); 965comp = CreateEmptyCompilation(sourceA, references: new[] { ref1 }, parseOptions: TestOptions.Regular9); 1012comp = CreateEmptyCompilation(sourceB, references: new[] { ref2, refA }, parseOptions: TestOptions.Regular9); 1149comp = CreateEmptyCompilation(sourceA, references: new[] { ref1 }, parseOptions: TestOptions.Regular9); 1161comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 1224comp = CreateEmptyCompilation(sourceA, references: new[] { ref1 }, parseOptions: TestOptions.Regular9); 1236comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 1293var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9); 1447var comp = CreateEmptyCompilation( 1473comp = CreateEmptyCompilation( 1506var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: parseOptions); 1510comp = CreateEmptyCompilation(sourceA, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 1515comp = CreateEmptyCompilation(sourceB, references: new[] { ref1 }, parseOptions: parseOptions); 1519comp = CreateEmptyCompilation(sourceB, references: new[] { ref2 }, parseOptions: parseOptions); 1532var comp = CreateEmptyCompilation(sourceB, references: new[] { reference }, parseOptions: parseOptions); 1590var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular9); 1597comp = CreateEmptyCompilation("", references: new[] { ref1 }, parseOptions: TestOptions.Regular9); 1601comp = CreateEmptyCompilation("", references: new[] { ref2 }, parseOptions: TestOptions.Regular9); 1643var comp = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular9); 1650comp = CreateEmptyCompilation("", references: new[] { ref1 }, parseOptions: TestOptions.Regular9); 1654comp = CreateEmptyCompilation("", references: new[] { ref2 }, parseOptions: TestOptions.Regular9); 1725var comp = CreateEmptyCompilation(sourceA); 1757comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 1893var comp = CreateEmptyCompilation(sourceA, options: TestOptions.UnsafeReleaseDll); 1930comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9, options: TestOptions.UnsafeReleaseDll); 2056var comp = CreateEmptyCompilation(sourceA, options: TestOptions.UnsafeReleaseDll); 2112comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9, options: TestOptions.UnsafeReleaseDll); 2206var comp = CreateEmptyCompilation(sourceA); 2226comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 2298var comp = CreateEmptyCompilation(sourceA); 2329comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 2461var compB = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 2545var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular9); 2597var comp = CreateEmptyCompilation(sourceA); 2617comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 2701var comp = CreateEmptyCompilation(sourceA); 2719comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 2871var comp = CreateEmptyCompilation(sourceB, new[] { refA }, parseOptions: TestOptions.Regular9); 4596var comp = CreateEmptyCompilation(sourceA); 4613comp = CreateEmptyCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9); 10376var comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9);
Semantics\NullableReferenceTypesTests.cs (18)
8705var comp0 = CreateEmptyCompilation(source0, parseOptions: TestOptions.Regular7); 8715var comp = CreateEmptyCompilation( 8754var comp = CreateEmptyCompilation(new[] { source, source2 }); 8767var comp2 = CreateEmptyCompilation(new[] { source, source3 }); 8780var comp3 = CreateEmptyCompilation(new[] { source, source4 }); 83060var comp = CreateEmptyCompilation(new[] { source }, options: WithNullableEnable()); 88840var comp = CreateEmptyCompilation(source); 88850var comp2 = CreateEmptyCompilation(new[] { source }, options: WithNullableEnable()); 90054var comp = CreateEmptyCompilation(new[] { source }, options: WithNullableEnable()); 91440var comp = CreateEmptyCompilation(new[] { source, systemSource }, options: WithNullableEnable()); 115694var comp = CreateEmptyCompilation(new[] { source0 }, options: WithNullableEnable()); 116616var compilation1 = CreateEmptyCompilation(source1, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { MinCorlibRef }); 116632var compilation2 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.EmitToImageReference(), MinCorlibRef }); 116645var compilation3 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.ToMetadataReference(), MinCorlibRef }); 116656var compilation4 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.EmitToImageReference() }); 116686var compilation5 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.ToMetadataReference() }); 116724var compilation6 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.EmitToImageReference(), MscorlibRef }); 116754var compilation7 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.ToMetadataReference(), MscorlibRef });
Semantics\OverloadResolutionTestBase.cs (1)
33var compilation = CreateEmptyCompilation(source, references, TestOptions.ReleaseDll);
Semantics\OverloadResolutionTests.cs (1)
1118var compilation = CreateEmptyCompilation(source, references: new[] { MscorlibRef_v20 });
Semantics\PropertyAccessTests.cs (1)
33var comp = CreateEmptyCompilation(
Semantics\RawInterpolationTests.cs (3)
1035CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugExe) 1067CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugExe) 1111var comp = CreateEmptyCompilation(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: Test.Utilities.TestOptions.UnsafeReleaseDll).VerifyDiagnostics();
Semantics\RecordStructTests.cs (7)
2285var corlibRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 2297var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef }); 2321var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef }); 2387var corlibRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference(); 2397var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef }); 4511var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute()); 4788var comp = CreateEmptyCompilation(src, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute());
Semantics\RefFieldTests.cs (12)
2144var comp = CreateEmptyCompilation(new[] { sourceA }, parseOptions: TestOptions.Regular10); 2147comp = CreateEmptyCompilation(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular10); 2164comp = CreateEmptyCompilation(source, references: new[] { refA }, parseOptions: TestOptions.Regular10); 2178comp = CreateEmptyCompilation(source, references: new[] { refAB }, parseOptions: TestOptions.Regular10); 2186comp = CreateEmptyCompilation(source, references: new[] { refA }); 2194comp = CreateEmptyCompilation(source, references: new[] { refAB }); 26599comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 26608comp = CreateEmptyCompilation(source2, references: new[] { ref0, ref1 }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 26660comp = CreateEmptyCompilation(source1, references: new[] { refLowerVersion }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 26675comp = CreateEmptyCompilation(source2, references: new[] { refHigherVersion, ref1 }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 26724comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular10); 26739comp = CreateEmptyCompilation(source2, references: new[] { ref0, ref1 });
Semantics\ScriptSemanticsTests.cs (8)
87var taskCompilation = CreateEmptyCompilation(taskAssembly, references: new[] { MscorlibRef_v20 }); 97var script = CreateEmptyCompilation( 114var script = CreateEmptyCompilation( 139var script = CreateEmptyCompilation( 159var script = CreateEmptyCompilation( 185var script = CreateEmptyCompilation( 204var script = CreateEmptyCompilation( 1371var script = CreateEmptyCompilation(
Semantics\SemanticErrorTests.cs (2)
11133CreateEmptyCompilation(text).VerifyDiagnostics( 22018CreateEmptyCompilation(text).
Semantics\SpanStackSafetyTests.cs (8)
1927var reference = CreateEmptyCompilation( 1944var comp = CreateEmptyCompilation( 1961var reference = CreateEmptyCompilation( 1978var comp = CreateEmptyCompilation( 2005var reference = CreateEmptyCompilation( 2022var comp = CreateEmptyCompilation( 2046var reference = CreateEmptyCompilation( 2063var comp = CreateEmptyCompilation(
Semantics\StackAllocSpanExpressionsTests.cs (1)
781CreateEmptyCompilation(code, references, TestOptions.UnsafeReleaseDll).VerifyDiagnostics(
Semantics\SwitchTests.cs (1)
1152var comp = CreateEmptyCompilation(new[] { syntaxTree }, references: null);
Semantics\TopLevelStatementsTests.cs (1)
7443var comp = CreateEmptyCompilation(text, options: TestOptions.DebugExe, parseOptions: DefaultParseOptions);
Semantics\UnsafeTests.cs (1)
58var comp1 = CreateEmptyCompilation(text1, assemblyName: "assembly1", references: new[] { MscorlibRef_v20 },
Semantics\UserDefinedConversionTests.cs (5)
1603CreateEmptyCompilation(source).VerifyDiagnostics(); 1675var comp = CreateEmptyCompilation(code); 1720var comp = CreateEmptyCompilation(code); 1773var comp = CreateEmptyCompilation(code); 1830var comp = CreateEmptyCompilation(code);
Semantics\UseSiteErrorTests.cs (9)
1223var compilation = CreateEmptyCompilation(text).VerifyDiagnostics( 2266var compilation = CreateEmptyCompilation( 2306var compilation1 = CreateEmptyCompilation(source1, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { MinCorlibRef }); 2322var compilation2 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.EmitToImageReference(), MinCorlibRef }); 2333var compilation3 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.ToMetadataReference(), MinCorlibRef }); 2344var compilation4 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.EmitToImageReference() }); 2374var compilation5 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.ToMetadataReference() }); 2389var compilation6 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.EmitToImageReference(), MscorlibRef }); 2419var compilation7 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.ToMetadataReference(), MscorlibRef });
Semantics\UsingStatementTests.cs (2)
1774CreateEmptyCompilation(source).VerifyDiagnostics( 1800CreateEmptyCompilation(source).VerifyDiagnostics(
Semantics\ValueTupleTests.cs (5)
444var comp = CreateEmptyCompilation(new[] { source, Stubs }); 495var comp = CreateEmptyCompilation(new[] { source, Stubs }); 546var comp = CreateEmptyCompilation(new[] { source, Stubs }); 594var comp = CreateEmptyCompilation(new[] { source, Stubs }); 637var comp = CreateEmptyCompilation(new[] { source, Stubs });
SourceGeneration\GeneratorDriverTests.cs (1)
3227Compilation compilation = CreateEmptyCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions, references: metadataRefs);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (292)
BadSymbolReference.cs (6)
749var compilation1 = CreateEmptyCompilation( 796var libRef = CreateEmptyCompilation(libSource, new[] { MscorlibRef }, assemblyName: "System.Drawing").EmitToImageReference(); 798var comp1 = CreateEmptyCompilation(project1Source, new[] { MscorlibRef, libRef }, assemblyName: "Project1"); 801var comp2 = CreateEmptyCompilation(project2Source, new[] { MscorlibRef, libRef }, assemblyName: "Project2"); 806var comp3 = CreateEmptyCompilation(project3Source, new[] { MscorlibRef, comp1.ToMetadataReference(), comp2.ToMetadataReference() }, assemblyName: "Project3"); 815var comp3 = CreateEmptyCompilation(project3Source, new[] { MscorlibRef, comp1.EmitToImageReference(), comp2.EmitToImageReference() }, assemblyName: "Project3");
Compilation\CompilationAPITests.cs (15)
1902var comp = CreateEmptyCompilation(text, references: new[] { MscorlibRef, alias }); 2206var c1 = CreateEmptyCompilation("public class Main { public static C C; }", new[] { MscorlibRef, reference, reference }); 2255var compilation = CreateEmptyCompilation( 2276compilation = CreateEmptyCompilation( 2291var libComp = CreateEmptyCompilation( 2312var c1 = CreateEmptyCompilation( 2337var c2 = CreateEmptyCompilation( 3603var corlib = CreateEmptyCompilation(corlibSource, parseOptions: parseOptions); 3606var other = CreateEmptyCompilation(@"public class C {}", new[] { corlibReference }, parseOptions: parseOptions); 3609var current = CreateEmptyCompilation(@"public class C {}", new[] { otherReference, corlibReference }); 3638var corlib = CreateEmptyCompilation(corlibSource, parseOptions: parseOptions); 3641var current = CreateEmptyCompilation(@"", new[] { corlibReference }, parseOptions: parseOptions); 3663var corlib = CreateEmptyCompilation(corlibSource, parseOptions: parseOptions); 3666var other = CreateEmptyCompilation(@"public class C {}", new[] { corlibReference }, parseOptions: parseOptions); 3669var current = CreateEmptyCompilation(@"", new[] { otherReference, corlibReference });
Compilation\GetSemanticInfoBrokenCodeTests.cs (3)
315var comp = CreateEmptyCompilation(new[] { tree }); 330var comp = CreateEmptyCompilation(new[] { tree }); 345var comp = CreateEmptyCompilation(new[] { tree });
Compilation\GetUnusedImportDirectivesTests.cs (2)
122var comp = CreateEmptyCompilation(text, new[] { MscorlibRef }); 346var lib = CreateEmptyCompilation("", assemblyName: "lib");
Compilation\ReferenceManagerTests.cs (77)
516var libV1 = CreateEmptyCompilation( 540var libV2 = CreateEmptyCompilation( 556var refLibV1 = CreateEmptyCompilation( 570var main = CreateEmptyCompilation( 745var compilation = CreateEmptyCompilation(tree, new[] { MscorlibRef, r1, r2_SysCore }, TestOptions.DebugExe, assemblyName: "Test"); 832return CreateEmptyCompilation(s, references); 962var c = CreateEmptyCompilation("class C {}", TargetFrameworkUtil.StandardReferences.AddRange(new[] { ref1, ref2 })); 984var c = CreateEmptyCompilation("class C {}", TargetFrameworkUtil.StandardReferences.AddRange(new[] { ref1, ref2 })); 1056CreateEmptyCompilation(source, TargetFrameworkUtil.StandardReferences.AddRange(new[] { ref1, ref2 })).VerifyDiagnostics(); 1132var main = CreateEmptyCompilation(sourceMain, 1197var main = CreateEmptyCompilation(sourceMain, 1225var compilation = CreateEmptyCompilation(source, TargetFrameworkUtil.StandardReferences.AddRange(new[] { arSA, enUS })); 1888var pl = CreateEmptyCompilation(plSource, new[] { MscorlibPP7Ref, SystemRuntimePP7Ref }); 1894var main = CreateEmptyCompilation(mainSource, new MetadataReference[] { r1, MscorlibFacadeRef }, options: TestOptions.ReleaseDll); 1900main = CreateEmptyCompilation(mainSource, new MetadataReference[] { r1, MscorlibFacadeRef, SystemRuntimeFacadeRef }); 2151var corlib1 = CreateEmptyCompilation(""); 2183var c1 = CreateEmptyCompilation("", 2193var c2 = CreateEmptyCompilation("", 2248CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").EmitToImageReference(), 2249CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2266CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""0.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2267CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.1"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2268CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2269CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2270CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.1.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(). 2393var c = CreateEmptyCompilation(source, new[] 2429var c = CreateEmptyCompilation(source, new[] 2465var c = CreateEmptyCompilation(source, new[] 2506var c = CreateEmptyCompilation(source, new[] 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(); 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(); 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(); 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(); 3005var aRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef, b1Ref, b2Ref }, 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(); 3051var aRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef, b1Ref, b2Ref }, 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(); 3117var aRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef, b1Ref, b2Ref }, 3178var aRef = CreateEmptyCompilation(@"public interface A { System.Diagnostics.Process PA { get; } }", new[] { Net20.References.mscorlib, Net20.References.System }, 3181var bRef = CreateEmptyCompilation(@"public interface B { System.Diagnostics.Process PB { get; } }", new[] { MscorlibRef_v4_0_30316_17626, NetFramework.System }, 3218var aRef = CreateEmptyCompilation(@"public interface A { C CA { get; } }", new[] { MscorlibRef, TestReferences.SymbolsTests.Versioning.C2 }, 3221var bRef = CreateEmptyCompilation(@"public interface B { C CB { get; } }", new[] { MscorlibRef, TestReferences.SymbolsTests.Versioning.C1 },
Compilation\SemanticModelAPITests.cs (2)
2367var compilation = CreateEmptyCompilation(@" 2380var compilation = CreateEmptyCompilation(@"
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
3720var compilation = (Compilation)CreateEmptyCompilation(new string[] {
Compilation\UsedAssembliesTests.cs (12)
35var comp1 = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 56var comp1 = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 297Compilation comp = CreateEmptyCompilation(source, 379var comp1 = CreateEmptyCompilation(source, parseOptions: parseOptions); 403Compilation comp2 = CreateEmptyCompilation(source2, references: new[] { reference, SystemCoreRef, SystemDrawingRef }, parseOptions: parseOptions); 420var comp1 = CreateEmptyCompilation(source, parseOptions: parseOptions); 437Compilation comp2 = CreateEmptyCompilation(source2, references: new[] { reference, SystemCoreRef, SystemDrawingRef }, parseOptions: parseOptions); 5459var comp0 = CreateEmptyCompilation(source0, parseOptions: parseOptions); 5473var comp1 = CreateEmptyCompilation(source1, references: new[] { comp0Ref }, parseOptions: parseOptions); 5484var comp2 = CreateEmptyCompilation(source2, references: new[] { comp0Ref }, parseOptions: parseOptions); 5500var comp3 = CreateEmptyCompilation(source3, references: references, parseOptions: parseOptions); 5515var comp4 = CreateEmptyCompilation(source4, references: new[] { comp0Ref, comp1Ref, comp2Ref }, parseOptions: parseOptions);
CrossLanguageTests.cs (1)
35var comp = CreateEmptyCompilation(new[] { tree }, new[] { ref1 });
DocumentationComments\CrefTests.cs (1)
5872var comp = CreateEmptyCompilation(
DocumentationComments\MethodDocumentationCommentTests.cs (3)
237var compilation = CreateEmptyCompilation(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Diagnose)); 242compilation = CreateEmptyCompilation(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse)); 247compilation = CreateEmptyCompilation(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.None));
SymbolDisplay\SymbolDisplayTests.cs (2)
4706var comp = CreateEmptyCompilation(source, WinRtRefs, TestOptions.ReleaseWinMD); 5487var compA = CreateEmptyCompilation(sourceA, new[] { MscorlibRef });
Symbols\AnonymousTypesSymbolTests.cs (4)
1757var comp = CreateEmptyCompilation(new[] { Parse(source), s_equalityComparerSourceTree }, new[] { MinCorlibRef }); 1785var stateLib = CreateEmptyCompilation(stateSource, new[] { MinCorlibRef }); 1799var attributeLib = CreateEmptyCompilation(attributeSource, new[] { MinCorlibRef, stateLib.ToMetadataReference() }); 1811var comp = CreateEmptyCompilation(new[] { Parse(source), s_equalityComparerSourceTree }, new[] { MinCorlibRef, attributeLib.ToMetadataReference() });
Symbols\ArrayTypeSymbolTests.cs (1)
26var c = CreateEmptyCompilation(@"
Symbols\AssemblyAndNamespaceTests.cs (4)
208var comp = CreateEmptyCompilation(new string[] { text3 }, references: new MetadataReference[] { compRef1, compRef2 }.ToList(), assemblyName: "Test3"); 313var compilation = CreateEmptyCompilation(@" 344var compilation = CreateEmptyCompilation(@" 375var comp = CreateEmptyCompilation(source, new[] { aliasedCorlib });
Symbols\CompilationCreationTests.cs (1)
2549var c1 = CreateEmptyCompilation(text, new MetadataReference[]
Symbols\CorLibrary\Choosing.cs (2)
32var corLib = CreateEmptyCompilation(@" 58var corLib = CreateEmptyCompilation(@"
Symbols\CorLibrary\CorTypes.cs (5)
265CreateEmptyCompilation(source1 + source2).VerifyDiagnostics(); 329var corLib_v1_Comp = CreateEmptyCompilation(corLib_v1, assemblyName: "corLib"); 507var corLib_v1_Comp = CreateEmptyCompilation(corLib_v1, assemblyName: "corLib"); 726var corLib_v1_Comp = CreateEmptyCompilation(corLib_v1, assemblyName: "corLib"); 920var corLib_v1_Comp = CreateEmptyCompilation(corLib_v1, assemblyName: "corLib");
Symbols\CovariantReturnTests.cs (5)
218CorelibraryWithoutCovariantReturnSupport1 = CreateEmptyCompilation(new string[] { 222CorelibraryWithoutCovariantReturnSupport2 = CreateEmptyCompilation(new string[] { 226CorelibraryWithCovariantReturnSupport1 = CreateEmptyCompilation(new string[] { 230CorelibraryWithCovariantReturnSupport2 = CreateEmptyCompilation(new string[] { 234CorelibraryWithCovariantReturnSupportButWithoutPreserveBaseOverridesAttribute = CreateEmptyCompilation(new string[] {
Symbols\DefaultInterfaceImplementationTests.cs (2)
67864var compilation1 = CreateEmptyCompilation(source1, options: TestOptions.DebugDll, 67895var compilation1 = CreateEmptyCompilation(source1, options: TestOptions.DebugDll,
Symbols\ExtensionMethodTests.cs (2)
2205var compilation = CreateEmptyCompilation(source, new[] { Net40.References.mscorlib }); 3447var compilation = CreateEmptyCompilation(source, new[] { MscorlibRef_v20 }, TestOptions.ReleaseDll);
Symbols\FunctionPointerTypeSymbolTests.cs (2)
1940var otherCorLib = CreateEmptyCompilation(@" 2066var comp = CreateEmptyCompilation(@"
Symbols\GenericConstraintTests.cs (3)
5738CreateEmptyCompilation(source).VerifyDiagnostics( 5766CreateEmptyCompilation(source).VerifyDiagnostics( 7294var metadataComp = CreateEmptyCompilation(code, new[] { MscorlibRef_v20 }, assemblyName: "assembly1");
Symbols\ImplicitClassTests.cs (1)
22var c = CreateEmptyCompilation(@"
Symbols\IndexerTests.cs (1)
2833var comp1 = CreateEmptyCompilation(src1, new[] { Net40.References.mscorlib });
Symbols\Metadata\MetadataMemberTests.cs (2)
186var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef }); 238var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef });
Symbols\Metadata\MetadataTypeTests.cs (6)
27var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef }); 67var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef }); 117var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef }, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.Internal)); 215var compilation = CreateEmptyCompilation(text, 279var compilation1 = CreateEmptyCompilation(source1, new[] { Net40.References.mscorlib, Net40.References.SystemCore }); 283var compilation2 = CreateEmptyCompilation(source2, new MetadataReference[] { Net40.References.mscorlib, Net40.References.SystemCore, compilation1.EmitToImageReference() },
Symbols\Metadata\PE\LoadingMethods.cs (1)
1348var comp = CreateEmptyCompilation("", new[] { ilRef });
Symbols\Metadata\PE\NoPiaLocalHideAndTypeSubstitutionTests.cs (11)
73var localType1 = CreateEmptyCompilation(assemblyName: "Dummy1", source: new string[] { localTypeSource1 }, 79var localType2 = CreateEmptyCompilation(assemblyName: "Dummy2", source: new string[] { localTypeSource2 }, 86var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy3", source: CSharpTestSource.None, 122var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: new string[] { localTypeSource }, 185var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: new string[] { localTypeSource }, 222var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: new string[] { localTypeSource }, 257var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: new string[] { localTypeSource }, 288var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: new string[] { localTypeSource }, 316var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: CSharpTestSource.None, 338var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: CSharpTestSource.None, 360var localConsumer = CreateEmptyCompilation(assemblyName: "Dummy", source: CSharpTestSource.None,
Symbols\MissingSpecialMember.cs (13)
124var comp = CreateEmptyCompilation(source, new[] { Net40.References.mscorlib }, options: TestOptions.ReleaseDll); 269var comp = CreateEmptyCompilation(source); 351validatePresent(CreateEmptyCompilation(string.Format(sourceTemplate, "public"))); 352validatePresent(CreateEmptyCompilation(string.Format(sourceTemplate, "internal"))); 486var corlibRef = CreateEmptyCompilation(corlibSource, parseOptions: parseOptions).EmitToImageReference(expectedWarnings: new[] 492var publicLibRef = CreateEmptyCompilation(string.Format(libSourceTemplate, "public"), new[] { corlibRef }, parseOptions: parseOptions).EmitToImageReference(); 493var internalLibRef = CreateEmptyCompilation(string.Format(libSourceTemplate, "internal"), new[] { corlibRef }, parseOptions: parseOptions).EmitToImageReference(); 495var comp = CreateEmptyCompilation("", new[] { corlibRef, publicLibRef, internalLibRef }, assemblyName: "Test"); 509var comp1 = CreateEmptyCompilation(source, parseOptions: parseOptions); 518var comp2 = CreateEmptyCompilation("", new[] { reference }, parseOptions: parseOptions); 526var comp = CreateEmptyCompilation("", new[] { MscorlibRef_v4_0_30316_17626 }); 597var comp = CreateEmptyCompilation("", refs); 938var comp = CreateEmptyCompilation("", refs);
Symbols\OverriddenOrHiddenMembersTests.cs (1)
2865var compilation = CreateEmptyCompilation(text, new MetadataReference[] { MscorlibRef_v20 });
Symbols\Retargeting\NoPia.cs (2)
283var LocalTypes1 = CreateEmptyCompilation(s_sourceLocalTypes1_IL, new[] { MscorlibRef }, options: TestOptions.ReleaseDll, assemblyName: "LocalTypes1"); 286var LocalTypes2 = CreateEmptyCompilation(s_sourceLocalTypes2_IL, new[] { MscorlibRef }, options: TestOptions.ReleaseDll, assemblyName: "LocalTypes2");
Symbols\Retargeting\RetargetCustomAttributes.cs (2)
298var c1 = CreateEmptyCompilation(source1, new[] { OldMsCorLib }); 299var c2 = CreateEmptyCompilation(source2, new MetadataReference[] { NewMsCorLib, new CSharpCompilationReference(c1) });
Symbols\Retargeting\RetargetExplicitInterfaceImplementation.cs (2)
450var ref1 = CreateEmptyCompilation("").ToMetadataReference(); 459var compilation2 = CreateCompilation(source2, references: new[] { compilation1.ToMetadataReference(), ref1, CreateEmptyCompilation("").ToMetadataReference() });
Symbols\Retargeting\RetargetingTests.cs (11)
333var comp = CreateEmptyCompilation(source); 370var comp = CreateEmptyCompilation(source); 430var comp = CreateEmptyCompilation(source); 509var comp = CreateEmptyCompilation(source); 570var comp = CreateEmptyCompilation(source); 631var comp = CreateEmptyCompilation(source); 730var comp1 = CreateEmptyCompilation(source, new[] { MscorlibRef_v20 }, TestOptions.ReleaseDll); 1051var unmanagedCallersOnlyAssembly = CreateEmptyCompilation(@" 1065var finalComp = CreateEmptyCompilation(@"C.M(1);", options: TestOptions.ReleaseExe, references: new[] { afterRetargeting.ToMetadataReference(), unmanagedCallersOnlyAssembly.ToMetadataReference() }); 1129var unmanagedCallersOnlyAssembly = CreateEmptyCompilation(@" 1142var finalComp = CreateEmptyCompilation(@"C.M(1);", options: TestOptions.ReleaseExe, references: new[] { afterRetargeting.ToMetadataReference(), unmanagedCallersOnlyAssembly.ToMetadataReference() });
Symbols\Source\BaseClassTests.cs (26)
34var comp = CreateEmptyCompilation(text); 54var comp = CreateEmptyCompilation(text); 101var comp = CreateEmptyCompilation(text); 130var comp = CreateEmptyCompilation(text); 232var comp = CreateEmptyCompilation(text); 261var comp = (Compilation)CreateEmptyCompilation(text); 298var comp = (Compilation)CreateEmptyCompilation(text); 461var comp = CreateEmptyCompilation(text); 479var comp = CreateEmptyCompilation(text); 497var comp = CreateEmptyCompilation(text); 517var comp = CreateEmptyCompilation(text); 531var comp = CreateEmptyCompilation(text); 546var comp = CreateEmptyCompilation(text); 564var comp = CreateEmptyCompilation(text); 584var comp = CreateEmptyCompilation(text); 603var comp = CreateEmptyCompilation(text); 623var comp = CreateEmptyCompilation(text); 648var comp = CreateEmptyCompilation(text); 667var comp = CreateEmptyCompilation(text); 684var comp = CreateEmptyCompilation(text); 1252var comp = CreateEmptyCompilation(text); 1277var comp = CreateEmptyCompilation(text); 1299var comp = CreateEmptyCompilation(text); 1318var comp = CreateEmptyCompilation(text); 1334var comp = CreateEmptyCompilation(text); 1378var comp = CreateEmptyCompilation(new[] { text1, text2 });
Symbols\Source\ClsComplianceTests.cs (1)
3314var comp = CreateEmptyCompilation(source, WinRtRefs, options: TestOptions.ReleaseWinMD);
Symbols\Source\CompletionTests.cs (1)
32var comp = CreateEmptyCompilation(text, skipUsesIsNullable: true);
Symbols\Source\CustomModifierCopyTests.cs (22)
958var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1002var comp1 = CreateEmptyCompilation(source1, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1034var comp2 = CreateEmptyCompilation(source2, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1058var comp3 = CreateEmptyCompilation(source3, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1079var comp4 = CreateEmptyCompilation(source4, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1132var comp1 = CreateEmptyCompilation(source1, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1156var comp2 = CreateEmptyCompilation(source2, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1170var comp3 = CreateEmptyCompilation(source3, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1279var comp1 = CreateEmptyCompilation(source1, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1320var comp2 = CreateEmptyCompilation(source2, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1348var comp3 = CreateEmptyCompilation(source3, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef }); 1395var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1435var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1480var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1524var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1579var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1633var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1683var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1768var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1885var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 1982var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef }); 2084var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef, ilRef });
Symbols\Source\DelegateTests.cs (2)
29var comp = CreateEmptyCompilation(text); 54var comp = CreateEmptyCompilation(
Symbols\Source\EnumTests.cs (1)
933var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef });
Symbols\Source\EventTests.cs (3)
370var comp = CreateEmptyCompilation(source, new[] { MscorlibRef, SystemCoreRef }); 382var libComp = CreateEmptyCompilation(source, new[] { MscorlibRef }).VerifyDiagnostics( 399var libComp = CreateEmptyCompilation(source, references: new[] { MscorlibRef }).VerifyDiagnostics(
Symbols\Source\FieldTests.cs (3)
60var comp = CreateEmptyCompilation(text); 117var comp = CreateEmptyCompilation(text); 141var comp = CreateEmptyCompilation(text);
Symbols\Source\LocationTests.cs (1)
26var comp = CreateEmptyCompilation(text, new[] { MscorlibRef });
Symbols\Source\MethodTests.cs (1)
1408var comp = CreateEmptyCompilation(text);
Symbols\Source\SourcePlusMetadataTests.cs (2)
187var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef }); 203var compilation = CreateEmptyCompilation(text, new[] { MscorlibRef });
Symbols\Source\TypeMapTests.cs (1)
53var comp = CreateEmptyCompilation(text);
Symbols\StaticAbstractMembersInInterfacesTests.cs (1)
31774references: new[] { CreateEmptyCompilation("").ToMetadataReference() });
Symbols\SymbolDistinguisherTests.cs (2)
314var dummyComp = CreateEmptyCompilation("", assemblyName: "Error"); 316var validType = CreateEmptyCompilation("", new[] { MscorlibRef }).GetSpecialType(SpecialType.System_Int32);
Symbols\SymbolErrorTests.cs (8)
8690CreateEmptyCompilation(text).VerifyDiagnostics( 9662CreateEmptyCompilation(text).VerifyDiagnostics( 9685CreateEmptyCompilation(text).VerifyDiagnostics( 9706CreateEmptyCompilation(text).VerifyDiagnostics( 14954var compilation = CreateEmptyCompilation(source, new[] { Net40.References.mscorlib }); 19084var netModule = CreateEmptyCompilation("", options: TestOptions.ReleaseModule, assemblyName: "lib").EmitToImageReference(expectedWarnings: new[] { Diagnostic(ErrorCode.WRN_NoRuntimeMetadataVersion) }); 20902var forwarderCompilation = CreateEmptyCompilation( 20967var forwarderCompilation = CreateEmptyCompilation(
Symbols\TypeTests.cs (8)
537var compilation = CreateEmptyCompilation(text, new[] { Net40.References.mscorlib }); 804var sysConsoleRef = CreateEmptyCompilation( 815var main1 = CreateEmptyCompilation( 828var main2 = CreateEmptyCompilation( 926var comp = CreateEmptyCompilation(text); 944var comp = CreateEmptyCompilation(code); 980var comp = CreateEmptyCompilation(code); 993var comp = CreateEmptyCompilation(code);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (5)
CSharpTestBase.cs (5)
1137return CreateEmptyCompilation(source, allReferences, options, parseOptions); 1274return CreateEmptyCompilation(source, TargetFrameworkUtil.GetReferences(targetFramework, references), options, parseOptions, assemblyName, sourceFileName, skipUsesIsNullable); 2276var reference = CreateEmptyCompilation( 2283var comp = CreateEmptyCompilation( 2295var comp = CreateEmptyCompilation(
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (22)
CodeGen\WinMdEventTests.cs (4)
623var comp1 = CreateEmptyCompilation(source1, WinRtRefs, TestOptions.ReleaseWinMD, TestOptions.Regular, "Lib"); 627var comp2 = CreateEmptyCompilation(source2, WinRtRefs.Concat(new MetadataReference[] { new CSharpCompilationReference(comp1), serializationRef, SystemXmlRef }), TestOptions.ReleaseExe); 648var comp = CreateEmptyCompilation(source, WinRtRefs, TestOptions.ReleaseWinMD, TestOptions.Regular7); 668var comp = CreateEmptyCompilation(source, WinRtRefs, TestOptions.ReleaseWinMD);
CodeGen\WinRTCollectionTests.cs (3)
48var comp = CreateEmptyCompilation(source, references: WinRtRefs); 354var comp = CreateEmptyCompilation(source, references: WinRtRefs); 7418var comp = CreateEmptyCompilation(source, references: WinRtRefs);
Metadata\WinMdDumpTest.cs (1)
444var comp = CreateEmptyCompilation("", references, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.All));
Metadata\WinMdEventTests.cs (14)
238_eventLibRef = CreateEmptyCompilation( 307var dynamicCommon = CreateEmptyCompilation( 2839var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { ilRef })); 2914var comp = CreateEmptyCompilation(source, WinRtRefs, TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug)); 2958var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { ilRef }), TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug)); 3027var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { interfaceILRef, baseILRef }), TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug)); 3093var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { ilRef }), TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug)); 3165var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { ilRef })); 3192var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { ilRef })); 3218var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { interfaceILRef, baseILRef })); 3249var comp = CreateEmptyCompilation(source, WinRtRefs.Concat(new[] { interfaceILRef, baseILRef })); 3288var comp = CreateEmptyCompilation(source, WinRtRefs, TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug)); 3379CreateEmptyCompilation(source, WinRtRefs, TestOptions.ReleaseWinMD).VerifyDiagnostics( 3556var comp = CreateEmptyCompilation("", WinRtRefs.Concat(new[] { ilRef }), TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All));