1016 references to CreateEmptyCompilation
InteractiveHost.UnitTests (1)
AbstractInteractiveHostTests.cs (1)
200
var compilation =
CreateEmptyCompilation
(
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (3)
CommandLineTests.cs (3)
9768
var comp =
CreateEmptyCompilation
(string.Empty, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
9771
comp =
CreateEmptyCompilation
(string.Empty, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
14274
var comp =
CreateEmptyCompilation
(source: generatorSource,
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (3)
234
var comp20 = (Compilation)
CreateEmptyCompilation
(src1, [Net40.References.mscorlib]);
334
var comp20 =
CreateEmptyCompilation
(src1, [Net40.References.mscorlib]);
418
var comp20 =
CreateEmptyCompilation
(src1, [Net40.References.mscorlib]);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (209)
CodeGen\CodeGenAsyncMainTests.cs (16)
362
var corCompilation =
CreateEmptyCompilation
(corAssembly, options: TestOptions.DebugDll);
381
var sourceCompilation =
CreateEmptyCompilation
(source, new[] { corCompilation.ToMetadataReference(), taskCompilation.ToMetadataReference() }, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1));
402
var corCompilation =
CreateEmptyCompilation
(corAssembly, options: TestOptions.DebugDll);
421
var sourceCompilation =
CreateEmptyCompilation
(source, new[] { corCompilation.ToMetadataReference(), taskCompilation.ToMetadataReference() }, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1));
2217
var corlibRef =
CreateEmptyCompilation
(MinimalAsyncCorelibWithAsyncHelpers, assemblyName: "mincorlib").VerifyDiagnostics().EmitToImageReference();
2218
var comp =
CreateEmptyCompilation
(source, references: [corlibRef], options: TestOptions.DebugExe);
2252
var corlibRef =
CreateEmptyCompilation
(MinimalAsyncCorelibWithAsyncHelpers, assemblyName: "mincorlib").VerifyDiagnostics().EmitToImageReference();
2253
var comp =
CreateEmptyCompilation
(source, references: [corlibRef], options: TestOptions.DebugExe);
2286
var corlibRef =
CreateEmptyCompilation
(MinimalAsyncCorelibWithAsyncHelpers, assemblyName: "mincorlib").EmitToImageReference();
2287
var comp =
CreateEmptyCompilation
(source, references: [corlibRef], options: TestOptions.DebugExe);
2327
var corlibRef =
CreateEmptyCompilation
(MinimalAsyncCorelibWithAsyncHelpers, assemblyName: "mincorlib").VerifyDiagnostics().EmitToImageReference();
2328
var comp =
CreateEmptyCompilation
(source, references: [corlibRef], options: TestOptions.DebugExe);
2398
var corlibRef =
CreateEmptyCompilation
(MinimalAsyncCorelibWithAsyncHelpers, assemblyName: "mincorlib").VerifyDiagnostics().EmitToImageReference();
2399
var comp =
CreateEmptyCompilation
(source, references: [corlibRef], options: TestOptions.DebugExe);
2468
var corlibRef =
CreateEmptyCompilation
(MinimalAsyncCorelibWithAsyncHelpers, assemblyName: "mincorlib").VerifyDiagnostics().EmitToImageReference();
2469
var comp =
CreateEmptyCompilation
(source, references: [corlibRef], options: TestOptions.DebugExe);
CodeGen\CodeGenAsyncTests.cs (8)
4936
var comp = CSharpTestBase.
CreateEmptyCompilation
(source, new[] { Net40.References.mscorlib }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers.
4963
var comp = CSharpTestBase.
CreateEmptyCompilation
(source, new[] { Net40.References.mscorlib }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers.
4991
var comp = CSharpTestBase.
CreateEmptyCompilation
(source, new[] { Net40.References.mscorlib }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers.
6607
var compilation =
CreateEmptyCompilation
(new[] { Parse(source) });
9418
var corlibComp =
CreateEmptyCompilation
([corlib, runtimeAsyncAwaitHelpers]);
9419
return
CreateEmptyCompilation
(source, references: [corlibComp.EmitToImageReference()], parseOptions: WithRuntimeAsync(TestOptions.RegularPreview));
10457
var comp =
CreateEmptyCompilation
(code, parseOptions: WithRuntimeAsync(TestOptions.RegularPreview));
10461
comp =
CreateEmptyCompilation
(code, parseOptions: TestOptions.RegularPreview);
CodeGen\CodeGenDeconstructTests.cs (2)
7834
var comp1 =
CreateEmptyCompilation
(source1, WinRtRefs, TestOptions.ReleaseWinMD, TestOptions.Regular);
7881
var comp1 =
CreateEmptyCompilation
(source1, WinRtRefs, TestOptions.ReleaseWinMD, TestOptions.Regular);
CodeGen\CodeGenExprLambdaTests.cs (4)
3240
var comp =
CreateEmptyCompilation
(
5031
var compilation =
CreateEmptyCompilation
(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
5093
var compilation =
CreateEmptyCompilation
(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
5166
var compilation =
CreateEmptyCompilation
(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
CodeGen\CodeGenFunctionPointersTests.cs (8)
7561
var allInCoreLib =
CreateEmptyCompilation
(source1 + source2, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll);
7578
var coreLib =
CreateEmptyCompilation
(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
7581
var comp1 =
CreateEmptyCompilation
(source2, references: new[] { coreLib.EmitToImageReference() }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll);
7630
var allInCoreLib =
CreateEmptyCompilation
(source1 + source2, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll);
7647
var coreLib =
CreateEmptyCompilation
(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
7650
var comp1 =
CreateEmptyCompilation
(source2, references: new[] { coreLib.EmitToImageReference() }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll);
7872
var comp =
CreateEmptyCompilation
(new[] { @"
7912
var comp =
CreateEmptyCompilation
(new[] { @"
CodeGen\CodeGenIterators.cs (3)
2394
var compilation =
CreateEmptyCompilation
(new[] { Parse(source, options: parseOptions), Parse(corlib, options: parseOptions) });
2439
var compilation =
CreateEmptyCompilation
(new[] { Parse(source, options: TestOptions.Regular.WithNoRefSafetyRulesAttribute()) });
2503
var compilation =
CreateEmptyCompilation
(new[] { Parse(source, options: TestOptions.Regular.WithNoRefSafetyRulesAttribute()) });
CodeGen\CodeGenLockTests.cs (1)
1745
return
CreateEmptyCompilation
(new string[] { text }, new[] { Net20.References.mscorlib });
CodeGen\CodeGenMscorlib.cs (21)
153
var c =
CreateEmptyCompilation
(text, options: TestOptions.UnsafeReleaseDll);
204
CreateEmptyCompilation
(
223
var compilation =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
247
var compilation1 =
CreateEmptyCompilation
(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName());
257
var compilation2 =
CreateEmptyCompilation
(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 });
281
var compilation1 =
CreateEmptyCompilation
(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName());
298
var compilation2 =
CreateEmptyCompilation
(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 });
318
var compilation1 =
CreateEmptyCompilation
(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName());
335
var compilation2 =
CreateEmptyCompilation
(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 });
356
var compilation1 =
CreateEmptyCompilation
(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName());
374
var compilation2 =
CreateEmptyCompilation
(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 });
415
var compilation1 =
CreateEmptyCompilation
(source1, assemblyName: GetUniqueName());
433
var compilation2 =
CreateEmptyCompilation
(source2, new[] { reference1 });
477
var compilation1 =
CreateEmptyCompilation
(source1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), assemblyName: GetUniqueName());
490
var compilation2 =
CreateEmptyCompilation
(source2, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: new[] { reference1 });
547
CreateEmptyCompilation
(
612
var comp =
CreateEmptyCompilation
(
750
var comp =
CreateEmptyCompilation
(
880
var comp =
CreateEmptyCompilation
(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll).VerifyDiagnostics();
1037
var comp =
CreateEmptyCompilation
(text, options: TestOptions.UnsafeReleaseDll);
1163
var comp =
CreateEmptyCompilation
(text, options: TestOptions.UnsafeReleaseDll);
CodeGen\CodeGenTests.cs (5)
476
var compilation =
CreateEmptyCompilation
(tree, [Net461.References.mscorlib], TestOptions.ReleaseExe, assemblyName: "Test");
10516
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute()).VerifyEmitDiagnostics(
14564
var compilation =
CreateEmptyCompilation
(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
14598
var compilation =
CreateEmptyCompilation
(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
14634
var compilation =
CreateEmptyCompilation
(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
CodeGen\CodeGenTupleEqualityTests.cs (1)
2628
var comp =
CreateEmptyCompilation
(source);
CodeGen\CodeGenTupleTest.cs (38)
4105
var comp =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7),
25316
var corlibWithoutVT =
CreateEmptyCompilation
(new[] { Parse(String.Format(versionTemplate, "1") + corlib_cs, options: parseOptions) }, assemblyName: "corlib");
25320
var corlibWithVT =
CreateEmptyCompilation
(new[] { Parse(String.Format(versionTemplate, "2") + corlib_cs + valuetuple_cs, options: parseOptions) }, assemblyName: "corlib");
25324
var libWithVT =
CreateEmptyCompilation
(valuetuple_cs, references: new[] { corlibWithoutVTRef }, parseOptions: parseOptions, options: TestOptions.DebugDll);
25344
var libWithVTRef2 =
CreateEmptyCompilation
(valuetuple_cs, references: new[] { corlibWithoutVTRef }, parseOptions: parseOptions).EmitToImageReference();
25345
var comp4 =
CreateEmptyCompilation
("", references: new[] { libWithVTRef, libWithVTRef2, corlibWithoutVTRef }, parseOptions: parseOptions);
25688
var comp =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1),
25733
var comp =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1),
25759
var comp =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1),
25804
var comp =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1),
25830
var comp =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1),
25869
var comp =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1),
25902
var comp =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1),
26669
var vtLib =
CreateEmptyCompilation
(trivial2uple + tupleattributes_cs, references: new[] { MscorlibRef }, assemblyName: "vt");
26681
var lib =
CreateEmptyCompilation
(lib_cs, references: new[] { MscorlibRef, vtLib.EmitToImageReference() });
26692
var comp =
CreateEmptyCompilation
(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to vt
26696
var compWithMetadataReference =
CreateEmptyCompilation
(client_cs, references: new[] { MscorlibRef, lib.ToMetadataReference() }); // missing reference to vt
26700
var fakeVtLib =
CreateEmptyCompilation
("", references: new[] { MscorlibRef }, assemblyName: "vt");
26701
var compWithFakeVt =
CreateEmptyCompilation
(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeVtLib.EmitToImageReference() }); // reference to fake vt
26716
var comp2 =
CreateEmptyCompilation
(client2_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to vt
26727
var comp2WithFakeVt =
CreateEmptyCompilation
(client2_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeVtLib.EmitToImageReference() }); // reference to fake vt
26771
var vtLib =
CreateEmptyCompilation
(tuplelib_cs + tupleattributes_cs, references: new[] { MscorlibRef }, assemblyName: "vt");
26783
var lib =
CreateEmptyCompilation
(lib_cs, references: new[] { MscorlibRef, vtLib.EmitToImageReference() });
26797
var fakeVtLib =
CreateEmptyCompilation
("", references: new[] { MscorlibRef }, assemblyName: "vt");
26798
var comp =
CreateEmptyCompilation
(client2_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to vt
26809
var compWithFakeVt =
CreateEmptyCompilation
(client2_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeVtLib.EmitToImageReference() }); // reference to fake vt
26835
var containerLib =
CreateEmptyCompilation
("public class Container<T> { }", references: new[] { MscorlibRef }, assemblyName: "container");
26847
var lib =
CreateEmptyCompilation
(lib_cs + tuplelib_cs + tupleattributes_cs, references: new[] { MscorlibRef, containerLib.EmitToImageReference() });
26858
var comp =
CreateEmptyCompilation
(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to container
26862
var compWithMetadataReference =
CreateEmptyCompilation
(client_cs, references: new[] { MscorlibRef, lib.ToMetadataReference() }); // missing reference to container
26866
var fakeContainerLib =
CreateEmptyCompilation
("", references: new[] { MscorlibRef }, assemblyName: "container");
26867
var compWithFakeContainer =
CreateEmptyCompilation
(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeContainerLib.EmitToImageReference() }); // reference to fake container
26910
var containerLib =
CreateEmptyCompilation
("public class Container<T> { public class Contained<U> { } }", references: new[] { MscorlibRef }, assemblyName: "container");
26922
var lib =
CreateEmptyCompilation
(lib_cs + tuplelib_cs + tupleattributes_cs, references: new[] { MscorlibRef, containerLib.EmitToImageReference() });
26933
var comp =
CreateEmptyCompilation
(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference() }); // missing reference to container
26937
var compWithMetadataReference =
CreateEmptyCompilation
(client_cs, references: new[] { MscorlibRef, lib.ToMetadataReference() }); // missing reference to container
26941
var fakeContainerLib =
CreateEmptyCompilation
("", references: new[] { MscorlibRef }, assemblyName: "container");
26942
var compWithFakeContainer =
CreateEmptyCompilation
(client_cs, references: new[] { MscorlibRef, lib.EmitToImageReference(), fakeContainerLib.EmitToImageReference() }); // reference to fake container
CodeGen\EventTests.cs (2)
646
var compilation1 =
CreateEmptyCompilation
(source1, assemblyName: GetUniqueName(), parseOptions: parseOptions);
664
var compilation2 =
CreateEmptyCompilation
(source2, new[] { reference1 }, parseOptions: parseOptions);
CodeGen\ForeachTest.cs (1)
630
var comp =
CreateEmptyCompilation
(@"
CodeGen\PatternTests.cs (5)
100
var compilation =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.ReleaseDll);
123
var compilation =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll);
153
var compilation =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll);
201
var compilation =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseDll);
3316
var compilation =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.ReleaseDll);
CodeGen\SwitchTests.cs (1)
4512
var comp =
CreateEmptyCompilation
(
CodeGen\WinMdDelegateTests.cs (2)
142
var winRtDelegateLibrary =
CreateEmptyCompilation
(
150
var nonWinRtDelegateLibrary =
CreateEmptyCompilation
(
Emit\CompilationEmitTests.cs (67)
897
var compWithMetadata =
CreateEmptyCompilation
("", references: new[] { MscorlibRef, metadataRef },
1310
CSharpCompilation moduleComp =
CreateEmptyCompilation
("",
2124
CSharpCompilation comp =
CreateEmptyCompilation
(source, references: new[] { MscorlibRef },
2133
var compWithReal =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage },
2164
var compWithReal2 =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage2 },
2192
var compWithMetadata =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, metadataImage },
2221
var compWithRef =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage },
2263
CSharpCompilation comp =
CreateEmptyCompilation
(source, parseOptions: parseOptions, references: new[] { MscorlibRef },
2270
var compWithReal =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage },
2280
var compWithMetadata =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, metadataImage },
2292
var compWithRef =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage },
2330
CSharpCompilation comp =
CreateEmptyCompilation
(source, parseOptions: parseOptions, references: new[] { MscorlibRef },
2337
var compWithReal =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage },
2347
var compWithMetadata =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, metadataImage },
2359
var compWithRef =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage },
2397
CSharpCompilation comp =
CreateEmptyCompilation
(source, parseOptions: parseOptions, references: new[] { MscorlibRef },
2404
var compWithReal =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, realImage },
2414
var compWithMetadata =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, metadataImage },
2426
var compWithRef =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage },
2457
CSharpCompilation comp =
CreateEmptyCompilation
(source, parseOptions: parseOptions, references: new[] { MscorlibRef },
2465
var compWithRef =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage },
2502
CSharpCompilation comp =
CreateEmptyCompilation
(source, parseOptions: parseOptions, references: new[] { MscorlibRef },
2510
var compWithRef =
CreateEmptyCompilation
("", parseOptions: parseOptions, references: new[] { MscorlibRef, refImage },
2524
CSharpCompilation comp =
CreateEmptyCompilation
("", references: new[] { MscorlibRef },
2538
CSharpCompilation comp =
CreateEmptyCompilation
("", references: new[] { MscorlibRef },
2552
CSharpCompilation comp =
CreateEmptyCompilation
("", references: new[] { MscorlibRef },
2567
CSharpCompilation comp =
CreateEmptyCompilation
("", references: new[] { MscorlibRef },
2580
CSharpCompilation comp =
CreateEmptyCompilation
("", references: new[] { MscorlibRef },
2594
CSharpCompilation comp =
CreateEmptyCompilation
("", references: new[] { MscorlibRef },
2607
CSharpCompilation comp =
CreateEmptyCompilation
("", references: new[] { MscorlibRef },
2633
CSharpCompilation comp =
CreateEmptyCompilation
("", references: new[] { MscorlibRef },
2653
CSharpCompilation comp =
CreateEmptyCompilation
(source, references: new[] { MscorlibRef },
4679
var refCompilation =
CreateEmptyCompilation
(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(Platform.Itanium), assemblyName: "PlatformMismatch");
4691
var useCompilation =
CreateEmptyCompilation
(useSource,
4697
useCompilation =
CreateEmptyCompilation
(useSource,
4703
useCompilation =
CreateEmptyCompilation
(useSource,
4709
useCompilation =
CreateEmptyCompilation
(useSource,
4715
useCompilation =
CreateEmptyCompilation
(useSource,
4723
useCompilation =
CreateEmptyCompilation
(useSource,
4731
useCompilation =
CreateEmptyCompilation
(useSource,
4739
useCompilation =
CreateEmptyCompilation
(useSource,
4764
var refCompilation =
CreateEmptyCompilation
(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(Platform.Itanium), assemblyName: "PlatformMismatch");
4775
var useCompilation =
CreateEmptyCompilation
(useSource,
4783
useCompilation =
CreateEmptyCompilation
(useSource,
4791
useCompilation =
CreateEmptyCompilation
(useSource,
4809
var refCompilation =
CreateEmptyCompilation
(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(Platform.X86), assemblyName: "PlatformMismatch");
4822
var useCompilation =
CreateEmptyCompilation
(useSource,
4830
useCompilation =
CreateEmptyCompilation
(useSource,
4838
useCompilation =
CreateEmptyCompilation
(useSource,
4846
useCompilation =
CreateEmptyCompilation
(useSource,
4865
var refCompilation =
CreateEmptyCompilation
(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(Platform.X86), assemblyName: "PlatformMismatch");
4877
var useCompilation =
CreateEmptyCompilation
(useSource,
4896
var refCompilation =
CreateEmptyCompilation
(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(Platform.AnyCpu), assemblyName: "PlatformMismatch");
4909
var useCompilation =
CreateEmptyCompilation
(useSource,
4915
useCompilation =
CreateEmptyCompilation
(useSource,
4921
useCompilation =
CreateEmptyCompilation
(useSource,
4927
useCompilation =
CreateEmptyCompilation
(useSource,
4944
var refCompilation =
CreateEmptyCompilation
(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(Platform.AnyCpu), assemblyName: "PlatformMismatch");
4956
var useCompilation =
CreateEmptyCompilation
(useSource,
4973
var refCompilation =
CreateEmptyCompilation
(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(Platform.Itanium), assemblyName: "PlatformMismatch");
4986
var useCompilation =
CreateEmptyCompilation
(useSource,
4992
useCompilation =
CreateEmptyCompilation
(useSource,
4998
useCompilation =
CreateEmptyCompilation
(useSource,
5004
useCompilation =
CreateEmptyCompilation
(useSource,
5021
var refCompilation =
CreateEmptyCompilation
(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(Platform.Itanium), assemblyName: "PlatformMismatch");
5034
var useCompilation =
CreateEmptyCompilation
(useSource,
5044
var comp =
CreateEmptyCompilation
("", new[] { TestReferences.SymbolsTests.netModule.x64COFF }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugDll);
Emit\CovariantReturnTests.cs (2)
226
var compilation =
CreateEmptyCompilation
(new string[] {
244
return
CreateEmptyCompilation
(
Emit\DeterministicTests.cs (4)
36
var compilation =
CreateEmptyCompilation
(source,
55
var compilation =
CreateEmptyCompilation
(source, assemblyName: "DeterminismTest", references: new[] { MscorlibRef, SystemCoreRef, CSharpRef }, options: options);
74
var compilationDeterministic =
CreateEmptyCompilation
(
78
var compilationNonDeterministic =
CreateEmptyCompilation
(
Emit\DynamicAnalysis\DynamicInstrumentationTests.cs (1)
2450
ImmutableArray<Diagnostic> diagnostics =
CreateEmptyCompilation
(source + InstrumentationHelperSource).GetEmitDiagnostics(EmitOptions.Default.WithInstrumentationKinds(ImmutableArray.Create(InstrumentationKind.TestCoverage)));
Emit\EmitMetadataTests.cs (6)
3206
var ref1 =
CreateEmptyCompilation
(source1, assemblyName: "MinimalCoreLib").VerifyDiagnostics().EmitToImageReference();
3218
var ref2 =
CreateEmptyCompilation
(source2, [ref1], options: TestOptions.UnsafeDebugDll, assemblyName: "Encoding")
3227
var comp =
CreateEmptyCompilation
(source3, [ref1, ref2], assemblyName: "Lib1");
3231
comp =
CreateEmptyCompilation
(source3, [ref1, ref2], assemblyName: "Lib2",
3596
CompileAndVerify(
CreateEmptyCompilation
(source, parseOptions: parseOptions),
3622
CreateEmptyCompilation
(source,
Emit\InAttributeModifierTests.cs (11)
1507
CreateEmptyCompilation
(code).VerifyDiagnostics(
1528
CreateEmptyCompilation
(code).VerifyDiagnostics(
1549
CreateEmptyCompilation
(code).VerifyDiagnostics(
1569
CreateEmptyCompilation
(code).VerifyDiagnostics(
1593
CreateEmptyCompilation
(code).VerifyDiagnostics(
1618
CreateEmptyCompilation
(code).VerifyDiagnostics(
1639
CreateEmptyCompilation
(code).VerifyDiagnostics(
5346
var corlibWithoutInAttributeRef =
CreateEmptyCompilation
(corlib_cs, assemblyName: "corlibWithoutInAttributeRef").EmitToImageReference();
5354
var ref1 =
CreateEmptyCompilation
(refCode, references: new[] { corlibWithoutInAttributeRef }, assemblyName: "ref1").EmitToImageReference();
5355
var ref2 =
CreateEmptyCompilation
(refCode, references: new[] { corlibWithoutInAttributeRef }, assemblyName: "ref2").EmitToImageReference();
5363
CreateEmptyCompilation
(user, references: new[] { ref1, ref2, corlibWithoutInAttributeRef })
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (75)
CodeGen\CodeGenSpanBasedStringConcatTests.cs (18)
664
var corlib =
CreateEmptyCompilation
(corlib_cs).EmitToImageReference();
673
var comp =
CreateEmptyCompilation
(source, [corlib]);
739
var corlib =
CreateEmptyCompilation
(corlib_cs).EmitToImageReference();
748
var comp =
CreateEmptyCompilation
(source, [corlib]);
813
var corlib =
CreateEmptyCompilation
(corlib_cs).EmitToImageReference();
822
var comp =
CreateEmptyCompilation
(source, [corlib]);
2255
var corlib =
CreateEmptyCompilation
(corlib_cs).EmitToImageReference();
2264
var comp =
CreateEmptyCompilation
(source, [corlib]);
2333
var corlib =
CreateEmptyCompilation
(corlib_cs).EmitToImageReference();
2342
var comp =
CreateEmptyCompilation
(source, [corlib]);
2410
var corlib =
CreateEmptyCompilation
(corlib_cs).EmitToImageReference();
2419
var comp =
CreateEmptyCompilation
(source, [corlib]);
5024
var corlib =
CreateEmptyCompilation
(corlib_cs).EmitToImageReference();
5033
var comp =
CreateEmptyCompilation
(source, [corlib]);
5105
var corlib =
CreateEmptyCompilation
(corlib_cs).EmitToImageReference();
5114
var comp =
CreateEmptyCompilation
(source, [corlib]);
5185
var corlib =
CreateEmptyCompilation
(corlib_cs).EmitToImageReference();
5194
var comp =
CreateEmptyCompilation
(source, [corlib]);
Emit\EditAndContinue\AssemblyReferencesTests.cs (7)
66
var compilation0 =
CreateEmptyCompilation
(src1, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), references: references);
141
var md1 = AssemblyMetadata.CreateFromStream(
CreateEmptyCompilation
(srcPE, parseOptions: parseOptions, references: new[] { MscorlibRef, SystemRef }).EmitToStream());
143
var compilation0 =
CreateEmptyCompilation
(src1, parseOptions: parseOptions, references: new[] { MscorlibRef });
219
var compilation0 =
CreateEmptyCompilation
(src0, new[] { MscorlibRef, lib0.ToMetadataReference() }, assemblyName: "C", options: TestOptions.DebugDll);
323
var compilation0 =
CreateEmptyCompilation
(src0, new[] { MscorlibRef, lib0.ToMetadataReference() }, assemblyName: "C", options: TestOptions.DebugDll);
406
var compilation0 =
CreateEmptyCompilation
(src0, new[] { MscorlibRef, lib0.EmitToImageReference() }, assemblyName: "C", options: TestOptions.DebugDll);
490
var compilation0 =
CreateEmptyCompilation
(src0, new[] { MscorlibRef, ref01, ref11 }, assemblyName: "C", options: TestOptions.DebugDll);
Emit\EditAndContinue\EditAndContinueStateMachineTests.cs (8)
10871
var compilation0 =
CreateEmptyCompilation
(new[] { source0.Tree }, new[] { TestReferences.NetFx.Minimal.mincorlib, TestReferences.NetFx.Minimal.minasync }, options: ComSafeDebugDll);
10934
var compilation0 =
CreateEmptyCompilation
(new[] { source0.Tree }, new[] { TestReferences.NetFx.Minimal.mincorlib, TestReferences.NetFx.Minimal.minasync }, options: ComSafeDebugDll);
11001
var compilation0 =
CreateEmptyCompilation
(new[] { source0.Tree }, new[] { TestReferences.NetFx.Minimal.mincorlib, TestReferences.NetFx.Minimal.minasync }, options: ComSafeDebugDll);
11054
var compilation0 =
CreateEmptyCompilation
(new[] { source0.Tree }, new[] { NetFramework.mscorlib }, options: ComSafeDebugDll);
11105
var compilation0 =
CreateEmptyCompilation
(new[] { source0.Tree }, new[] { TestReferences.NetFx.Minimal.mincorlib, TestReferences.NetFx.Minimal.minasync }, options: ComSafeDebugDll);
11159
var compilation0 =
CreateEmptyCompilation
(new[] { source0.Tree }, new[] { Net20.References.mscorlib }, options: ComSafeDebugDll);
11220
var compilation0 =
CreateEmptyCompilation
(new[] { source0.Tree }, new[] { Net20.References.mscorlib }, options: ComSafeDebugDll);
11275
var compilation0 =
CreateEmptyCompilation
(new[] { source0.Tree }, new[] { NetFramework.mscorlib }, options: ComSafeDebugDll.WithMetadataImportOptions(MetadataImportOptions.All));
Emit\EditAndContinue\LocalSlotMappingTests.cs (2)
1147
var compilation0 =
CreateEmptyCompilation
(source, options: TestOptions.DebugDll, references: new[] { MscorlibRef_v20 });
1148
var compilation1 =
CreateEmptyCompilation
(source, options: TestOptions.DebugDll, references: new[] { MscorlibRef_v20 });
Emit\NumericIntPtrTests.cs (27)
129
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9);
179
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9);
239
var comp =
CreateEmptyCompilation
(sourceA);
272
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9);
334
var comp =
CreateEmptyCompilation
(sourceA, options: TestOptions.UnsafeReleaseDll);
371
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9, options: TestOptions.UnsafeReleaseDll);
435
var comp =
CreateEmptyCompilation
(sourceA, options: TestOptions.UnsafeReleaseDll);
491
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9, options: TestOptions.UnsafeReleaseDll);
546
var comp =
CreateEmptyCompilation
(sourceA);
566
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9);
631
var comp =
CreateEmptyCompilation
(sourceA);
676
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9);
773
var comp =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular9);
815
var comp =
CreateEmptyCompilation
(sourceA);
848
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9);
6903
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9);
10333
var comp =
CreateEmptyCompilation
(new[] { source, corlib_cs }, parseOptions: parseOptions);
10336
var corlib =
CreateEmptyCompilation
(corlib_cs, parseOptions: parseOptions);
10339
comp =
CreateEmptyCompilation
(source, references: new[] { corlib.ToMetadataReference() }, parseOptions: parseOptions);
10342
comp =
CreateEmptyCompilation
(source, references: new[] { corlib.EmitToImageReference() }, parseOptions: parseOptions);
10549
var comp =
CreateEmptyCompilation
(new[] { source, corlib_cs });
10674
var comp =
CreateEmptyCompilation
(sourceA);
10687
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9);
10918
var libComp =
CreateEmptyCompilation
(lib_cs, references: new[] { MscorlibRef_v20 }, assemblyName: "lib");
10958
var comp =
CreateEmptyCompilation
(source, references: new[] { libComp.ToMetadataReference(), MscorlibRef_v46 });
11158
var corlib =
CreateEmptyCompilation
(corlib_cs);
11159
var comp =
CreateEmptyCompilation
(source, references: new[] { corlib.EmitToImageReference() });
Emit\UnmanagedTypeModifierTests.cs (12)
426
CreateEmptyCompilation
(code).VerifyDiagnostics(
447
CreateEmptyCompilation
(code).VerifyDiagnostics(
467
CreateEmptyCompilation
(code).VerifyDiagnostics(
499
CreateEmptyCompilation
(code).VerifyDiagnostics(
526
CreateEmptyCompilation
(code).VerifyDiagnostics(
554
CreateEmptyCompilation
(code).VerifyDiagnostics(
581
CreateEmptyCompilation
(code).VerifyDiagnostics(
617
CreateEmptyCompilation
(code).VerifyDiagnostics(
1143
var corlibWithoutUnmanagedTypeRef =
CreateEmptyCompilation
(corlib_cs, assemblyName: "corlibWithoutUnmanagedTypeRef").EmitToImageReference();
1151
var ref1 =
CreateEmptyCompilation
(refCode, references: new[] { corlibWithoutUnmanagedTypeRef }, assemblyName: "ref1").EmitToImageReference();
1152
var ref2 =
CreateEmptyCompilation
(refCode, references: new[] { corlibWithoutUnmanagedTypeRef }, assemblyName: "ref2").EmitToImageReference();
1159
CreateEmptyCompilation
(user, references: new[] { ref1, ref2, corlibWithoutUnmanagedTypeRef })
PDB\PDBAsyncTests.cs (1)
2100
var v =
CreateEmptyCompilation
(src, LatestVbReferences, options: TestOptions.DebugDll);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (139)
Attributes\AttributeTests.cs (1)
8479
var comp2 =
CreateEmptyCompilation
(source3, assemblyName: "Temp2").ToMetadataReference();
Attributes\AttributeTests_Assembly.cs (6)
705
compilation =
CreateEmptyCompilation
(
734
compilation =
CreateEmptyCompilation
(
767
compilation =
CreateEmptyCompilation
(
1176
var netmoduleCompilation =
CreateEmptyCompilation
(netModuleSource,
1194
var consoleappCompilation =
CreateEmptyCompilation
(
1235
consoleappCompilation =
CreateEmptyCompilation
(
Attributes\AttributeTests_CallerInfoAttributes.cs (5)
72
var compilation =
CreateEmptyCompilation
(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10);
138
var compilation =
CreateEmptyCompilation
(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10);
203
var compilation =
CreateEmptyCompilation
(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10);
318
var compilation =
CreateEmptyCompilation
(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10);
375
var compilation =
CreateEmptyCompilation
(source, GetReferencesWithoutInteropServices(), options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular10);
Attributes\AttributeTests_Dynamic.cs (4)
1189
var comp =
CreateEmptyCompilation
(source0, parseOptions: parseOptions);
1192
comp =
CreateEmptyCompilation
(source1, references: new[] { ref0, SystemCoreRef }, parseOptions: parseOptions);
1226
var comp =
CreateEmptyCompilation
(source0, parseOptions: parseOptions);
1229
comp =
CreateEmptyCompilation
(source1, references: new[] { ref0, SystemCoreRef }, parseOptions: parseOptions);
Attributes\AttributeTests_Embedded.cs (4)
757
CreateEmptyCompilation
(code).VerifyEmitDiagnostics(CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("v4.0.30319"),
797
CreateEmptyCompilation
(code).VerifyEmitDiagnostics(CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("v4.0.30319"),
858
CreateEmptyCompilation
(code).VerifyEmitDiagnostics(CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("v4.0.30319"),
917
CreateEmptyCompilation
(code).VerifyEmitDiagnostics(CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("v4.0.30319"),
Attributes\AttributeTests_IsByRefLike.cs (1)
998
var compilation1 =
CreateEmptyCompilation
(new[] { source1, compilerFeatureRequiredAttribute }, assemblyName: GetUniqueName());
Attributes\AttributeTests_MarshalAs.cs (2)
31
var compilation =
CreateEmptyCompilation
(new SyntaxTree[0], new[] { assembly.GetReference() },
63
var compilation =
CreateEmptyCompilation
(
Attributes\AttributeTests_Nullable.cs (9)
30
var comp =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular8);
597
var comp0 =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular7);
605
var comp =
CreateEmptyCompilation
(
645
var comp0 =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular7);
653
var comp =
CreateEmptyCompilation
(
698
var comp0 =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular7);
706
var comp =
CreateEmptyCompilation
(
4393
var comp0 =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
4412
var comp =
CreateEmptyCompilation
(
Attributes\AttributeTests_Security.cs (1)
640
var comp =
CreateEmptyCompilation
(source);
Attributes\AttributeTests_StructLayout.cs (12)
136
CreateEmptyCompilation
(
861
CreateEmptyCompilation
(
887
CompileAndVerify(
CreateEmptyCompilation
(
964
CreateEmptyCompilation
(
1007
CreateEmptyCompilation
(
1042
var comp =
CreateEmptyCompilation
(
1088
CreateEmptyCompilation
(
1121
CreateEmptyCompilation
(
1149
CreateEmptyCompilation
(
1175
CreateEmptyCompilation
(
1200
CreateEmptyCompilation
(
1298
CreateEmptyCompilation
(cSharpSource,
Attributes\AttributeTests_Synthesized.cs (7)
125
var comp =
CreateEmptyCompilation
("", new[] { reference }, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.Internal));
146
var comp =
CreateEmptyCompilation
("", new[] { reference }, options: TestOptions.UnsafeReleaseDll.WithMetadataImportOptions(MetadataImportOptions.Internal));
1262
var compilation =
CreateEmptyCompilation
("", parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: options);
2174
var mslibComp =
CreateEmptyCompilation
(new string[] { mslib }, parseOptions: parseOptions).VerifyDiagnostics();
2178
var mslibNoStringComp =
CreateEmptyCompilation
(new string[] { mslibNoString }, parseOptions: parseOptions).VerifyDiagnostics();
2195
var diagLibComp =
CreateEmptyCompilation
(new string[] { diagLibSource }, parseOptions: parseOptions, references: new[] { mslibRef }).VerifyDiagnostics();
2199
var comp =
CreateEmptyCompilation
(new SyntaxTree[] { Parse("", options: parseOptions) }, references: new[] { diagLibRef, mslibNoStringRef });
Attributes\AttributeTests_Tuples.cs (4)
176
var comp =
CreateEmptyCompilation
(source0, parseOptions: parseOptions);
179
comp =
CreateEmptyCompilation
(source1,
214
var comp =
CreateEmptyCompilation
(source0, parseOptions: parseOptions);
217
comp =
CreateEmptyCompilation
(source1,
Attributes\AttributeTests_WellKnownAttributes.cs (13)
9819
var compilation1 =
CreateEmptyCompilation
(source1, WinRtRefs, TestOptions.ReleaseDll);
9884
var compilation2 =
CreateEmptyCompilation
(source2, WinRtRefs.Concat(new[] { new CSharpCompilationReference(compilation1) }), TestOptions.ReleaseDll);
9912
compilation2 =
CreateEmptyCompilation
(source2, WinRtRefs.Concat(new[] { compilation1.EmitToImageReference() }), TestOptions.ReleaseDll);
9945
?
CreateEmptyCompilation
(new[] { (libSrc, "libSrc"), (src, "src") }, WinRtRefs, TestOptions.ReleaseDll)
9946
:
CreateEmptyCompilation
((src, "src"),
9947
references: WinRtRefs.Append(
CreateEmptyCompilation
(new[] { libSrc }, WinRtRefs, TestOptions.ReleaseDll).EmitToImageReference()).ToArray(),
10211
var compilation1 =
CreateEmptyCompilation
(source1, WinRtRefs, TestOptions.ReleaseDll);
10248
var compilation1 =
CreateEmptyCompilation
(source1, WinRtRefs, TestOptions.ReleaseDll);
10264
var compilation2 =
CreateEmptyCompilation
(source2, WinRtRefs.Concat(new[] { new CSharpCompilationReference(compilation1) }), TestOptions.ReleaseDll);
10324
var cscomp =
CreateEmptyCompilation
(cssource, new[] { MscorlibRef, ilReference }, TestOptions.ReleaseExe);
10432
var cscomp =
CreateEmptyCompilation
(cssource, new[] { MscorlibRef, ilReference }, TestOptions.ReleaseExe);
13758
CreateEmptyCompilation
(code, references: WinRtRefs, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)).VerifyDiagnostics(
13810
CreateEmptyCompilation
(code, references: WinRtRefs, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)).VerifyDiagnostics(
Attributes\InternalsVisibleToAndStrongNameTests.cs (7)
2501
var other =
CreateEmptyCompilation
(
2530
var other =
CreateEmptyCompilation
(
2571
var other =
CreateEmptyCompilation
(source, options: options, references: new[] { MscorlibRef_v4_0_30316_17626 }, parseOptions: parseOptions);
2589
var other =
CreateEmptyCompilation
(
2621
var other =
CreateEmptyCompilation
(
2646
var other =
CreateEmptyCompilation
(
2676
var other =
CreateEmptyCompilation
(
Diagnostics\GetDiagnosticsTests.cs (4)
510
var compilation =
CreateEmptyCompilation
(string.Empty, parseOptions: new CSharpParseOptions().WithPreprocessorSymbols(new[] { "1" }));
534
var compilation =
CreateEmptyCompilation
(string.Empty, parseOptions: new CSharpParseOptions().WithLanguageVersion((LanguageVersion)10000));
544
var compilation =
CreateEmptyCompilation
(string.Empty, parseOptions: new CSharpParseOptions().WithDocumentationMode(unchecked((DocumentationMode)100)));
558
var compilation =
CreateEmptyCompilation
(new[] { syntaxTree1, syntaxTree2, syntaxTree3 });
FlowAnalysis\RegionAnalysisTests.cs (4)
6311
var compilation =
CreateEmptyCompilation
(source);
6350
var compilation =
CreateEmptyCompilation
(source);
6377
var compilation =
CreateEmptyCompilation
(source);
6415
var compilation =
CreateEmptyCompilation
(source);
RefStructInterfacesTests.cs (18)
12126
var span =
CreateEmptyCompilation
([core, span1]).EmitToImageReference();
12128
var comp =
CreateEmptyCompilation
(src, references: [span], options: TestOptions.ReleaseDll);
12131
comp =
CreateEmptyCompilation
(src, references: [span], options: TestOptions.ReleaseDll, parseOptions: TestOptions.Regular11);
12158
span =
CreateEmptyCompilation
([core, span2]).EmitToImageReference();
12160
comp =
CreateEmptyCompilation
(src, references: [span], options: TestOptions.ReleaseDll);
12163
comp =
CreateEmptyCompilation
(src, references: [span], options: TestOptions.ReleaseDll, parseOptions: TestOptions.Regular11);
12181
span =
CreateEmptyCompilation
([core, span3]).EmitToImageReference();
12183
comp =
CreateEmptyCompilation
(src, references: [span], options: TestOptions.ReleaseDll);
12186
comp =
CreateEmptyCompilation
(src, references: [span], options: TestOptions.ReleaseDll, parseOptions: TestOptions.Regular11);
12325
var span =
CreateEmptyCompilation
([core, span1]).EmitToImageReference();
12327
var comp =
CreateEmptyCompilation
(src, references: [span], options: TestOptions.ReleaseDll);
12330
comp =
CreateEmptyCompilation
(src, references: [span], options: TestOptions.ReleaseDll, parseOptions: TestOptions.Regular11);
12357
span =
CreateEmptyCompilation
([core, span2]).EmitToImageReference();
12359
comp =
CreateEmptyCompilation
(src, references: [span], options: TestOptions.ReleaseDll);
12362
comp =
CreateEmptyCompilation
(src, references: [span], options: TestOptions.ReleaseDll, parseOptions: TestOptions.Regular11);
12380
span =
CreateEmptyCompilation
([core, span3]).EmitToImageReference();
12382
comp =
CreateEmptyCompilation
(src, references: [span], options: TestOptions.ReleaseDll);
12385
comp =
CreateEmptyCompilation
(src, references: [span], options: TestOptions.ReleaseDll, parseOptions: TestOptions.Regular11);
Semantics\CollectionExpressionTests.cs (10)
4973
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute());
5037
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute());
6095
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute());
7768
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute());
7846
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute());
15535
var reference =
CreateEmptyCompilation
(runtime, assemblyName: "System.Runtime").VerifyDiagnostics().EmitToImageReference();
15536
var comp =
CreateEmptyCompilation
(source, references: [reference]);
21818
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB });
22963
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute());
23111
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute());
Semantics\CollectionExpressionTests_WithElement_Extra.cs (1)
688
var comp =
CreateEmptyCompilation
(
Semantics\ExtensionTests2.cs (1)
32506
var comp =
CreateEmptyCompilation
(src);
Semantics\ParamsCollectionTests.cs (2)
16789
var comp =
CreateEmptyCompilation
([source1, core], options: TestOptions.ReleaseDll.WithAllowUnsafe(true));
16954
comp =
CreateEmptyCompilation
([source2, core], options: TestOptions.ReleaseDll.WithAllowUnsafe(true));
Semantics\PatternMatchingTests.cs (2)
3958
var compilation =
CreateEmptyCompilation
(source, options: TestOptions.DebugExe,
5647
var compilation =
CreateEmptyCompilation
(source);
Semantics\PatternMatchingTests5.cs (4)
2388
var comp =
CreateEmptyCompilation
(new[] { source, INumberBaseBCL, INumberBaseDefinition });
2418
var comp =
CreateEmptyCompilation
(new[] { source, INumberBaseBCL, INumberBaseDefinition });
2436
var comp =
CreateEmptyCompilation
(new[] { source, INumberBaseBCL, INumberBaseDefinition });
2473
var comp =
CreateEmptyCompilation
(new[] { source, INumberBaseBCL, INumberBaseDefinition });
Semantics\RecordTests.cs (17)
16368
var comp =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
16377
comp =
CreateEmptyCompilation
(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute());
17317
var comp =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
17327
comp =
CreateEmptyCompilation
(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute());
17413
var comp =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
17423
comp =
CreateEmptyCompilation
(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute());
17509
var comp =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
17518
comp =
CreateEmptyCompilation
(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute());
24361
var comp =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
24369
comp =
CreateEmptyCompilation
(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute());
24426
var comp =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
24434
comp =
CreateEmptyCompilation
(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute());
24496
var comp =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
24505
comp =
CreateEmptyCompilation
(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute());
24575
var comp =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
24589
comp =
CreateEmptyCompilation
(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute());
30360
var compA =
CreateEmptyCompilation
(new[] { sourceA, IsExternalInitTypeDefinition }, references: TargetFrameworkUtil.GetReferences(TargetFramework.NetStandard20));
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (16)
IOperation\IOperationTests_IArgument.cs (8)
2456
var compilation =
CreateEmptyCompilation
(source, options: Test.Utilities.TestOptions.ReleaseDll);
2520
var compilation =
CreateEmptyCompilation
(source, options: Test.Utilities.TestOptions.ReleaseDll);
2608
var compilation =
CreateEmptyCompilation
(source, options: Test.Utilities.TestOptions.ReleaseDll);
2664
var compilation =
CreateEmptyCompilation
(source, options: Test.Utilities.TestOptions.ReleaseDll);
2722
var compilation =
CreateEmptyCompilation
(source, options: Test.Utilities.TestOptions.ReleaseDll);
2807
var compilation =
CreateEmptyCompilation
(source, options: Test.Utilities.TestOptions.ReleaseDll);
3861
var compilation =
CreateEmptyCompilation
(source, options: Test.Utilities.TestOptions.ReleaseDll);
3956
var compilation =
CreateEmptyCompilation
(source, options: Test.Utilities.TestOptions.ReleaseDll);
IOperation\IOperationTests_IConstructorBodyOperation.cs (1)
1118
var compilation =
CreateEmptyCompilation
(source);
IOperation\IOperationTests_IParameterReferenceExpression.cs (1)
985
var compilation1 =
CreateEmptyCompilation
(
IOperation\IOperationTests_IVariableDeclaration.cs (6)
610
var compilation =
CreateEmptyCompilation
(source);
632
var compilation =
CreateEmptyCompilation
(source);
653
var compilation =
CreateEmptyCompilation
(source);
674
var compilation =
CreateEmptyCompilation
(source);
848
var compilation =
CreateEmptyCompilation
(source);
870
var compilation =
CreateEmptyCompilation
(source);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (225)
Semantics\AccessCheckTests.cs (1)
965
c =
CreateEmptyCompilation
(source, TargetFrameworkUtil.GetReferences(TargetFramework.Standard).AddRange(new[] { r1, r2 }));
Semantics\AccessibilityTests.cs (1)
33
CSharpCompilation c =
CreateEmptyCompilation
(new[] { t });
Semantics\BindingAsyncTasklikeMoreTests.cs (2)
1266
var compilation0 =
CreateEmptyCompilation
(source0, references: new[] { MscorlibRef_v20 });
1282
var compilation =
CreateEmptyCompilation
(source, references: new[] { MscorlibRef_v20, ref0 });
Semantics\BindingTests.cs (5)
4288
var comp =
CreateEmptyCompilation
(source);
4319
var comp =
CreateEmptyCompilation
(source);
4341
var comp =
CreateEmptyCompilation
(source);
4360
var comp =
CreateEmptyCompilation
(source);
4384
var comp =
CreateEmptyCompilation
(source);
Semantics\ColorColorTests.cs (4)
2082
var refLib =
CreateEmptyCompilation
(
2100
var main =
CreateEmptyCompilation
(
2127
var refLib =
CreateEmptyCompilation
(
2145
var main =
CreateEmptyCompilation
(sourceMain, assemblyName: "Main",
Semantics\DelegateTypeTests.cs (14)
4149
var comp =
CreateEmptyCompilation
(sourceB, new[] { refA }, parseOptions: TestOptions.RegularPreview);
4250
var comp =
CreateEmptyCompilation
(sourceB, new[] { refA }, parseOptions: TestOptions.RegularPreview);
4324
var comp =
CreateEmptyCompilation
(sourceB, new[] { refA }, parseOptions: TestOptions.RegularPreview);
4415
var comp =
CreateEmptyCompilation
(sourceB, new[] { refA }, parseOptions: TestOptions.RegularPreview);
4500
var comp =
CreateEmptyCompilation
(sourceB, new[] { refA });
4522
var comp =
CreateEmptyCompilation
(sourceB, new[] { refA });
4569
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB });
4621
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB });
4659
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
4695
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.UnsafeReleaseExe);
4731
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
4764
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
10710
var comp =
CreateEmptyCompilation
(source, new[] { GetCorlibWithInvalidActionAndFuncOfT() });
18554
CreateEmptyCompilation
(source).VerifyDiagnostics(
Semantics\ForEachTests.cs (23)
2473
var compilation =
CreateEmptyCompilation
(text);
2493
var compilation =
CreateEmptyCompilation
(text);
2512
var compilation =
CreateEmptyCompilation
(text);
2639
var comp =
CreateEmptyCompilation
(source, [SystemRuntimePP7Ref]);
2747
var comp =
CreateEmptyCompilation
(text);
2799
var comp =
CreateEmptyCompilation
(text);
2865
var comp =
CreateEmptyCompilation
(text, parseOptions: TestOptions.Regular7_3, skipUsesIsNullable: true);
2868
comp =
CreateEmptyCompilation
(text, skipUsesIsNullable: true);
2906
var comp =
CreateEmptyCompilation
(text);
2968
var comp =
CreateEmptyCompilation
(text);
3038
var comp =
CreateEmptyCompilation
(text);
3108
var comp =
CreateEmptyCompilation
(text);
3153
var comp =
CreateEmptyCompilation
(text);
3218
var comp =
CreateEmptyCompilation
(text);
3281
var comp =
CreateEmptyCompilation
(text);
3344
var comp =
CreateEmptyCompilation
(text);
3397
var comp =
CreateEmptyCompilation
(source); // Lots of errors, since corlib is missing.
3586
var compilation1 =
CreateEmptyCompilation
(source1, assemblyName: GetUniqueName());
3600
var comp =
CreateEmptyCompilation
(text, new[] { reference1 });
3958
var comp1 =
CreateEmptyCompilation
(source1, options: TestOptions.DebugDll, assemblyName: "MissingBaseType1");
3986
var comp2 =
CreateEmptyCompilation
(source2, new[] { comp1.ToMetadataReference() }, options: TestOptions.DebugDll);
4001
var comp3 =
CreateEmptyCompilation
(source3, options: TestOptions.DebugDll, assemblyName: "MissingBaseType2");
4014
var comp4 =
CreateEmptyCompilation
(source4, new[] { comp2.ToMetadataReference(), comp3.ToMetadataReference() });
Semantics\GenericConstraintsTests.cs (5)
641
CreateEmptyCompilation
(@"
1154
CreateEmptyCompilation
(@"
1639
CreateEmptyCompilation
(@"
1934
CreateEmptyCompilation
(@"
1952
CreateEmptyCompilation
(@"
Semantics\IndexAndRangeTests.cs (4)
614
var comp =
CreateEmptyCompilation
(@"
845
var compilation =
CreateEmptyCompilation
(@"
1149
var compilation =
CreateEmptyCompilation
(@"
1191
var compilation =
CreateEmptyCompilation
(@"
Semantics\InitOnlyMemberTests.cs (21)
4651
var corlibWithoutIsExternalInitRef =
CreateEmptyCompilation
(corlib_cs, assemblyName: "corlibWithoutIsExternalInit")
4654
var corlibWithIsExternalInitRef =
CreateEmptyCompilation
(corlib_cs + IsExternalInitTypeDefinition, assemblyName: "corlibWithIsExternalInit")
4657
var libWithIsExternalInitRef =
CreateEmptyCompilation
(IsExternalInitTypeDefinition, references: new[] { corlibWithoutIsExternalInitRef }, assemblyName: "libWithIsExternalInit")
4660
var libWithIsExternalInitRef2 =
CreateEmptyCompilation
(IsExternalInitTypeDefinition, references: new[] { corlibWithoutIsExternalInitRef }, assemblyName: "libWithIsExternalInit2")
4665
var comp =
CreateEmptyCompilation
(new[] { source, IsExternalInitTypeDefinition }, references: new[] { corlibWithoutIsExternalInitRef }, assemblyName: "source");
4672
var comp =
CreateEmptyCompilation
(new[] { source }, references: new[] { corlibWithoutIsExternalInitRef, libWithIsExternalInitRef }, assemblyName: "source");
4679
var comp =
CreateEmptyCompilation
(new[] { source, IsExternalInitTypeDefinition }, references: new[] { corlibWithIsExternalInitRef }, assemblyName: "source");
4686
var comp =
CreateEmptyCompilation
(new[] { source, IsExternalInitTypeDefinition }, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef }, assemblyName: "source");
4693
var comp =
CreateEmptyCompilation
(source, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef, libWithIsExternalInitRef2 });
4700
var comp =
CreateEmptyCompilation
(source, references: new[] { libWithIsExternalInitRef, corlibWithIsExternalInitRef, libWithIsExternalInitRef2 });
4707
var comp =
CreateEmptyCompilation
(source, references: new[] { libWithIsExternalInitRef, libWithIsExternalInitRef2, corlibWithIsExternalInitRef });
4714
var comp =
CreateEmptyCompilation
(source, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef, libWithIsExternalInitRef2 },
4725
var comp =
CreateEmptyCompilation
(source, references: new[] { corlibWithoutIsExternalInitRef, libWithIsExternalInitRef, libWithIsExternalInitRef2 });
4735
var comp =
CreateEmptyCompilation
(source, references: new[] { corlibWithoutIsExternalInitRef, libWithIsExternalInitRef, libWithIsExternalInitRef2 },
4746
var comp =
CreateEmptyCompilation
(source, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef });
4753
var comp =
CreateEmptyCompilation
(source, references: new[] { libWithIsExternalInitRef, corlibWithIsExternalInitRef });
4760
var comp =
CreateEmptyCompilation
(source, references: new[] { corlibWithIsExternalInitRef, libWithIsExternalInitRef },
4814
var corlibWithoutIsExternalInitRef = AsReference(
CreateEmptyCompilation
(corlib_cs), useCompilationReference);
4815
var corlibWithIsExternalInitRef = AsReference(
CreateEmptyCompilation
(corlib_cs + IsExternalInitTypeDefinition), useCompilationReference);
4820
var comp =
CreateEmptyCompilation
(source, references: new[] { corlibWithIsExternalInitRef });
4828
var comp =
CreateEmptyCompilation
(source, references: new[] { corlibWithoutIsExternalInitRef });
Semantics\InterceptorsTests.cs (2)
4434
var verifier = CompileAndVerify(
CreateEmptyCompilation
((source, "Program.cs"), parseOptions: RegularWithInterceptors, options: WithNullableEnable()), verify: Verification.Skipped);
4527
var verifier = CompileAndVerify(
CreateEmptyCompilation
((source, "Program.cs"), parseOptions: RegularWithInterceptors, options: WithNullableEnable()), verify: Verification.Skipped);
Semantics\InterpolationTests.cs (3)
1035
CreateEmptyCompilation
(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugExe)
1068
CreateEmptyCompilation
(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugExe)
1113
var comp =
CreateEmptyCompilation
(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: Test.Utilities.TestOptions.UnsafeReleaseDll).VerifyDiagnostics();
Semantics\NativeIntegerTests.cs (50)
180
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute());
186
comp =
CreateEmptyCompilation
(sourceA, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
193
comp =
CreateEmptyCompilation
(sourceB, references: new[] { ref1 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute());
199
comp =
CreateEmptyCompilation
(sourceB, references: new[] { ref2 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute());
700
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute());
704
comp =
CreateEmptyCompilation
(sourceA, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
709
comp =
CreateEmptyCompilation
(sourceB, references: new[] { ref1 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute());
713
comp =
CreateEmptyCompilation
(sourceB, references: new[] { ref2 }, parseOptions: TestOptions.Regular9.WithNoRefSafetyRulesAttribute());
861
comp =
CreateEmptyCompilation
(sourceA, references: new[] { ref1 }, parseOptions: TestOptions.Regular9);
900
comp =
CreateEmptyCompilation
(sourceB, references: new[] { ref2, refA }, parseOptions: TestOptions.Regular9);
970
comp =
CreateEmptyCompilation
(sourceA, references: new[] { ref1 }, parseOptions: TestOptions.Regular9);
1017
comp =
CreateEmptyCompilation
(sourceB, references: new[] { ref2, refA }, parseOptions: TestOptions.Regular9);
1154
comp =
CreateEmptyCompilation
(sourceA, references: new[] { ref1 }, parseOptions: TestOptions.Regular9);
1166
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9);
1229
comp =
CreateEmptyCompilation
(sourceA, references: new[] { ref1 }, parseOptions: TestOptions.Regular9);
1241
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9);
1298
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9);
1452
var comp =
CreateEmptyCompilation
(
1478
comp =
CreateEmptyCompilation
(
1511
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: parseOptions);
1515
comp =
CreateEmptyCompilation
(sourceA, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
1520
comp =
CreateEmptyCompilation
(sourceB, references: new[] { ref1 }, parseOptions: parseOptions);
1524
comp =
CreateEmptyCompilation
(sourceB, references: new[] { ref2 }, parseOptions: parseOptions);
1537
var comp =
CreateEmptyCompilation
(sourceB, references: new[] { reference }, parseOptions: parseOptions);
1595
var comp =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular9);
1602
comp =
CreateEmptyCompilation
("", references: new[] { ref1 }, parseOptions: TestOptions.Regular9);
1606
comp =
CreateEmptyCompilation
("", references: new[] { ref2 }, parseOptions: TestOptions.Regular9);
1648
var comp =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular9);
1655
comp =
CreateEmptyCompilation
("", references: new[] { ref1 }, parseOptions: TestOptions.Regular9);
1659
comp =
CreateEmptyCompilation
("", references: new[] { ref2 }, parseOptions: TestOptions.Regular9);
1730
var comp =
CreateEmptyCompilation
(sourceA);
1762
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9);
1898
var comp =
CreateEmptyCompilation
(sourceA, options: TestOptions.UnsafeReleaseDll);
1935
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9, options: TestOptions.UnsafeReleaseDll);
2061
var comp =
CreateEmptyCompilation
(sourceA, options: TestOptions.UnsafeReleaseDll);
2117
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9, options: TestOptions.UnsafeReleaseDll);
2211
var comp =
CreateEmptyCompilation
(sourceA);
2231
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9);
2303
var comp =
CreateEmptyCompilation
(sourceA);
2334
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9);
2466
var compB =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9);
2550
var comp =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular9);
2602
var comp =
CreateEmptyCompilation
(sourceA);
2622
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9);
2706
var comp =
CreateEmptyCompilation
(sourceA);
2724
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9);
2876
var comp =
CreateEmptyCompilation
(sourceB, new[] { refA }, parseOptions: TestOptions.Regular9);
4601
var comp =
CreateEmptyCompilation
(sourceA);
4618
comp =
CreateEmptyCompilation
(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular9);
10381
var comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular9);
Semantics\NullableReferenceTypesTests.cs (18)
8709
var comp0 =
CreateEmptyCompilation
(source0, parseOptions: TestOptions.Regular7);
8719
var comp =
CreateEmptyCompilation
(
8758
var comp =
CreateEmptyCompilation
(new[] { source, source2 });
8771
var comp2 =
CreateEmptyCompilation
(new[] { source, source3 });
8784
var comp3 =
CreateEmptyCompilation
(new[] { source, source4 });
83161
var comp =
CreateEmptyCompilation
(new[] { source }, options: WithNullableEnable());
88941
var comp =
CreateEmptyCompilation
(source);
88951
var comp2 =
CreateEmptyCompilation
(new[] { source }, options: WithNullableEnable());
90155
var comp =
CreateEmptyCompilation
(new[] { source }, options: WithNullableEnable());
91564
var comp =
CreateEmptyCompilation
(new[] { source, systemSource }, options: WithNullableEnable());
115817
var comp =
CreateEmptyCompilation
(new[] { source0 }, options: WithNullableEnable());
116739
var compilation1 =
CreateEmptyCompilation
(source1, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { MinCorlibRef });
116755
var compilation2 =
CreateEmptyCompilation
(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.EmitToImageReference(), MinCorlibRef });
116768
var compilation3 =
CreateEmptyCompilation
(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.ToMetadataReference(), MinCorlibRef });
116779
var compilation4 =
CreateEmptyCompilation
(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.EmitToImageReference() });
116809
var compilation5 =
CreateEmptyCompilation
(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.ToMetadataReference() });
116847
var compilation6 =
CreateEmptyCompilation
(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.EmitToImageReference(), MscorlibRef });
116877
var compilation7 =
CreateEmptyCompilation
(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.ToMetadataReference(), MscorlibRef });
Semantics\OverloadResolutionTestBase.cs (1)
33
var compilation =
CreateEmptyCompilation
(source, references, TestOptions.ReleaseDll);
Semantics\OverloadResolutionTests.cs (1)
1118
var compilation =
CreateEmptyCompilation
(source, references: new[] { MscorlibRef_v20 });
Semantics\PropertyAccessTests.cs (1)
33
var comp =
CreateEmptyCompilation
(
Semantics\RawInterpolationTests.cs (3)
1033
CreateEmptyCompilation
(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugExe)
1065
CreateEmptyCompilation
(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugExe)
1109
var comp =
CreateEmptyCompilation
(text, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: Test.Utilities.TestOptions.UnsafeReleaseDll).VerifyDiagnostics();
Semantics\RecordStructTests.cs (7)
2357
var corlibRef =
CreateEmptyCompilation
(corlib_cs).EmitToImageReference();
2369
var comp =
CreateEmptyCompilation
(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef });
2393
var comp =
CreateEmptyCompilation
(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef });
2459
var corlibRef =
CreateEmptyCompilation
(corlib_cs).EmitToImageReference();
2469
var comp =
CreateEmptyCompilation
(src, parseOptions: TestOptions.RegularPreview, references: new[] { corlibRef });
4583
var comp =
CreateEmptyCompilation
(src, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute());
4860
var comp =
CreateEmptyCompilation
(src, parseOptions: TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute());
Semantics\RefFieldTests.cs (12)
2206
var comp =
CreateEmptyCompilation
(new[] { sourceA }, parseOptions: TestOptions.Regular10);
2209
comp =
CreateEmptyCompilation
(new[] { sourceA, sourceB }, parseOptions: TestOptions.Regular10);
2226
comp =
CreateEmptyCompilation
(source, references: new[] { refA }, parseOptions: TestOptions.Regular10);
2240
comp =
CreateEmptyCompilation
(source, references: new[] { refAB }, parseOptions: TestOptions.Regular10);
2248
comp =
CreateEmptyCompilation
(source, references: new[] { refA });
2256
comp =
CreateEmptyCompilation
(source, references: new[] { refAB });
27122
comp =
CreateEmptyCompilation
(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion));
27131
comp =
CreateEmptyCompilation
(source2, references: new[] { ref0, ref1 }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion));
27183
comp =
CreateEmptyCompilation
(source1, references: new[] { refLowerVersion }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion));
27198
comp =
CreateEmptyCompilation
(source2, references: new[] { refHigherVersion, ref1 }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion));
27247
comp =
CreateEmptyCompilation
(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular10);
27262
comp =
CreateEmptyCompilation
(source2, references: new[] { ref0, ref1 });
Semantics\ScriptSemanticsTests.cs (8)
87
var taskCompilation =
CreateEmptyCompilation
(taskAssembly, references: new[] { MscorlibRef_v20 });
97
var script =
CreateEmptyCompilation
(
114
var script =
CreateEmptyCompilation
(
139
var script =
CreateEmptyCompilation
(
159
var script =
CreateEmptyCompilation
(
185
var script =
CreateEmptyCompilation
(
204
var script =
CreateEmptyCompilation
(
1371
var script =
CreateEmptyCompilation
(
Semantics\SemanticErrorTests.cs (2)
11178
CreateEmptyCompilation
(text).VerifyDiagnostics(
22119
CreateEmptyCompilation
(text).
Semantics\SpanStackSafetyTests.cs (8)
1924
var reference =
CreateEmptyCompilation
(
1941
var comp =
CreateEmptyCompilation
(
1958
var reference =
CreateEmptyCompilation
(
1975
var comp =
CreateEmptyCompilation
(
2002
var reference =
CreateEmptyCompilation
(
2019
var comp =
CreateEmptyCompilation
(
2043
var reference =
CreateEmptyCompilation
(
2060
var comp =
CreateEmptyCompilation
(
Semantics\StackAllocSpanExpressionsTests.cs (1)
781
CreateEmptyCompilation
(code, references, TestOptions.UnsafeReleaseDll).VerifyDiagnostics(
Semantics\SwitchTests.cs (1)
1152
var comp =
CreateEmptyCompilation
(new[] { syntaxTree }, references: null);
Semantics\TopLevelStatementsTests.cs (1)
7533
var comp =
CreateEmptyCompilation
(text, options: TestOptions.DebugExe, parseOptions: DefaultParseOptions);
Semantics\UnsafeTests.cs (1)
58
var comp1 =
CreateEmptyCompilation
(text1, assemblyName: "assembly1", references: new[] { MscorlibRef_v20 },
Semantics\UserDefinedConversionTests.cs (5)
1603
CreateEmptyCompilation
(source).VerifyDiagnostics();
1675
var comp =
CreateEmptyCompilation
(code);
1720
var comp =
CreateEmptyCompilation
(code);
1773
var comp =
CreateEmptyCompilation
(code);
1830
var comp =
CreateEmptyCompilation
(code);
Semantics\UseSiteErrorTests.cs (12)
1029
var delComp =
CreateEmptyCompilation
(
1044
var lib1Comp =
CreateEmptyCompilation
(
1058
var lib2Comp =
CreateEmptyCompilation
(
1223
var compilation =
CreateEmptyCompilation
(text).VerifyDiagnostics(
2266
var compilation =
CreateEmptyCompilation
(
2306
var compilation1 =
CreateEmptyCompilation
(source1, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { MinCorlibRef });
2322
var compilation2 =
CreateEmptyCompilation
(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.EmitToImageReference(), MinCorlibRef });
2333
var compilation3 =
CreateEmptyCompilation
(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.ToMetadataReference(), MinCorlibRef });
2344
var compilation4 =
CreateEmptyCompilation
(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.EmitToImageReference() });
2374
var compilation5 =
CreateEmptyCompilation
(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.ToMetadataReference() });
2389
var compilation6 =
CreateEmptyCompilation
(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.EmitToImageReference(), MscorlibRef });
2419
var compilation7 =
CreateEmptyCompilation
(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.ToMetadataReference(), MscorlibRef });
Semantics\UsingStatementTests.cs (2)
1774
CreateEmptyCompilation
(source).VerifyDiagnostics(
1800
CreateEmptyCompilation
(source).VerifyDiagnostics(
Semantics\ValueTupleTests.cs (5)
447
var comp =
CreateEmptyCompilation
(new[] { source, Stubs });
498
var comp =
CreateEmptyCompilation
(new[] { source, Stubs });
549
var comp =
CreateEmptyCompilation
(new[] { source, Stubs });
597
var comp =
CreateEmptyCompilation
(new[] { source, Stubs });
640
var comp =
CreateEmptyCompilation
(new[] { source, Stubs });
SourceGeneration\GeneratorDriverTests.cs (1)
3359
Compilation compilation =
CreateEmptyCompilation
(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions, references: metadataRefs);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (318)
BadSymbolReference.cs (6)
749
var compilation1 =
CreateEmptyCompilation
(
796
var libRef =
CreateEmptyCompilation
(libSource, new[] { MscorlibRef }, assemblyName: "System.Drawing").EmitToImageReference();
798
var comp1 =
CreateEmptyCompilation
(project1Source, new[] { MscorlibRef, libRef }, assemblyName: "Project1");
801
var comp2 =
CreateEmptyCompilation
(project2Source, new[] { MscorlibRef, libRef }, assemblyName: "Project2");
806
var comp3 =
CreateEmptyCompilation
(project3Source, new[] { MscorlibRef, comp1.ToMetadataReference(), comp2.ToMetadataReference() }, assemblyName: "Project3");
815
var comp3 =
CreateEmptyCompilation
(project3Source, new[] { MscorlibRef, comp1.EmitToImageReference(), comp2.EmitToImageReference() }, assemblyName: "Project3");
Compilation\CompilationAPITests.cs (15)
1901
var comp =
CreateEmptyCompilation
(text, references: new[] { MscorlibRef, alias });
2205
var c1 =
CreateEmptyCompilation
("public class Main { public static C C; }", new[] { MscorlibRef, reference, reference });
2254
var compilation =
CreateEmptyCompilation
(
2275
compilation =
CreateEmptyCompilation
(
2290
var libComp =
CreateEmptyCompilation
(
2311
var c1 =
CreateEmptyCompilation
(
2336
var c2 =
CreateEmptyCompilation
(
3602
var corlib =
CreateEmptyCompilation
(corlibSource, parseOptions: parseOptions);
3605
var other =
CreateEmptyCompilation
(@"public class C {}", new[] { corlibReference }, parseOptions: parseOptions);
3608
var current =
CreateEmptyCompilation
(@"public class C {}", new[] { otherReference, corlibReference });
3637
var corlib =
CreateEmptyCompilation
(corlibSource, parseOptions: parseOptions);
3640
var current =
CreateEmptyCompilation
(@"", new[] { corlibReference }, parseOptions: parseOptions);
3662
var corlib =
CreateEmptyCompilation
(corlibSource, parseOptions: parseOptions);
3665
var other =
CreateEmptyCompilation
(@"public class C {}", new[] { corlibReference }, parseOptions: parseOptions);
3668
var current =
CreateEmptyCompilation
(@"", new[] { otherReference, corlibReference });
Compilation\GetSemanticInfoBrokenCodeTests.cs (3)
315
var comp =
CreateEmptyCompilation
(new[] { tree });
330
var comp =
CreateEmptyCompilation
(new[] { tree });
345
var comp =
CreateEmptyCompilation
(new[] { tree });
Compilation\GetUnusedImportDirectivesTests.cs (2)
122
var comp =
CreateEmptyCompilation
(text, new[] { MscorlibRef });
346
var lib =
CreateEmptyCompilation
("", assemblyName: "lib");
Compilation\ReferenceManagerTests.cs (83)
516
var libV1 =
CreateEmptyCompilation
(
540
var libV2 =
CreateEmptyCompilation
(
556
var refLibV1 =
CreateEmptyCompilation
(
570
var main =
CreateEmptyCompilation
(
745
var compilation =
CreateEmptyCompilation
(tree, new[] { MscorlibRef, r1, r2_SysCore }, TestOptions.DebugExe, assemblyName: "Test");
832
return
CreateEmptyCompilation
(s, references);
962
var c =
CreateEmptyCompilation
("class C {}", TargetFrameworkUtil.StandardReferences.AddRange(new[] { ref1, ref2 }));
984
var c =
CreateEmptyCompilation
("class C {}", TargetFrameworkUtil.StandardReferences.AddRange(new[] { ref1, ref2 }));
1056
CreateEmptyCompilation
(source, TargetFrameworkUtil.StandardReferences.AddRange(new[] { ref1, ref2 })).VerifyDiagnostics();
1132
var main =
CreateEmptyCompilation
(sourceMain,
1197
var main =
CreateEmptyCompilation
(sourceMain,
1225
var compilation =
CreateEmptyCompilation
(source, TargetFrameworkUtil.StandardReferences.AddRange(new[] { arSA, enUS }));
1888
var pl =
CreateEmptyCompilation
(plSource, new[] { MscorlibPP7Ref, SystemRuntimePP7Ref });
1894
var main =
CreateEmptyCompilation
(mainSource, new MetadataReference[] { r1, MscorlibFacadeRef }, options: TestOptions.ReleaseDll);
1900
main =
CreateEmptyCompilation
(mainSource, new MetadataReference[] { r1, MscorlibFacadeRef, SystemRuntimeFacadeRef });
2151
var corlib1 =
CreateEmptyCompilation
("");
2183
var c1 =
CreateEmptyCompilation
("",
2193
var c2 =
CreateEmptyCompilation
("",
2248
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").EmitToImageReference(),
2249
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(),
2266
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""0.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(),
2267
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.1"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(),
2268
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(),
2269
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(),
2270
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.1.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference().
2393
var c =
CreateEmptyCompilation
(source, new[]
2429
var c =
CreateEmptyCompilation
(source, new[]
2465
var c =
CreateEmptyCompilation
(source, new[]
2506
var c =
CreateEmptyCompilation
(source, new[]
2577
var b1Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
2578
var b2Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
2579
var b3Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public class B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
2581
var aRef =
CreateEmptyCompilation
("public class A : B { }", new[] { MscorlibRef, b1Ref }, assemblyName: "A").EmitToImageReference();
2582
var dRef =
CreateEmptyCompilation
("public class D : B { }", new[] { MscorlibRef, b2Ref }, assemblyName: "D").EmitToImageReference();
2593
var c =
CreateEmptyCompilation
(@"
2631
var b1Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2632
var b2Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2633
var b3Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2634
var b4Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2636
var aRef =
CreateEmptyCompilation
(@"public interface A : B { }", new[] { MscorlibRef, b1Ref }, assemblyName: "A").EmitToImageReference();
2637
var dRef =
CreateEmptyCompilation
(@"public interface D : B { }", new[] { MscorlibRef, b2Ref }, assemblyName: "D").EmitToImageReference();
2667
var b1Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2668
var b2Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2669
var b3Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2670
var b4Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2672
var aRef =
CreateEmptyCompilation
(@"public interface A : B { }", new[] { MscorlibRef, b1Ref }, assemblyName: "A").EmitToImageReference();
2673
var dRef =
CreateEmptyCompilation
(@"public interface D : B { }", new[] { MscorlibRef, b2Ref }, assemblyName: "D").EmitToImageReference();
2873
var b1Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
2874
var b2Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
2876
var dRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference();
2877
var eRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference();
2885
var aRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef },
2896
var c =
CreateEmptyCompilation
("public class C : A { }", new[] { MscorlibRef, aRef, b1Ref },
2939
var b1Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", references: new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
2940
var b2Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", references: new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
2942
var dRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference();
2943
var eRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference();
2951
var aRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef },
2962
var c =
CreateEmptyCompilation
("public class C : A { }", new[] { MscorlibRef, aRef, b2Ref },
2999
var b1Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3000
var b2Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3002
var dRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference();
3003
var eRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference();
3005
var aRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef, b1Ref, b2Ref },
3043
var b1Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3044
var b2Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3045
var b3Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3046
var b4Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3048
var dRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference();
3049
var eRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference();
3051
var aRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef, b1Ref, b2Ref },
3062
var c =
CreateEmptyCompilation
("public class C : A { }", new[] { MscorlibRef, aRef },
3109
var b1Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3110
var b2Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3111
var b3Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3112
var b4Ref =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3114
var dRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference();
3115
var eRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference();
3117
var aRef =
CreateEmptyCompilation
(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef, b1Ref, b2Ref },
3178
var aRef =
CreateEmptyCompilation
(@"public interface A { System.Diagnostics.Process PA { get; } }", new[] { Net20.References.mscorlib, Net20.References.System },
3181
var bRef =
CreateEmptyCompilation
(@"public interface B { System.Diagnostics.Process PB { get; } }", new[] { MscorlibRef_v4_0_30316_17626, NetFramework.System },
3218
var aRef =
CreateEmptyCompilation
(@"public interface A { C CA { get; } }", new[] { MscorlibRef, TestReferences.SymbolsTests.Versioning.C2 },
3221
var bRef =
CreateEmptyCompilation
(@"public interface B { C CB { get; } }", new[] { MscorlibRef, TestReferences.SymbolsTests.Versioning.C1 },
Compilation\SemanticModelAPITests.cs (2)
2367
var compilation =
CreateEmptyCompilation
(@"
2380
var compilation =
CreateEmptyCompilation
(@"
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
3720
var compilation = (Compilation)
CreateEmptyCompilation
(new string[] {
Compilation\UsedAssembliesTests.cs (12)
35
var comp1 =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
56
var comp1 =
CreateEmptyCompilation
(source, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute());
297
Compilation comp =
CreateEmptyCompilation
(source,
379
var comp1 =
CreateEmptyCompilation
(source, parseOptions: parseOptions);
403
Compilation comp2 =
CreateEmptyCompilation
(source2, references: new[] { reference, SystemCoreRef, SystemDrawingRef }, parseOptions: parseOptions);
420
var comp1 =
CreateEmptyCompilation
(source, parseOptions: parseOptions);
437
Compilation comp2 =
CreateEmptyCompilation
(source2, references: new[] { reference, SystemCoreRef, SystemDrawingRef }, parseOptions: parseOptions);
5459
var comp0 =
CreateEmptyCompilation
(source0, parseOptions: parseOptions);
5473
var comp1 =
CreateEmptyCompilation
(source1, references: new[] { comp0Ref }, parseOptions: parseOptions);
5484
var comp2 =
CreateEmptyCompilation
(source2, references: new[] { comp0Ref }, parseOptions: parseOptions);
5500
var comp3 =
CreateEmptyCompilation
(source3, references: references, parseOptions: parseOptions);
5515
var comp4 =
CreateEmptyCompilation
(source4, references: new[] { comp0Ref, comp1Ref, comp2Ref }, parseOptions: parseOptions);
CrossLanguageTests.cs (1)
35
var comp =
CreateEmptyCompilation
(new[] { tree }, new[] { ref1 });
DocumentationComments\CrefTests.cs (1)
5869
var comp =
CreateEmptyCompilation
(
DocumentationComments\MethodDocumentationCommentTests.cs (3)
237
var compilation =
CreateEmptyCompilation
(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Diagnose));
242
compilation =
CreateEmptyCompilation
(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse));
247
compilation =
CreateEmptyCompilation
(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.None));
SymbolDisplay\SymbolDisplayTests.cs (2)
4993
var comp =
CreateEmptyCompilation
(source, WinRtRefs, TestOptions.ReleaseWinMD);
5774
var compA =
CreateEmptyCompilation
(sourceA, new[] { MscorlibRef });
Symbols\AnonymousTypesSymbolTests.cs (4)
1757
var comp =
CreateEmptyCompilation
(new[] { Parse(source), s_equalityComparerSourceTree }, new[] { MinCorlibRef });
1785
var stateLib =
CreateEmptyCompilation
(stateSource, new[] { MinCorlibRef });
1799
var attributeLib =
CreateEmptyCompilation
(attributeSource, new[] { MinCorlibRef, stateLib.ToMetadataReference() });
1811
var comp =
CreateEmptyCompilation
(new[] { Parse(source), s_equalityComparerSourceTree }, new[] { MinCorlibRef, attributeLib.ToMetadataReference() });
Symbols\ArrayTypeSymbolTests.cs (1)
26
var c =
CreateEmptyCompilation
(@"
Symbols\AssemblyAndNamespaceTests.cs (4)
208
var comp =
CreateEmptyCompilation
(new string[] { text3 }, references: new MetadataReference[] { compRef1, compRef2 }.ToList(), assemblyName: "Test3");
313
var compilation =
CreateEmptyCompilation
(@"
344
var compilation =
CreateEmptyCompilation
(@"
375
var comp =
CreateEmptyCompilation
(source, new[] { aliasedCorlib });
Symbols\CompilationCreationTests.cs (1)
2549
var c1 =
CreateEmptyCompilation
(text, new MetadataReference[]
Symbols\CorLibrary\Choosing.cs (4)
32
var corLib =
CreateEmptyCompilation
(@"
46
var consumer =
CreateEmptyCompilation
(@"
58
var corLib =
CreateEmptyCompilation
(@"
67
var consumer =
CreateEmptyCompilation
(@"
Symbols\CorLibrary\CorTypes.cs (17)
274
CreateEmptyCompilation
(source1 + source2).VerifyDiagnostics();
338
var corLib_v1_Comp =
CreateEmptyCompilation
(corLib_v1, assemblyName: "corLib");
350
var typeLib_v1_Comp =
CreateEmptyCompilation
(typeLib_v1, references: [corLib_v1_Comp.ToMetadataReference()], assemblyName: "typeLib");
360
var comp1 =
CreateEmptyCompilation
(
402
comp1 =
CreateEmptyCompilation
(
516
var corLib_v1_Comp =
CreateEmptyCompilation
(corLib_v1, assemblyName: "corLib");
528
var typeLib_v1_Comp =
CreateEmptyCompilation
(typeLib_v1, references: [corLib_v1_Comp.ToMetadataReference()], assemblyName: "typeLib");
541
var comp1 =
CreateEmptyCompilation
(
587
comp1 =
CreateEmptyCompilation
(
735
var corLib_v1_Comp =
CreateEmptyCompilation
(corLib_v1, assemblyName: "corLib");
794
var typeLib_v1_Comp =
CreateEmptyCompilation
(typeLib_v1, references: [corLib_v1_Comp.ToMetadataReference()], assemblyName: "typeLib");
814
var comp1 =
CreateEmptyCompilation
(
871
comp1 =
CreateEmptyCompilation
(
929
var corLib_v1_Comp =
CreateEmptyCompilation
(corLib_v1, assemblyName: "corLib");
989
var typeLib_v1_Comp =
CreateEmptyCompilation
(typeLib_v1, references: [corLib_v1_Comp.ToMetadataReference()], assemblyName: "typeLib");
1009
var comp1 =
CreateEmptyCompilation
(
1065
comp1 =
CreateEmptyCompilation
(
Symbols\CovariantReturnTests.cs (5)
218
CorelibraryWithoutCovariantReturnSupport1 =
CreateEmptyCompilation
(new string[] {
222
CorelibraryWithoutCovariantReturnSupport2 =
CreateEmptyCompilation
(new string[] {
226
CorelibraryWithCovariantReturnSupport1 =
CreateEmptyCompilation
(new string[] {
230
CorelibraryWithCovariantReturnSupport2 =
CreateEmptyCompilation
(new string[] {
234
CorelibraryWithCovariantReturnSupportButWithoutPreserveBaseOverridesAttribute =
CreateEmptyCompilation
(new string[] {
Symbols\DefaultInterfaceImplementationTests.cs (2)
67866
var compilation1 =
CreateEmptyCompilation
(source1, options: TestOptions.DebugDll,
67897
var compilation1 =
CreateEmptyCompilation
(source1, options: TestOptions.DebugDll,
Symbols\ExtensionMethodTests.cs (2)
2205
var compilation =
CreateEmptyCompilation
(source, new[] { Net40.References.mscorlib });
3447
var compilation =
CreateEmptyCompilation
(source, new[] { MscorlibRef_v20 }, TestOptions.ReleaseDll);
Symbols\FunctionPointerTypeSymbolTests.cs (2)
1934
var otherCorLib =
CreateEmptyCompilation
(@"
2060
var comp =
CreateEmptyCompilation
(@"
Symbols\GenericConstraintTests.cs (3)
5779
CreateEmptyCompilation
(source).VerifyDiagnostics(
5807
CreateEmptyCompilation
(source).VerifyDiagnostics(
7336
var metadataComp =
CreateEmptyCompilation
(code, new[] { MscorlibRef_v20 }, assemblyName: "assembly1");
Symbols\ImplicitClassTests.cs (1)
22
var c =
CreateEmptyCompilation
(@"
Symbols\IndexerTests.cs (1)
2834
var comp1 =
CreateEmptyCompilation
(src1, new[] { Net40.References.mscorlib });
Symbols\Metadata\MetadataMemberTests.cs (2)
186
var compilation =
CreateEmptyCompilation
(text, new[] { MscorlibRef });
238
var compilation =
CreateEmptyCompilation
(text, new[] { MscorlibRef });
Symbols\Metadata\MetadataTypeTests.cs (6)
27
var compilation =
CreateEmptyCompilation
(text, new[] { MscorlibRef });
67
var compilation =
CreateEmptyCompilation
(text, new[] { MscorlibRef });
117
var compilation =
CreateEmptyCompilation
(text, new[] { MscorlibRef }, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.Internal));
215
var compilation =
CreateEmptyCompilation
(text,
279
var compilation1 =
CreateEmptyCompilation
(source1, new[] { Net40.References.mscorlib, Net40.References.SystemCore });
283
var compilation2 =
CreateEmptyCompilation
(source2, new MetadataReference[] { Net40.References.mscorlib, Net40.References.SystemCore, compilation1.EmitToImageReference() },
Symbols\Metadata\PE\LoadingMethods.cs (1)
1348
var comp =
CreateEmptyCompilation
("", new[] { ilRef });
Symbols\Metadata\PE\NoPia.cs (1)
1570
var minimalCoreLibReference =
CreateEmptyCompilation
(coreLibSource).ToMetadataReference();
Symbols\Metadata\PE\NoPiaLocalHideAndTypeSubstitutionTests.cs (11)
73
var localType1 =
CreateEmptyCompilation
(assemblyName: "Dummy1", source: new string[] { localTypeSource1 },
79
var localType2 =
CreateEmptyCompilation
(assemblyName: "Dummy2", source: new string[] { localTypeSource2 },
86
var localConsumer =
CreateEmptyCompilation
(assemblyName: "Dummy3", source: CSharpTestSource.None,
122
var localConsumer =
CreateEmptyCompilation
(assemblyName: "Dummy", source: new string[] { localTypeSource },
185
var localConsumer =
CreateEmptyCompilation
(assemblyName: "Dummy", source: new string[] { localTypeSource },
222
var localConsumer =
CreateEmptyCompilation
(assemblyName: "Dummy", source: new string[] { localTypeSource },
257
var localConsumer =
CreateEmptyCompilation
(assemblyName: "Dummy", source: new string[] { localTypeSource },
288
var localConsumer =
CreateEmptyCompilation
(assemblyName: "Dummy", source: new string[] { localTypeSource },
316
var localConsumer =
CreateEmptyCompilation
(assemblyName: "Dummy", source: CSharpTestSource.None,
338
var localConsumer =
CreateEmptyCompilation
(assemblyName: "Dummy", source: CSharpTestSource.None,
360
var localConsumer =
CreateEmptyCompilation
(assemblyName: "Dummy", source: CSharpTestSource.None,
Symbols\MissingSpecialMember.cs (14)
124
var comp =
CreateEmptyCompilation
(source, new[] { Net40.References.mscorlib }, options: TestOptions.ReleaseDll);
269
var comp =
CreateEmptyCompilation
(source);
351
validatePresent(
CreateEmptyCompilation
(string.Format(sourceTemplate, "public")));
352
validatePresent(
CreateEmptyCompilation
(string.Format(sourceTemplate, "internal")));
486
var corlibRef =
CreateEmptyCompilation
(corlibSource, parseOptions: parseOptions).EmitToImageReference(expectedWarnings: new[]
492
var publicLibRef =
CreateEmptyCompilation
(string.Format(libSourceTemplate, "public"), new[] { corlibRef }, parseOptions: parseOptions).EmitToImageReference();
493
var internalLibRef =
CreateEmptyCompilation
(string.Format(libSourceTemplate, "internal"), new[] { corlibRef }, parseOptions: parseOptions).EmitToImageReference();
495
var comp =
CreateEmptyCompilation
("", new[] { corlibRef, publicLibRef, internalLibRef }, assemblyName: "Test");
509
var comp1 =
CreateEmptyCompilation
(source, parseOptions: parseOptions);
518
var comp2 =
CreateEmptyCompilation
("", new[] { reference }, parseOptions: parseOptions);
526
var comp =
CreateEmptyCompilation
("", new[] { MscorlibRef_v4_0_30316_17626 });
550
var comp =
CreateEmptyCompilation
("", [Net461.References.mscorlib]);
603
var comp =
CreateEmptyCompilation
("", refs);
961
var comp =
CreateEmptyCompilation
("", refs);
Symbols\OverriddenOrHiddenMembersTests.cs (1)
2865
var compilation =
CreateEmptyCompilation
(text, new MetadataReference[] { MscorlibRef_v20 });
Symbols\Retargeting\NoPia.cs (5)
283
var LocalTypes1 =
CreateEmptyCompilation
(s_sourceLocalTypes1_IL, new[] { MscorlibRef }, options: TestOptions.ReleaseDll, assemblyName: "LocalTypes1");
286
var LocalTypes2 =
CreateEmptyCompilation
(s_sourceLocalTypes2_IL, new[] { MscorlibRef }, options: TestOptions.ReleaseDll, assemblyName: "LocalTypes2");
2641
var piaCompilation =
CreateEmptyCompilation
(pia, references: [Net40.References.mscorlib], options: TestOptions.DebugDll, assemblyName: "Pia");
2665
var compilation1 =
CreateEmptyCompilation
(consumer1, references: [Net40.References.mscorlib, piaRef.WithEmbedInteropTypes(true)]);
2669
var compilation2 =
CreateEmptyCompilation
(consumer2, references: [Net461.References.mscorlib, piaRef, consumer1Ref]);
Symbols\Retargeting\RetargetCustomAttributes.cs (2)
298
var c1 =
CreateEmptyCompilation
(source1, new[] { OldMsCorLib });
299
var c2 =
CreateEmptyCompilation
(source2, new MetadataReference[] { NewMsCorLib, new CSharpCompilationReference(c1) });
Symbols\Retargeting\RetargetExplicitInterfaceImplementation.cs (2)
450
var ref1 =
CreateEmptyCompilation
("").ToMetadataReference();
459
var compilation2 = CreateCompilation(source2, references: new[] { compilation1.ToMetadataReference(), ref1,
CreateEmptyCompilation
("").ToMetadataReference() });
Symbols\Retargeting\RetargetingTests.cs (12)
336
var comp =
CreateEmptyCompilation
(source);
373
var comp =
CreateEmptyCompilation
(source);
433
var comp =
CreateEmptyCompilation
(source);
512
var comp =
CreateEmptyCompilation
(source);
573
var comp =
CreateEmptyCompilation
(source);
634
var comp =
CreateEmptyCompilation
(source);
733
var comp1 =
CreateEmptyCompilation
(source, new[] { MscorlibRef_v20 }, TestOptions.ReleaseDll);
738
var comp2 =
CreateEmptyCompilation
("", new[] { MscorlibRef_v4_0_30316_17626, new CSharpCompilationReference(comp1) }, TestOptions.ReleaseDll);
1054
var unmanagedCallersOnlyAssembly =
CreateEmptyCompilation
(@"
1068
var finalComp =
CreateEmptyCompilation
(@"C.M(1);", options: TestOptions.ReleaseExe, references: new[] { afterRetargeting.ToMetadataReference(), unmanagedCallersOnlyAssembly.ToMetadataReference() });
1132
var unmanagedCallersOnlyAssembly =
CreateEmptyCompilation
(@"
1145
var finalComp =
CreateEmptyCompilation
(@"C.M(1);", options: TestOptions.ReleaseExe, references: new[] { afterRetargeting.ToMetadataReference(), unmanagedCallersOnlyAssembly.ToMetadataReference() });
Symbols\Source\BaseClassTests.cs (26)
35
var comp =
CreateEmptyCompilation
(text);
55
var comp =
CreateEmptyCompilation
(text);
102
var comp =
CreateEmptyCompilation
(text);
131
var comp =
CreateEmptyCompilation
(text);
233
var comp =
CreateEmptyCompilation
(text);
262
var comp = (Compilation)
CreateEmptyCompilation
(text);
299
var comp = (Compilation)
CreateEmptyCompilation
(text);
462
var comp =
CreateEmptyCompilation
(text);
480
var comp =
CreateEmptyCompilation
(text);
498
var comp =
CreateEmptyCompilation
(text);
518
var comp =
CreateEmptyCompilation
(text);
532
var comp =
CreateEmptyCompilation
(text);
547
var comp =
CreateEmptyCompilation
(text);
565
var comp =
CreateEmptyCompilation
(text);
585
var comp =
CreateEmptyCompilation
(text);
604
var comp =
CreateEmptyCompilation
(text);
624
var comp =
CreateEmptyCompilation
(text);
649
var comp =
CreateEmptyCompilation
(text);
668
var comp =
CreateEmptyCompilation
(text);
685
var comp =
CreateEmptyCompilation
(text);
1253
var comp =
CreateEmptyCompilation
(text);
1278
var comp =
CreateEmptyCompilation
(text);
1300
var comp =
CreateEmptyCompilation
(text);
1319
var comp =
CreateEmptyCompilation
(text);
1335
var comp =
CreateEmptyCompilation
(text);
1379
var comp =
CreateEmptyCompilation
(new[] { text1, text2 });
Symbols\Source\ClsComplianceTests.cs (1)
3314
var comp =
CreateEmptyCompilation
(source, WinRtRefs, options: TestOptions.ReleaseWinMD);
Symbols\Source\CompletionTests.cs (1)
32
var comp =
CreateEmptyCompilation
(text, skipUsesIsNullable: true);
Symbols\Source\CustomModifierCopyTests.cs (22)
958
var comp =
CreateEmptyCompilation
(source, new[] { MscorlibRef, SystemCoreRef, ilRef });
1002
var comp1 =
CreateEmptyCompilation
(source1, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef });
1034
var comp2 =
CreateEmptyCompilation
(source2, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef });
1058
var comp3 =
CreateEmptyCompilation
(source3, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef });
1079
var comp4 =
CreateEmptyCompilation
(source4, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef });
1132
var comp1 =
CreateEmptyCompilation
(source1, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef });
1156
var comp2 =
CreateEmptyCompilation
(source2, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef });
1170
var comp3 =
CreateEmptyCompilation
(source3, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef });
1279
var comp1 =
CreateEmptyCompilation
(source1, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef });
1320
var comp2 =
CreateEmptyCompilation
(source2, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef });
1348
var comp3 =
CreateEmptyCompilation
(source3, new[] { MscorlibRef, SystemCoreRef, ilRef, ValueTupleRef, SystemRuntimeFacadeRef, CSharpRef });
1395
var comp =
CreateEmptyCompilation
(source, new[] { MscorlibRef, SystemCoreRef, ilRef });
1435
var comp =
CreateEmptyCompilation
(source, new[] { MscorlibRef, SystemCoreRef, ilRef });
1480
var comp =
CreateEmptyCompilation
(source, new[] { MscorlibRef, SystemCoreRef, ilRef });
1524
var comp =
CreateEmptyCompilation
(source, new[] { MscorlibRef, SystemCoreRef, ilRef });
1579
var comp =
CreateEmptyCompilation
(source, new[] { MscorlibRef, SystemCoreRef, ilRef });
1633
var comp =
CreateEmptyCompilation
(source, new[] { MscorlibRef, SystemCoreRef, ilRef });
1683
var comp =
CreateEmptyCompilation
(source, new[] { MscorlibRef, SystemCoreRef, ilRef });
1768
var comp =
CreateEmptyCompilation
(source, new[] { MscorlibRef, SystemCoreRef, ilRef });
1885
var comp =
CreateEmptyCompilation
(source, new[] { MscorlibRef, SystemCoreRef, ilRef });
1982
var comp =
CreateEmptyCompilation
(source, new[] { MscorlibRef, SystemCoreRef, ilRef });
2084
var comp =
CreateEmptyCompilation
(source, new[] { MscorlibRef, SystemCoreRef, ilRef });
Symbols\Source\DelegateTests.cs (2)
29
var comp =
CreateEmptyCompilation
(text);
54
var comp =
CreateEmptyCompilation
(
Symbols\Source\EnumTests.cs (1)
933
var compilation =
CreateEmptyCompilation
(text, new[] { MscorlibRef });
Symbols\Source\EventTests.cs (3)
370
var comp =
CreateEmptyCompilation
(source, new[] { MscorlibRef, SystemCoreRef });
382
var libComp =
CreateEmptyCompilation
(source, new[] { MscorlibRef }).VerifyDiagnostics(
399
var libComp =
CreateEmptyCompilation
(source, references: new[] { MscorlibRef }).VerifyDiagnostics(
Symbols\Source\FieldTests.cs (3)
60
var comp =
CreateEmptyCompilation
(text);
117
var comp =
CreateEmptyCompilation
(text);
141
var comp =
CreateEmptyCompilation
(text);
Symbols\Source\LocationTests.cs (1)
26
var comp =
CreateEmptyCompilation
(text, new[] { MscorlibRef });
Symbols\Source\MethodTests.cs (1)
1409
var comp =
CreateEmptyCompilation
(text);
Symbols\Source\SourcePlusMetadataTests.cs (2)
187
var compilation =
CreateEmptyCompilation
(text, new[] { MscorlibRef });
203
var compilation =
CreateEmptyCompilation
(text, new[] { MscorlibRef });
Symbols\Source\TypeMapTests.cs (1)
53
var comp =
CreateEmptyCompilation
(text);
Symbols\StaticAbstractMembersInInterfacesTests.cs (1)
32234
references: new[] {
CreateEmptyCompilation
("").ToMetadataReference() });
Symbols\SymbolDistinguisherTests.cs (2)
314
var dummyComp =
CreateEmptyCompilation
("", assemblyName: "Error");
316
var validType =
CreateEmptyCompilation
("", new[] { MscorlibRef }).GetSpecialType(SpecialType.System_Int32);
Symbols\SymbolErrorTests.cs (8)
8701
CreateEmptyCompilation
(text).VerifyDiagnostics(
9726
CreateEmptyCompilation
(text).VerifyDiagnostics(
9749
CreateEmptyCompilation
(text).VerifyDiagnostics(
9770
CreateEmptyCompilation
(text).VerifyDiagnostics(
15018
var compilation =
CreateEmptyCompilation
(source, new[] { Net40.References.mscorlib });
19148
var netModule =
CreateEmptyCompilation
("", options: TestOptions.ReleaseModule, assemblyName: "lib").EmitToImageReference(expectedWarnings: new[] { Diagnostic(ErrorCode.WRN_NoRuntimeMetadataVersion) });
20966
var forwarderCompilation =
CreateEmptyCompilation
(
21031
var forwarderCompilation =
CreateEmptyCompilation
(
Symbols\TypeTests.cs (8)
537
var compilation =
CreateEmptyCompilation
(text, new[] { Net40.References.mscorlib });
804
var sysConsoleRef =
CreateEmptyCompilation
(
815
var main1 =
CreateEmptyCompilation
(
828
var main2 =
CreateEmptyCompilation
(
926
var comp =
CreateEmptyCompilation
(text);
944
var comp =
CreateEmptyCompilation
(code);
980
var comp =
CreateEmptyCompilation
(code);
993
var comp =
CreateEmptyCompilation
(code);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (5)
CSharpTestBase.cs (5)
1670
return
CreateEmptyCompilation
(source, allReferences, options, parseOptions);
1807
return
CreateEmptyCompilation
(source, TargetFrameworkUtil.GetReferences(targetFramework, references), options, parseOptions, assemblyName, sourceFileName, skipUsesIsNullable);
2849
var reference =
CreateEmptyCompilation
(
2856
var comp =
CreateEmptyCompilation
(
2868
var comp =
CreateEmptyCompilation
(
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (22)
CodeGen\WinMdEventTests.cs (4)
623
var comp1 =
CreateEmptyCompilation
(source1, WinRtRefs, TestOptions.ReleaseWinMD, TestOptions.Regular, "Lib");
627
var comp2 =
CreateEmptyCompilation
(source2, WinRtRefs.Concat(new MetadataReference[] { new CSharpCompilationReference(comp1), serializationRef, SystemXmlRef }), TestOptions.ReleaseExe);
648
var comp =
CreateEmptyCompilation
(source, WinRtRefs, TestOptions.ReleaseWinMD, TestOptions.Regular7);
668
var comp =
CreateEmptyCompilation
(source, WinRtRefs, TestOptions.ReleaseWinMD);
CodeGen\WinRTCollectionTests.cs (3)
48
var comp =
CreateEmptyCompilation
(source, references: WinRtRefs);
354
var comp =
CreateEmptyCompilation
(source, references: WinRtRefs);
7418
var comp =
CreateEmptyCompilation
(source, references: WinRtRefs);
Metadata\WinMdDumpTest.cs (1)
444
var comp =
CreateEmptyCompilation
("", references, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.All));
Metadata\WinMdEventTests.cs (14)
238
_eventLibRef =
CreateEmptyCompilation
(
307
var dynamicCommon =
CreateEmptyCompilation
(
2839
var comp =
CreateEmptyCompilation
(source, WinRtRefs.Concat(new[] { ilRef }));
2914
var comp =
CreateEmptyCompilation
(source, WinRtRefs, TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug));
2958
var comp =
CreateEmptyCompilation
(source, WinRtRefs.Concat(new[] { ilRef }), TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug));
3027
var comp =
CreateEmptyCompilation
(source, WinRtRefs.Concat(new[] { interfaceILRef, baseILRef }), TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug));
3093
var comp =
CreateEmptyCompilation
(source, WinRtRefs.Concat(new[] { ilRef }), TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug));
3165
var comp =
CreateEmptyCompilation
(source, WinRtRefs.Concat(new[] { ilRef }));
3192
var comp =
CreateEmptyCompilation
(source, WinRtRefs.Concat(new[] { ilRef }));
3218
var comp =
CreateEmptyCompilation
(source, WinRtRefs.Concat(new[] { interfaceILRef, baseILRef }));
3249
var comp =
CreateEmptyCompilation
(source, WinRtRefs.Concat(new[] { interfaceILRef, baseILRef }));
3288
var comp =
CreateEmptyCompilation
(source, WinRtRefs, TestOptions.CreateTestOptions(kind, OptimizationLevel.Debug));
3379
CreateEmptyCompilation
(source, WinRtRefs, TestOptions.ReleaseWinMD).VerifyDiagnostics(
3556
var comp =
CreateEmptyCompilation
("", WinRtRefs.Concat(new[] { ilRef }), TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All));