Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
f33a8940
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f33a8940
编写于
4月 05, 2016
作者:
G
Gen Lu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add IL verification to test attribute test
上级
dbff03b7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
72 addition
and
0 deletion
+72
-0
src/Compilers/CSharp/Test/Emit/Emit/DynamicAnalysis/DynamicInstrumentationTests.cs
.../Emit/Emit/DynamicAnalysis/DynamicInstrumentationTests.cs
+72
-0
未找到文件。
src/Compilers/CSharp/Test/Emit/Emit/DynamicAnalysis/DynamicInstrumentationTests.cs
浏览文件 @
f33a8940
...
...
@@ -652,7 +652,79 @@ static int MethodWithOutFactAttribute(int x)
True
"
;
string
expectedMethodWithFactAttributeIL
=
@"{
// Code size 68 (0x44)
.maxstack 4
.locals init (int V_0)
.try
{
IL_0000: ldsfld ""bool[] Program.<MethodWithFactAttribute>1ipayload__Field""
IL_0005: brtrue.s IL_001c
IL_0007: ldsfld ""System.Guid <PrivateImplementationDetails>.MVID""
IL_000c: ldtoken ""int Program.MethodWithFactAttribute(int)""
IL_0011: ldsflda ""bool[] Program.<MethodWithFactAttribute>1ipayload__Field""
IL_0016: ldc.i4.3
IL_0017: call ""void Microsoft.CodeAnalysis.Runtime.Instrumentation.CreatePayload(System.Guid, int, ref bool[], int)""
IL_001c: ldsfld ""bool[] Program.<MethodWithFactAttribute>1ipayload__Field""
IL_0021: ldc.i4.0
IL_0022: ldc.i4.1
IL_0023: stelem.i1
IL_0024: ldarg.0
IL_0025: ldc.i4.1
IL_0026: add
IL_0027: ldsfld ""bool[] Program.<MethodWithFactAttribute>1ipayload__Field""
IL_002c: ldc.i4.1
IL_002d: ldc.i4.1
IL_002e: stelem.i1
IL_002f: ldc.i4.1
IL_0030: add
IL_0031: ldsfld ""bool[] Program.<MethodWithFactAttribute>1ipayload__Field""
IL_0036: ldc.i4.2
IL_0037: ldc.i4.1
IL_0038: stelem.i1
IL_0039: stloc.0
IL_003a: leave.s IL_0042
}
finally
{
IL_003c: call ""void Microsoft.CodeAnalysis.Runtime.Instrumentation.FlushPayload()""
IL_0041: endfinally
}
IL_0042: ldloc.0
IL_0043: ret
}"
;
string
expectedMethodWithOutFactAttributeIL
=
@"{
// Code size 58 (0x3a)
.maxstack 4
IL_0000: ldsfld ""bool[] Program.<MethodWithOutFactAttribute>2ipayload__Field""
IL_0005: brtrue.s IL_001c
IL_0007: ldsfld ""System.Guid <PrivateImplementationDetails>.MVID""
IL_000c: ldtoken ""int Program.MethodWithOutFactAttribute(int)""
IL_0011: ldsflda ""bool[] Program.<MethodWithOutFactAttribute>2ipayload__Field""
IL_0016: ldc.i4.3
IL_0017: call ""void Microsoft.CodeAnalysis.Runtime.Instrumentation.CreatePayload(System.Guid, int, ref bool[], int)""
IL_001c: ldsfld ""bool[] Program.<MethodWithOutFactAttribute>2ipayload__Field""
IL_0021: ldc.i4.0
IL_0022: ldc.i4.1
IL_0023: stelem.i1
IL_0024: ldarg.0
IL_0025: ldc.i4.1
IL_0026: add
IL_0027: ldsfld ""bool[] Program.<MethodWithOutFactAttribute>2ipayload__Field""
IL_002c: ldc.i4.1
IL_002d: ldc.i4.1
IL_002e: stelem.i1
IL_002f: ldc.i4.1
IL_0030: add
IL_0031: ldsfld ""bool[] Program.<MethodWithOutFactAttribute>2ipayload__Field""
IL_0036: ldc.i4.2
IL_0037: ldc.i4.1
IL_0038: stelem.i1
IL_0039: ret
}"
;
CompilationVerifier
verifier
=
CompileAndVerify
(
source
+
InstrumentationHelperSource
+
XunitFactAttributeSource
,
emitOptions
:
EmitOptions
.
Default
.
WithInstrument
(
"Test.Flag"
),
expectedOutput
:
expectedOutput
);
verifier
.
VerifyIL
(
"Program.MethodWithFactAttribute"
,
expectedMethodWithFactAttributeIL
);
verifier
.
VerifyIL
(
"Program.MethodWithOutFactAttribute"
,
expectedMethodWithOutFactAttributeIL
);
}
private
CompilationVerifier
CompileAndVerify
(
string
source
,
EmitOptions
emitOptions
,
string
expectedOutput
=
null
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录