提交 cf47d9b5 编写于 作者: L Llewellyn Pritchard

Add test

上级 fbfe9561
......@@ -9194,6 +9194,29 @@ static void Main(string[] args)
var result = CompileAndVerify(compilation, expectedOutput: "5");
}
[Fact, WorkItem(7550, "https://github.com/dotnet/roslyn/issues/7550")]
public void EnsureNullPointerIsPoppedIfUnused()
{
string source = @"
public class A
{
public unsafe byte* Ptr;
static void Main()
{
unsafe
{
var x = new A();
byte* ptr = (x == null) ? null : x.Ptr;
}
System.Console.WriteLine(""OK"");
}
}
";
CompileAndVerify(source, options: TestOptions.UnsafeReleaseExe, expectedOutput: "OK");
}
#endregion
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册