<div dir="ltr">I was updating some tests to work with the new pass manager and I ran into something weird with clang/test/Frontend/optimization-remark-with-hotness.c. If you add a comment (or even just an empty line) before an `expected-remark` in the test, it fails and makes the expected diagnostic not appear anymore.<div><br></div><div>Original:</div><div>```</div><div> 56 void bar(int x) {<br>...<br> 63   // expected-remark@+1 {{foo inlined into bar with (cost=always): always inliner (hotness:}}<br> 64   sum += foo(x, x - 2);<br> 65 }<br></div><div>```</div><div><br></div><div>Breaking:</div><div>```</div><div> 56 void bar(int x) {<br>...</div><div> 63   // random comment<br> 64   // expected-remark@+1 {{foo inlined into bar with (cost=always): always inliner (hotness:}}</div><div> 65   sum += foo(x, x - 2);<br> 66 }<br></div><div>```</div><div><br></div><div>with error:</div><div><br></div><div>```</div><div>error: 'remark' diagnostics expected but not seen: <br>  File /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-2/clang/test/Frontend/optimization-remark-with-hotness.c Line 65 (directive at /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-2/clang/test/Frontend/optimization-remark-with-hotness.c:65): foo inlined into bar with (cost=always): always inliner (hotness:<br>1 error generated.<br></div><div>```</div><div><br></div><div>This appears to be the case even if the added text is just a newline, or anywhere else within function bar(). I don't think this has to due with changing anything `-verify` checks for since the remark doesn't appear still even without `-verify`.</div><div><br></div><div>The run that breaks is:</div><div>```</div><div>19 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \<br> 20 // RUN:     optimization-remark-with-hotness.c %s -emit-llvm-only \<br> 21 // RUN:     -fprofile-sample-use=%t-sample.profdata -Rpass=inline \<br> 22 // RUN:     -Rpass-analysis=inline -Rpass-missed=inline \<br> 23 // RUN:     -fdiagnostics-show-hotness -fdiagnostics-hotness-threshold=10 \<br> 24 // RUN:     -verify<br></div><div>```</div><div><br></div><div>The test seems to pass and diagnostic appears if I remove `-fdiagnostics-hotness-threshold=10`. Is it possible that this is intended and extra comments affects hotness?</div><div><br></div><div>Thanks,</div><div>Leonard</div></div>