Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
6299c330
R
Rust
项目概览
int
/
Rust
接近 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6299c330
编写于
11月 03, 2019
作者:
Q
Quentin Boyer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add header to compiletest to check for ice
上级
5930551f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
4 deletion
+20
-4
src/tools/compiletest/src/header.rs
src/tools/compiletest/src/header.rs
+10
-0
src/tools/compiletest/src/runtest.rs
src/tools/compiletest/src/runtest.rs
+10
-4
未找到文件。
src/tools/compiletest/src/header.rs
浏览文件 @
6299c330
...
...
@@ -376,6 +376,8 @@ pub struct TestProps {
// If true, `rustfix` will only apply `MachineApplicable` suggestions.
pub
rustfix_only_machine_applicable
:
bool
,
pub
assembly_output
:
Option
<
String
>
,
// If true, the test is expected to ICE
pub
should_ice
:
bool
,
}
impl
TestProps
{
...
...
@@ -414,6 +416,7 @@ pub fn new() -> Self {
run_rustfix
:
false
,
rustfix_only_machine_applicable
:
false
,
assembly_output
:
None
,
should_ice
:
false
,
}
}
...
...
@@ -464,6 +467,10 @@ fn load_from(&mut self, testfile: &Path, cfg: Option<&str>, config: &Config) {
self
.pp_exact
=
config
.parse_pp_exact
(
ln
,
testfile
);
}
if
!
self
.should_ice
{
self
.should_ice
=
config
.parse_should_ice
(
ln
);
}
if
!
self
.build_aux_docs
{
self
.build_aux_docs
=
config
.parse_build_aux_docs
(
ln
);
}
...
...
@@ -688,6 +695,9 @@ fn iter_header(testfile: &Path, cfg: Option<&str>, it: &mut dyn FnMut(&str)) {
}
impl
Config
{
fn
parse_should_ice
(
&
self
,
line
:
&
str
)
->
bool
{
self
.parse_name_directive
(
line
,
"should-ice"
)
}
fn
parse_error_pattern
(
&
self
,
line
:
&
str
)
->
Option
<
String
>
{
self
.parse_name_value_directive
(
line
,
"error-pattern"
)
}
...
...
src/tools/compiletest/src/runtest.rs
浏览文件 @
6299c330
...
...
@@ -383,7 +383,7 @@ fn check_if_test_should_compile(&self, proc_res: &ProcRes) {
fn
run_cfail_test
(
&
self
)
{
let
proc_res
=
self
.compile_test
();
self
.check_if_test_should_compile
(
&
proc_res
);
self
.check_no_compiler_crash
(
&
proc_res
);
self
.check_no_compiler_crash
(
&
proc_res
,
self
.props.should_ice
);
let
output_to_check
=
self
.get_output
(
&
proc_res
);
let
expected_errors
=
errors
::
load_errors
(
&
self
.testpaths.file
,
self
.revision
);
...
...
@@ -395,6 +395,12 @@ fn run_cfail_test(&self) {
}
else
{
self
.check_error_patterns
(
&
output_to_check
,
&
proc_res
);
}
if
self
.props.should_ice
{
match
proc_res
.status
.code
()
{
Some
(
101
)
=>
(),
_
=>
self
.fatal
(
"expected ICE"
),
}
}
self
.check_forbid_output
(
&
output_to_check
,
&
proc_res
);
}
...
...
@@ -1402,9 +1408,9 @@ fn check_error_patterns(&self, output_to_check: &str, proc_res: &ProcRes) {
}
}
fn
check_no_compiler_crash
(
&
self
,
proc_res
:
&
ProcRes
)
{
fn
check_no_compiler_crash
(
&
self
,
proc_res
:
&
ProcRes
,
should_ice
:
bool
)
{
match
proc_res
.status
.code
()
{
Some
(
101
)
=>
self
.fatal_proc_rec
(
"compiler encountered internal error"
,
proc_res
),
Some
(
101
)
if
!
should_ice
=>
self
.fatal_proc_rec
(
"compiler encountered internal error"
,
proc_res
),
None
=>
self
.fatal_proc_rec
(
"compiler terminated by signal"
,
proc_res
),
_
=>
(),
}
...
...
@@ -2518,7 +2524,7 @@ fn run_codegen_units_test(&self) {
self
.fatal_proc_rec
(
"compilation failed!"
,
&
proc_res
);
}
self
.check_no_compiler_crash
(
&
proc_res
);
self
.check_no_compiler_crash
(
&
proc_res
,
self
.props.should_ice
);
const
PREFIX
:
&
'static
str
=
"MONO_ITEM "
;
const
CGU_MARKER
:
&
'static
str
=
"@@"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录