190 references to WithAllowUnsafe
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (21)
CodeGen\CodeGenLocalFunctionTests.cs (5)
4609VerifyOutput(source, output, TestOptions.ReleaseExe.WithAllowUnsafe(true).WithWarningLevel(0), verify: Verification.Passes);
4635VerifyOutput(source, "2", TestOptions.ReleaseExe.WithAllowUnsafe(true), verify: Verification.Fails);
4661VerifyOutput(source, "2", TestOptions.ReleaseExe.WithAllowUnsafe(true), verify: Verification.Fails);
4688VerifyOutput(source, "2", TestOptions.ReleaseExe.WithAllowUnsafe(true), verify: Verification.Fails);
4728VerifyOutput(src, $"10{Environment.NewLine}4", TestOptions.ReleaseExe.WithAllowUnsafe(true), verify: Verification.Fails);
CodeGen\CodeGenShortCircuitOperatorTests.cs (4)
5181var verifier = CompileAndVerify(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), verify: Verification.Fails, expectedOutput: @"---
5232var verifier = CompileAndVerify(source, verify: Verification.FailsILVerify, options: TestOptions.DebugExe.WithAllowUnsafe(true), expectedOutput: @"---
5543var verifier = CompileAndVerify(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), verify: Verification.Fails, expectedOutput: @"---
5616var compilation = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (6)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (84)
Semantics\ExtensionOperatorsTests.cs (22)
4190var comp = CreateCompilation(src, options: TestOptions.DebugDll.WithAllowUnsafe(true));
4224var comp = CreateCompilation(src, options: TestOptions.DebugDll.WithAllowUnsafe(true));
10418var comp = CreateCompilation(src, options: TestOptions.DebugDll.WithAllowUnsafe(true));
10448var comp = CreateCompilation([src, CompilerFeatureRequiredAttribute], options: TestOptions.DebugDll.WithAllowUnsafe(true));
19562var comp = CreateCompilation(src, options: TestOptions.DebugDll.WithAllowUnsafe(true));
19598var comp = CreateCompilation(src, options: TestOptions.DebugDll.WithAllowUnsafe(true));
19630var comp = CreateCompilation(src, options: TestOptions.DebugDll.WithAllowUnsafe(true));
19666var comp = CreateCompilation(src, options: TestOptions.DebugDll.WithAllowUnsafe(true));
19717var comp = CreateCompilation(src, options: TestOptions.DebugExe.WithAllowUnsafe(true));
19759var comp = CreateCompilation(src, options: TestOptions.DebugExe.WithAllowUnsafe(true));
19803var comp = CreateCompilation(src, options: TestOptions.DebugExe.WithAllowUnsafe(true));
19845var comp = CreateCompilation(src, options: TestOptions.DebugExe.WithAllowUnsafe(true));
19870var comp = CreateCompilation(src, options: TestOptions.DebugDll.WithAllowUnsafe(true));
27134var comp = CreateCompilation(src, options: TestOptions.DebugDll.WithAllowUnsafe(true));
27166var comp = CreateCompilation(src, options: TestOptions.DebugDll.WithAllowUnsafe(true));
27207var comp = CreateCompilation(src, options: TestOptions.DebugExe.WithAllowUnsafe(true));
27239var comp = CreateCompilation(src, options: TestOptions.DebugExe.WithAllowUnsafe(true));
27273var comp = CreateCompilation(src, options: TestOptions.DebugExe.WithAllowUnsafe(true));
27302var comp = CreateCompilation(src, options: TestOptions.DebugExe.WithAllowUnsafe(true));
27327var comp = CreateCompilation([src, CompilerFeatureRequiredAttribute], options: TestOptions.DebugDll.WithAllowUnsafe(true));
27367var comp = CreateCompilation([src, CompilerFeatureRequiredAttribute], options: TestOptions.DebugExe.WithAllowUnsafe(true));
27395var comp = CreateCompilation([src, CompilerFeatureRequiredAttribute], options: TestOptions.DebugExe.WithAllowUnsafe(true));
Semantics\InlineArrayTests.cs (15)
1533var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.DebugDll.WithAllowUnsafe(true));
2028var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.DebugDll.WithAllowUnsafe(true));
2095var comp = CreateCompilationWithIL(src, ilSource, targetFramework: TargetFramework.Net80, options: TestOptions.DebugDll.WithAllowUnsafe(true));
2113var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.DebugDll.WithAllowUnsafe(true));
2131var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.DebugDll.WithAllowUnsafe(true));
18280var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.DebugExe.WithAllowUnsafe(true));
18308var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.DebugExe.WithAllowUnsafe(true));
18337var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.DebugExe.WithAllowUnsafe(true));
18376var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.DebugExe.WithAllowUnsafe(true));
18408var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.DebugExe.WithAllowUnsafe(true));
18439var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.DebugExe.WithAllowUnsafe(true));
18469var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.DebugExe.WithAllowUnsafe(true));
18509var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.DebugExe.WithAllowUnsafe(true));
19952var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.DebugDll.WithAllowUnsafe(true));
19993var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.DebugDll.WithAllowUnsafe(true));
Semantics\OutVarTests.cs (11)
5873var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular);
6023var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular);
6106var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular);
6140var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular);
19715options: TestOptions.ReleaseExe.WithAllowUnsafe(true),
20813options: TestOptions.ReleaseDebugDll.WithAllowUnsafe(true),
22371var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular);
22537var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular);
22748var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular);
22987var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular);
23025var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular);
Semantics\PatternMatchingTests_Scope.cs (7)
9764var compilation = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true));
9908var compilation = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true));
13185var compilation = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular);
13345var compilation = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular);
13510var compilation = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular);
13739var compilation = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular);
13777var compilation = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular);
Semantics\PatternMatchingTests3.cs (6)
385var compilation = CreatePatternCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true));
1229CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular7_3).VerifyDiagnostics(
1243CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular8).VerifyDiagnostics();
3482var compilation = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true));
5245var compilation = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9));
5314var compilation = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9));
Microsoft.CodeAnalysis.CSharp.Features (1)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (4)
IOperation\IOperationTests_IForEachLoopStatement.cs (4)
3123VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(source + TestSources.Span, expectedFlowGraph, expectedDiagnostics, TestOptions.ReleaseDll.WithAllowUnsafe(true));
3212VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(source + TestSources.Span, expectedFlowGraph, expectedDiagnostics, TestOptions.ReleaseDll.WithAllowUnsafe(true));
3301VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(source + TestSources.Span, expectedFlowGraph, expectedDiagnostics, TestOptions.ReleaseDll.WithAllowUnsafe(true));
3390VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(source + TestSources.Span, expectedFlowGraph, expectedDiagnostics, TestOptions.ReleaseDll.WithAllowUnsafe(true));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (42)
Semantics\DynamicTests.cs (9)
4014var verifier = CompileAndVerify(source, options: TestOptions.DebugDll.WithAllowUnsafe(true), verify: Verification.FailsPEVerify).VerifyDiagnostics();
4042var verifier = CompileAndVerify(source, options: TestOptions.DebugDll.WithAllowUnsafe(true), verify: Verification.FailsPEVerify).VerifyDiagnostics();
4069CreateCompilation(source, options: TestOptions.DebugDll.WithAllowUnsafe(true)).VerifyDiagnostics(
5521var comp1 = CreateCompilation(source1, options: TestOptions.DebugExe.WithAllowUnsafe(true), targetFramework: TargetFramework.StandardAndCSharp);
5711var comp = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), targetFramework: TargetFramework.StandardAndCSharp);
5872var comp1 = CreateCompilation(source1, options: TestOptions.DebugExe.WithAllowUnsafe(true), targetFramework: TargetFramework.StandardAndCSharp);
6069var comp = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), targetFramework: TargetFramework.StandardAndCSharp);
6514var comp1 = CreateCompilation(source1, options: TestOptions.DebugExe.WithAllowUnsafe(true), targetFramework: TargetFramework.StandardAndCSharp);
6701var comp = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), targetFramework: TargetFramework.StandardAndCSharp);
Semantics\StackAllocSpanExpressionsTests.cs (9)
432CreateCompilationWithMscorlibAndSpan(test, options: TestOptions.ReleaseDll.WithAllowUnsafe(true)).VerifyDiagnostics(
453CreateCompilationWithMscorlibAndSpan(test, options: TestOptions.ReleaseDll.WithAllowUnsafe(true)).VerifyDiagnostics(
490CreateCompilationWithMscorlibAndSpan(test, options: TestOptions.ReleaseDll.WithAllowUnsafe(true)).VerifyDiagnostics(
512CreateCompilationWithMscorlibAndSpan(test, options: TestOptions.ReleaseDll.WithAllowUnsafe(true), parseOptions: TestOptions.Regular7_3).VerifyDiagnostics(
517CreateCompilationWithMscorlibAndSpan(test, options: TestOptions.ReleaseDll.WithAllowUnsafe(true)).VerifyDiagnostics(
540CreateCompilationWithMscorlibAndSpan(test, options: TestOptions.ReleaseDll.WithAllowUnsafe(true), parseOptions: TestOptions.Regular7_3).VerifyDiagnostics(
545CreateCompilationWithMscorlibAndSpan(test, options: TestOptions.ReleaseDll.WithAllowUnsafe(true), parseOptions: TestOptions.Regular8).VerifyDiagnostics(
561CreateCompilationWithMscorlibAndSpan(test, options: TestOptions.ReleaseDll.WithAllowUnsafe(true), parseOptions: TestOptions.Regular7_3).VerifyDiagnostics(
566CreateCompilationWithMscorlibAndSpan(test, options: TestOptions.ReleaseDll.WithAllowUnsafe(true), parseOptions: TestOptions.Regular8).VerifyDiagnostics(
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (14)
Symbols\StaticAbstractMembersInInterfacesTests.cs (10)
15186var compilation1 = CreateCompilation(source1, options: TestOptions.DebugDll.WithAllowUnsafe(true),
15251var compilation1 = CreateCompilation(source1, options: TestOptions.DebugDll.WithAllowUnsafe(true),
15273compilation1 = CreateCompilation(source1, options: TestOptions.ReleaseDll.WithAllowUnsafe(true),
15330var compilation2 = CreateCompilation(source2, options: TestOptions.DebugDll.WithAllowUnsafe(true),
15341var compilation3 = CreateCompilation(source2 + source1, options: TestOptions.DebugDll.WithAllowUnsafe(true),
15379var compilation2 = CreateCompilation(source2, options: TestOptions.DebugDll.WithAllowUnsafe(true),
15390var compilation3 = CreateCompilation(source2 + source1, options: TestOptions.DebugDll.WithAllowUnsafe(true),
22502var compilation1 = CreateCompilation(source1, options: TestOptions.DebugDll.WithAllowUnsafe(true),
22652var compilation1 = CreateCompilation(source1, options: TestOptions.DebugDll.WithAllowUnsafe(true),
30314var compilation1 = CreateCompilation(source1, options: TestOptions.DebugDll.WithAllowUnsafe(true),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (5)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Microsoft.Interop.ComInterfaceGenerator (1)
Microsoft.Interop.LibraryImportGenerator (1)
Microsoft.VisualStudio.LanguageServices.CSharp (2)