Skip to content

Commit e144474

Browse files
DragonDiscipleserge-sans-paille
authored andcommitted
Fix opt-viewer tests failing after move from cgi.escape to html.escape
These two tests utilize pre-generated opt-viewer output to diff against a run of opt-viewer over a known yaml file. In commit 4b428e8 (D76126), the escape function used for rendering was changed from cgi.escape to html.escape. This modification causes a behavioral difference with regards to quote characters. cgi will not escape quotes by default, but html will. Therefore, these tests were failing because they expected the old behavior of "string", but was instead seeing "string&quot. This solution modifies the known test outputs to use the escaped quotes rather than not escaping quotes during rendering for no particular reason. It is notable that when testing the optimization records generated by LLVM, there was never quotes in the remarks I could find, specifically in the Callee field where they exist in the pre-generated yaml for testing. Differential Revision: https://reviews.llvm.org/D78241
1 parent c5fa0a4 commit e144474

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/test/tools/opt-viewer/Outputs/suppress/s.swift.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
<td></td>
125125
<td></td>
126126
<td class="column-entry-green">sil-inliner</td>
127-
<td><pre style="display:inline"></pre><span class="column-entry-yellow"> <a href="s.swift.html#L6">"s.f()"</a> inlined into "main" (cost = 20, benefit = 20)&nbsp;</span></td>
127+
<td><pre style="display:inline"></pre><span class="column-entry-yellow"> <a href="s.swift.html#L6">&quot;s.f()&quot;</a> inlined into &quot;main&quot; (cost = 20, benefit = 20)&nbsp;</span></td>
128128
<td class="column-entry-yellow">main</td>
129129
</tr>
130130

llvm/test/tools/opt-viewer/Outputs/unicode-function-name/s.swift.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
<td></td>
125125
<td></td>
126126
<td class="column-entry-green">sil-inliner</td>
127-
<td><pre style="display:inline"> </pre><span class="column-entry-yellow"> <a href="s.swift.html#L3">"s.• infix(_:_:)"</a> inlined into "main" (cost = 2, benefit = 40)&nbsp;</span></td>
127+
<td><pre style="display:inline"> </pre><span class="column-entry-yellow"> <a href="s.swift.html#L3">&quot;s.• infix(_:_:)&quot;</a> inlined into &quot;main&quot; (cost = 2, benefit = 40)&nbsp;</span></td>
128128
<td class="column-entry-yellow">main</td>
129129
</tr>
130130

0 commit comments

Comments
 (0)