Skip to content

Commit 953f33c

Browse files
committed
Auto merge of #76854 - aDotInTheVoid:mir-opt-32-64-diff-name, r=oli-obk
Rename mir-opt diff tests with 32/64 bit Now syntax highlighting should work. I've tested that `--bless` works localy, but I'm not sure it's possible on CI Fixes #75746 r? `@oli-obk`
2 parents a0925fb + 735776d commit 953f33c

File tree

77 files changed

+215
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+215
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
digraph Mir_0_3 {
2+
graph [fontname="Courier, monospace"];
3+
node [fontname="Courier, monospace"];
4+
edge [fontname="Courier, monospace"];
5+
label=<fn main() -&gt; ()<br align="left"/>>;
6+
bb0__0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">0</td></tr><tr><td align="left" balign="left">_0 = const ()<br/></td></tr><tr><td align="left">goto</td></tr></table>>];
7+
bb1__0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">1</td></tr><tr><td align="left">resume</td></tr></table>>];
8+
bb2__0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">2</td></tr><tr><td align="left">return</td></tr></table>>];
9+
bb0__0_3 -> bb2__0_3 [label=""];
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>coverage_of_if_else - Code Regions</title>
5+
<style>
6+
.line {
7+
counter-increment: line;
8+
}
9+
.line:before {
10+
content: counter(line) ": ";
11+
font-family: Menlo, Monaco, monospace;
12+
font-style: italic;
13+
width: 3.8em;
14+
display: inline-block;
15+
text-align: right;
16+
filter: opacity(50%);
17+
-webkit-user-select: none;
18+
}
19+
.code {
20+
color: #dddddd;
21+
background-color: #222222;
22+
font-family: Menlo, Monaco, monospace;
23+
line-height: 1.4em;
24+
border-bottom: 2px solid #222222;
25+
white-space: pre;
26+
display: inline-block;
27+
}
28+
.odd {
29+
background-color: #55bbff;
30+
color: #223311;
31+
}
32+
.even {
33+
background-color: #ee7756;
34+
color: #551133;
35+
}
36+
.code {
37+
--index: calc(var(--layer) - 1);
38+
padding-top: calc(var(--index) * 0.15em);
39+
filter:
40+
hue-rotate(calc(var(--index) * 25deg))
41+
saturate(calc(100% - (var(--index) * 2%)))
42+
brightness(calc(100% - (var(--index) * 1.5%)));
43+
}
44+
.annotation {
45+
color: #4444ff;
46+
font-family: monospace;
47+
font-style: italic;
48+
display: none;
49+
-webkit-user-select: none;
50+
}
51+
body:active .annotation {
52+
/* requires holding mouse down anywhere on the page */
53+
display: inline-block;
54+
}
55+
span:hover .annotation {
56+
/* requires hover over a span ONLY on its first line */
57+
display: inline-block;
58+
}
59+
</style>
60+
</head>
61+
<body>
62+
<div class="code" style="counter-reset: line 4"><span class="line"><span class="code" style="--layer: 0">fn main() </span><span><span class="code even" style="--layer: 1" title="0: $DIR/spanview-block.rs:5:11: 5:13:
63+
5:11-5:13: Assign: _0 = const ()
64+
5:13-5:13: Goto: goto -&gt; bb2"><span class="annotation">0⦊</span>{}<span class="annotation">⦉0</span></span></span><span><span class="code odd" style="--layer: 1" title="2: $DIR/spanview-block.rs:5:13: 5:13:
65+
5:13-5:13: Return: return"><span class="annotation">2⦊</span>‸<span class="annotation">⦉2</span></span></span></span></div>
66+
</body>
67+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>coverage_of_if_else - Code Regions</title>
5+
<style>
6+
.line {
7+
counter-increment: line;
8+
}
9+
.line:before {
10+
content: counter(line) ": ";
11+
font-family: Menlo, Monaco, monospace;
12+
font-style: italic;
13+
width: 3.8em;
14+
display: inline-block;
15+
text-align: right;
16+
filter: opacity(50%);
17+
-webkit-user-select: none;
18+
}
19+
.code {
20+
color: #dddddd;
21+
background-color: #222222;
22+
font-family: Menlo, Monaco, monospace;
23+
line-height: 1.4em;
24+
border-bottom: 2px solid #222222;
25+
white-space: pre;
26+
display: inline-block;
27+
}
28+
.odd {
29+
background-color: #55bbff;
30+
color: #223311;
31+
}
32+
.even {
33+
background-color: #ee7756;
34+
color: #551133;
35+
}
36+
.code {
37+
--index: calc(var(--layer) - 1);
38+
padding-top: calc(var(--index) * 0.15em);
39+
filter:
40+
hue-rotate(calc(var(--index) * 25deg))
41+
saturate(calc(100% - (var(--index) * 2%)))
42+
brightness(calc(100% - (var(--index) * 1.5%)));
43+
}
44+
.annotation {
45+
color: #4444ff;
46+
font-family: monospace;
47+
font-style: italic;
48+
display: none;
49+
-webkit-user-select: none;
50+
}
51+
body:active .annotation {
52+
/* requires holding mouse down anywhere on the page */
53+
display: inline-block;
54+
}
55+
span:hover .annotation {
56+
/* requires hover over a span ONLY on its first line */
57+
display: inline-block;
58+
}
59+
</style>
60+
</head>
61+
<body>
62+
<div class="code" style="counter-reset: line 4"><span class="line"><span class="code" style="--layer: 0">fn main() </span><span><span class="code even" style="--layer: 1" title="0[0]: $DIR/spanview-statement.rs:5:11: 5:13:
63+
5:11-5:13: Assign: _0 = const ()"><span class="annotation">0[0]⦊</span>{}<span class="annotation">⦉0[0]</span></span></span><span><span class="code odd" style="--layer: 1" title="0:Goto: $DIR/spanview-statement.rs:5:13: 5:13:
64+
5:13-5:13: Goto: goto -&gt; bb2"><span class="annotation">0:Goto⦊</span>‸<span class="annotation">⦉0:Goto</span></span></span><span><span class="code even" style="--layer: 1" title="2:Return: $DIR/spanview-statement.rs:5:13: 5:13:
65+
5:13-5:13: Return: return"><span class="annotation">2:Return⦊</span>‸<span class="annotation">⦉2:Return</span></span></span></span></div>
66+
</body>
67+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>coverage_of_if_else - Code Regions</title>
5+
<style>
6+
.line {
7+
counter-increment: line;
8+
}
9+
.line:before {
10+
content: counter(line) ": ";
11+
font-family: Menlo, Monaco, monospace;
12+
font-style: italic;
13+
width: 3.8em;
14+
display: inline-block;
15+
text-align: right;
16+
filter: opacity(50%);
17+
-webkit-user-select: none;
18+
}
19+
.code {
20+
color: #dddddd;
21+
background-color: #222222;
22+
font-family: Menlo, Monaco, monospace;
23+
line-height: 1.4em;
24+
border-bottom: 2px solid #222222;
25+
white-space: pre;
26+
display: inline-block;
27+
}
28+
.odd {
29+
background-color: #55bbff;
30+
color: #223311;
31+
}
32+
.even {
33+
background-color: #ee7756;
34+
color: #551133;
35+
}
36+
.code {
37+
--index: calc(var(--layer) - 1);
38+
padding-top: calc(var(--index) * 0.15em);
39+
filter:
40+
hue-rotate(calc(var(--index) * 25deg))
41+
saturate(calc(100% - (var(--index) * 2%)))
42+
brightness(calc(100% - (var(--index) * 1.5%)));
43+
}
44+
.annotation {
45+
color: #4444ff;
46+
font-family: monospace;
47+
font-style: italic;
48+
display: none;
49+
-webkit-user-select: none;
50+
}
51+
body:active .annotation {
52+
/* requires holding mouse down anywhere on the page */
53+
display: inline-block;
54+
}
55+
span:hover .annotation {
56+
/* requires hover over a span ONLY on its first line */
57+
display: inline-block;
58+
}
59+
</style>
60+
</head>
61+
<body>
62+
<div class="code" style="counter-reset: line 4"><span class="line"><span class="code" style="--layer: 0">fn main() {}</span><span><span class="code even" style="--layer: 1" title="0:Goto: $DIR/spanview-terminator.rs:5:13: 5:13:
63+
5:13-5:13: Goto: goto -&gt; bb2"><span class="annotation">0:Goto⦊</span>‸<span class="annotation">⦉0:Goto</span></span></span><span><span class="code odd" style="--layer: 1" title="2:Return: $DIR/spanview-terminator.rs:5:13: 5:13:
64+
5:13-5:13: Return: return"><span class="annotation">2:Return⦊</span>‸<span class="annotation">⦉2:Return</span></span></span></span></div>
65+
</body>
66+
</html>

src/tools/compiletest/src/runtest.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -3156,12 +3156,12 @@ impl<'test> TestCx<'test> {
31563156

31573157
if self.config.bless {
31583158
for e in
3159-
glob(&format!("{}/{}.*.mir{}", test_dir.display(), test_crate, bit_width)).unwrap()
3159+
glob(&format!("{}/{}.*{}.mir", test_dir.display(), test_crate, bit_width)).unwrap()
31603160
{
31613161
std::fs::remove_file(e.unwrap()).unwrap();
31623162
}
31633163
for e in
3164-
glob(&format!("{}/{}.*.diff{}", test_dir.display(), test_crate, bit_width)).unwrap()
3164+
glob(&format!("{}/{}.*{}.diff", test_dir.display(), test_crate, bit_width)).unwrap()
31653165
{
31663166
std::fs::remove_file(e.unwrap()).unwrap();
31673167
}
@@ -3181,7 +3181,7 @@ impl<'test> TestCx<'test> {
31813181
let trimmed = test_name.trim_end_matches(".diff");
31823182
let test_against = format!("{}.after.mir", trimmed);
31833183
from_file = format!("{}.before.mir", trimmed);
3184-
expected_file = format!("{}{}", test_name, bit_width);
3184+
expected_file = format!("{}{}.diff", trimmed, bit_width);
31853185
assert!(
31863186
test_names.next().is_none(),
31873187
"two mir pass names specified for MIR diff"
@@ -3199,7 +3199,8 @@ impl<'test> TestCx<'test> {
31993199
from_file = format!("{}.{}.mir", test_name, first_pass);
32003200
to_file = Some(second_file);
32013201
} else {
3202-
expected_file = format!("{}{}", test_name, bit_width);
3202+
expected_file =
3203+
format!("{}{}.mir", test_name.trim_end_matches(".mir"), bit_width);
32033204
from_file = test_name.to_string();
32043205
assert!(
32053206
test_names.next().is_none(),

0 commit comments

Comments
 (0)