<div dir="ltr"><div>I think any test update should be to change the patterns to include the start and end of a symbol name, if it is the symbol name, or some other kind of delimiter, depending on the context. The same goes for any positive test cases, to avoid any spurious passes.<br></div><div><br></div><div>Example:</div><div><br></div><div><span style="font-family:monospace,monospace"># CHECK: Symbols [</span></div><div><span style="font-family:monospace,monospace"># CHECK-NOT: foo</span></div><div><span style="font-family:monospace,monospace"># CHECK-NOT: bar</span></div><div><span style="font-family:monospace,monospace"># CHECK-NOT: ]</span></div><div><span style="font-family:monospace,monospace"><br></span></div><div><span style="font-family:monospace,monospace"><font face="arial,helvetica,sans-serif">could become:</font></span></div><div><span style="font-family:monospace,monospace"><font face="arial,helvetica,sans-serif"><br></font></span></div><div><span style="font-family:monospace,monospace"></span>
<div><span style="font-family:monospace,monospace"># CHECK: Symbols [</span></div><div><span style="font-family:monospace,monospace"># CHECK-NOT: {{ }}foo (<br></span></div><div><span style="font-family:monospace,monospace"># CHECK-NOT: {{ }}bar (<br></span></div><div><span style="font-family:monospace,monospace"># CHECK-NOT: ]</span></div><div><span style="font-family:monospace,monospace"><br></span></div><div><span style="font-family:monospace,monospace"><font face="arial,helvetica,sans-serif">James</font><br></span></div>
</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 30 Mar 2019 at 04:06, Don Hinton via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">btw, if that patch does work for you, perhaps you or someone else could land it. I'm packing right now and will be on the road for a few days, or else I'd do it myself.<div><br></div><div>hth...</div><div>don</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 29, 2019 at 8:50 PM Don Hinton <<a href="mailto:hintonda@gmail.com" target="_blank">hintonda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">You can try this patch:<div><br></div><div><div>$ git diff</div><div>diff --git a/llvm/test/tools/llvm-objcopy/ELF/regex.test b/llvm/test/tools/llvm-objcopy/ELF/regex.test</div><div>index 6fa590b5dc5..04438143a6a 100644</div><div>--- a/llvm/test/tools/llvm-objcopy/ELF/regex.test</div><div>+++ b/llvm/test/tools/llvm-objcopy/ELF/regex.test</div><div>@@ -47,14 +47,14 @@ Symbols:</div><div> Value: 0x1010</div><div> Size: 8</div><div><br></div><div>-#REGEX1-NOT: foobaz</div><div>-#REGEX1-NOT: bar</div><div>-#REGEX1-NOT: rebar</div><div>+#REGEX1-NOT: {{Name: *foobaz}}</div><div>+#REGEX1-NOT: {{Name: *bar}}</div><div>+#REGEX1-NOT: {{Name: *rebar}}</div><div><br></div><div>-#REGEX2-NOT: foobaz</div><div>-#REGEX2: bar</div><div>-#REGEX2-NOT: rebar</div><div>+#REGEX2-NOT: {{Name: *foobaz}}</div><div>+#REGEX2: {{Name: *bar}}</div><div>+#REGEX2-NOT: {{Name: *rebar}}</div><div><br></div><div>-#REGEX3: foobaz</div><div>-#REGEX3: bar</div><div>-#REGEX3: rebar</div><div>+#REGEX3: {{Name: *foobaz}}</div><div>+#REGEX3: {{Name: *bar}}</div><div>+#REGEX3: {{Name: *rebar}}</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 29, 2019 at 12:55 PM via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_233096360130027512gmail-m_-2574769759690554365gmail-m_6488225888641663740WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">For ignore-undefined-symbols.s, the simplest fix ought to be to have the llvm-mc RUN line take the source from <stdin>:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New";color:rgb(31,73,125)"># RUN: llvm-mc –filetype=obj –triple=x86_64-pc-linux %s –o %t.o –g<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">becomes<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New";color:rgb(31,73,125)"># RUN: llvm-mc –filetype=obj –triple=x86_64-pc-linux</span><b><span style="font-size:11pt;font-family:"Courier New";color:red"> <</span></b><span style="font-size:11pt;font-family:"Courier New";color:red">
</span><span style="font-size:11pt;font-family:"Courier New";color:rgb(31,73,125)">%s –o %t.o –g<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">But in this case, llvm-symbolizer still prints the file as $CWD/<stdin> which seems like its own separate bug.<u></u><u></u></span></p>
<p class="MsoNormal"><a name="m_233096360130027512_m_-2574769759690554365_m_6488225888641663740__MailEndCompose"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">--paulr<u></u><u></u></span></a></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<div style="border-color:currentcolor currentcolor currentcolor blue;border-style:none none none solid;border-width:medium medium medium 1.5pt;padding:0in 0in 0in 4pt">
<div>
<div style="border-color:rgb(181,196,223) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Tahoma,sans-serif">From:</span></b><span style="font-size:10pt;font-family:Tahoma,sans-serif"> llvm-dev [mailto:<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>]
<b>On Behalf Of </b>Jordan Rupprecht via llvm-dev<br>
<b>Sent:</b> Friday, March 29, 2019 1:13 PM<br>
<b>To:</b> Csaba Raduly<br>
<b>Cc:</b> llvm-dev<br>
<b>Subject:</b> Re: [llvm-dev] Test failure due to file path<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">True, it could probably skip the filename printed at the beginning of readobj with something like this:<u></u><u></u></p>
<div>
<pre style="outline:currentcolor none medium" id="gmail-m_233096360130027512gmail-m_-2574769759690554365gmail-m_6488225888641663740m_6275910883927179878gmail-c1"><span class="gmail-m_233096360130027512gmail-m_-2574769759690554365gmail-m_6488225888641663740m6275910883927179878gmail-stx-line"><span style="font-size:13.5pt;color:black">#REGEX1: Symbols [#REGEX1-NOT: foobaz<u></u><u></u></span></span></pre>
<pre><span class="gmail-m_233096360130027512gmail-m_-2574769759690554365gmail-m_6488225888641663740m6275910883927179878gmail-stx-line"><span style="font-size:13.5pt;color:black">#REGEX1-NOT: bar<u></u><u></u></span></span></pre>
<pre><span class="gmail-m_233096360130027512gmail-m_-2574769759690554365gmail-m_6488225888641663740m6275910883927179878gmail-stx-line"><span style="font-size:13.5pt;color:black">#REGEX1-NOT: rebar<u></u><u></u></span></span></pre>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">Mind contributing a patch? :)<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Fri, Mar 29, 2019 at 9:53 AM Csaba Raduly via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Hi all,<br>
<br>
The following tests fail because my username (csabaraduly) contains "bar" :<br>
<br>
********************<br>
FAIL: LLVM :: tools/llvm-objcopy/ELF/regex.test (47099 of 50832)<br>
******************** TEST 'LLVM :: tools/llvm-objcopy/ELF/regex.test'<br>
FAILED ********************<br>
Script:<br>
--<br>
: 'RUN: at line 1';<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/bin/yaml2obj<br>
/home/csabaraduly/wk/LLVM-git/llvm/test/tools/llvm-objcopy/ELF/regex.test<br>
> /home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp<br>
: 'RUN: at line 4';<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/bin/llvm-objcopy<br>
--discard-all --regex -K 'ba'<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp2<br>
: 'RUN: at line 5';<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/bin/llvm-readobj<br>
--symbols /home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp2<br>
| /home/csabaraduly/wk/LLVM-git/__build_release_99/bin/FileCheck<br>
/home/csabaraduly/wk/LLVM-git/llvm/test/tools/llvm-objcopy/ELF/regex.test<br>
--check-prefix=REGEX1<br>
: 'RUN: at line 8';<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/bin/llvm-objcopy<br>
--discard-all --regex -K 'ba.*'<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp3<br>
: 'RUN: at line 9';<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/bin/llvm-readobj<br>
--symbols /home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp3<br>
| /home/csabaraduly/wk/LLVM-git/__build_release_99/bin/FileCheck<br>
/home/csabaraduly/wk/LLVM-git/llvm/test/tools/llvm-objcopy/ELF/regex.test<br>
--check-prefix=REGEX2<br>
: 'RUN: at line 12';<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/bin/llvm-objcopy<br>
--discard-all --regex -K '.*ba.*'<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp4<br>
: 'RUN: at line 13';<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/bin/llvm-readobj<br>
--symbols /home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp4<br>
| /home/csabaraduly/wk/LLVM-git/__build_release_99/bin/FileCheck<br>
/home/csabaraduly/wk/LLVM-git/llvm/test/tools/llvm-objcopy/ELF/regex.test<br>
--check-prefix=REGEX3<br>
: 'RUN: at line 16';<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/bin/llvm-objcopy<br>
--discard-all --regex -K '^([a-z]+)*ba.*$'<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp5<br>
: 'RUN: at line 17'; cmp<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp4<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp5<br>
--<br>
Exit Code: 1<br>
<br>
Command Output (stderr):<br>
--<br>
/home/csabaraduly/wk/LLVM-git/llvm/test/tools/llvm-objcopy/ELF/regex.test:51:14:<br>
error: REGEX1-NOT: excluded string found in input<br>
#REGEX1-NOT: bar<br>
^<br>
<stdin>:2:16: note: found here<br>
File: /home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-objcopy/ELF/Output/regex.test.tmp2<br>
^~~<br>
<br>
<br>
<br>
<br>
********************<br>
FAIL: LLVM :: tools/llvm-symbolizer/ignore-undefined-symbols.s (47626 of 50832)<br>
******************** TEST 'LLVM ::<br>
tools/llvm-symbolizer/ignore-undefined-symbols.s' FAILED<br>
********************<br>
Script:<br>
--<br>
: 'RUN: at line 2';<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/bin/llvm-mc<br>
--filetype=obj --triple=x86_64-pc-linux<br>
/home/csabaraduly/wk/LLVM-git/llvm/test/tools/llvm-symbolizer/ignore-undefined-symbols.s<br>
-o /home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-symbolizer/Output/ignore-undefined-symbols.s.tmp.o<br>
-g<br>
: 'RUN: at line 3';<br>
/home/csabaraduly/wk/LLVM-git/__build_release_99/bin/llvm-symbolizer<br>
--obj=/home/csabaraduly/wk/LLVM-git/__build_release_99/test/tools/llvm-symbolizer/Output/ignore-undefined-symbols.s.tmp.o<br>
0 | /home/csabaraduly/wk/LLVM-git/__build_release_99/bin/FileCheck<br>
/home/csabaraduly/wk/LLVM-git/llvm/test/tools/llvm-symbolizer/ignore-undefined-symbols.s<br>
--implicit-check-not=bar<br>
--<br>
Exit Code: 1<br>
<br>
Command Output (stderr):<br>
--<br>
command line:1:22: error: CHECK-NOT: excluded string found in input<br>
-implicit-check-not='bar'<br>
^<br>
<stdin>:2:10: note: found here<br>
/home/csabaraduly/wk/LLVM-git/llvm/test/tools/llvm-symbolizer/ignore-undefined-symbols.s:12:0<br>
^~~<br>
<br>
Maybe "bar" should be replaced with something less likely to appear<br>
accidentally in a file path, e.g. rumpelstiltskin :)<br>
<br>
Csaba<br>
-- <br>
You can get very substantial performance improvements<br>
by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler<br>
So if you're looking for a completely portable, 100% standards-conformat way<br>
to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK)<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>