<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 7, 2013, at 3:14 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I saw that. The original testcase for that code has a .ll input.<br>What's different?<br></blockquote><div><br></div><div>From LLVMContext:</div><div><pre class="fragment" style="font-family: Fixed, monospace; font-size: 13px; border: 1px solid rgb(204, 204, 204); background-color: rgb(245, 245, 245); margin: 4px 8px 4px 2px; padding: 4px 6px; position: static; z-index: auto; "><span class="keywordtype" style="color: rgb(96, 64, 32); ">void</span> <a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1LLVMContext.html#acff246b19234d38be83663af581f05ac" style="color: rgb(0, 0, 255); cursor: pointer; text-decoration: none; ">LLVMContext::emitError</a>(<span class="keywordtype" style="color: rgb(96, 64, 32); ">unsigned</span> LocCookie, <span class="keyword" style="color: rgb(0, 128, 0); ">const</span> <a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1Twine.html" style="color: rgb(0, 0, 255); cursor: pointer; text-decoration: none; ">Twine</a> &ErrorStr) {
<a name="l00116" style="color: rgb(37, 46, 120); "></a>00116   <span class="comment" style="color: rgb(128, 0, 0); ">// If there is no error handler installed, just print the error and exit.</span>
<a name="l00117" style="color: rgb(37, 46, 120); "></a>00117   <span class="keywordflow" style="color: rgb(224, 128, 0); ">if</span> (<a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1LLVMContext.html#aa142c8c536b95dd8e8a243cb67b57a80" style="color: rgb(0, 0, 255); cursor: pointer; text-decoration: none; ">pImpl</a>-><a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1LLVMContextImpl.html#a61ab6c99d591620f008fb9ef7fb2c0df" style="color: rgb(0, 0, 255); cursor: pointer; text-decoration: none; ">InlineAsmDiagHandler</a> == 0) {
<a name="l00118" style="color: rgb(37, 46, 120); "></a>00118     <a class="code" href="http://llvm.org/docs/doxygen/html/namespacellvm.html#ab8e34eca3b0817ef7a127913fbf6d9e4" style="color: rgb(0, 0, 255); cursor: pointer; text-decoration: none; ">errs</a>() << <span class="stringliteral" style="color: rgb(0, 32, 128); ">"error: "</span> << ErrorStr << <span class="stringliteral" style="color: rgb(0, 32, 128); ">"\n"</span>;
<a name="l00119" style="color: rgb(37, 46, 120); "></a>00119     exit(1);
<a name="l00120" style="color: rgb(37, 46, 120); "></a>00120   }
<a name="l00121" style="color: rgb(37, 46, 120); "></a>00121 
<a name="l00122" style="color: rgb(37, 46, 120); "></a>00122   <span class="comment" style="color: rgb(128, 0, 0); ">// If we do have an error handler, we can report the error and keep going.</span>
<a name="l00123" style="color: rgb(37, 46, 120); "></a>00123   <a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1SMDiagnostic.html" style="color: rgb(0, 0, 255); cursor: pointer; text-decoration: none; ">SMDiagnostic</a> Diag(<span class="stringliteral" style="color: rgb(0, 32, 128); ">""</span>, <a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1SourceMgr.html#a346262ff27e71aff626fe6548ef8a777adaf658d40b0b4eb15c0350864c87c2b8" style="color: rgb(0, 0, 255); cursor: pointer; text-decoration: none; ">SourceMgr::DK_Error</a>, ErrorStr.<a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1Twine.html#aaabc8308782f695c3a2cc9dee510ab53" title="str - Return the twine contents as a std::string." style="color: rgb(0, 0, 255); cursor: pointer; text-decoration: none; ">str</a>());
<a name="l00124" style="color: rgb(37, 46, 120); "></a>00124 
<a name="l00125" style="color: rgb(37, 46, 120); "></a>00125   <a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1LLVMContext.html#aa142c8c536b95dd8e8a243cb67b57a80" style="color: rgb(0, 0, 255); cursor: pointer; text-decoration: none; ">pImpl</a>-><a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1LLVMContextImpl.html#a61ab6c99d591620f008fb9ef7fb2c0df" style="color: rgb(0, 0, 255); cursor: pointer; text-decoration: none; ">InlineAsmDiagHandler</a>(Diag, <a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1LLVMContext.html#aa142c8c536b95dd8e8a243cb67b57a80" style="color: rgb(0, 0, 255); cursor: pointer; text-decoration: none; ">pImpl</a>-><a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1LLVMContextImpl.html#ad5dd6cf0ebf4307877651233dee7c0f6" style="color: rgb(0, 0, 255); cursor: pointer; text-decoration: none; ">InlineAsmDiagContext</a>, LocCookie);
<a name="l00126" style="color: rgb(37, 46, 120); "></a>00126 }</pre><div><br></div><div>If we test directly with a .ll file the InlineAsmDiagHandler will be NULL.  Thus, only the first error will be emitted and llc will exit.</div></div><div>Alternatively, if we invoke clang the diagnostic handler will be in place, so we can report multiple errors and then exit, which is in fact the very fix in r180874.</div><div>Hope that makes sense.</div><div><br></div><div> Chad</div><br><blockquote type="cite"><br>-eric<br><br>On Tue, May 7, 2013 at 3:11 PM, Chad Rosier <<a href="mailto:mcrosier@apple.com">mcrosier@apple.com</a>> wrote:<br><blockquote type="cite"><br>On May 7, 2013, at 3:08 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:<br><br><blockquote type="cite">Wait, are you depending upon an error from the backend for this? If<br>so, what's causing us to be unable to check it from a .ll file?<br></blockquote><br>See commit message.  Specifically, the part about needing clang to add the diagnostics handler.<br><br> Chad<br><br><blockquote type="cite"><br>-eric<br><br>On Wed, May 1, 2013 at 12:50 PM, Chad Rosier <<a href="mailto:mcrosier@apple.com">mcrosier@apple.com</a>> wrote:<br><blockquote type="cite">Author: mcrosier<br>Date: Wed May  1 14:50:45 2013<br>New Revision: 180874<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=180874&view=rev">http://llvm.org/viewvc/llvm-project?rev=180874&view=rev</a><br>Log:<br>[inline asm] Add a test case for r180873. Test case needs to be on the clang<br>side because we need an inline asm diagnostics handler in place.  Unfortunately,<br>we emit a .s file because we need to build the SelectionDAG to hit the backend<br>issue.<br><a href="rdar://13446483">rdar://13446483</a><br><br><br>Added:<br>   cfe/trunk/test/CodeGen/arm-asm-diag.c<br><br>Added: cfe/trunk/test/CodeGen/arm-asm-diag.c<br>URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arm-asm-diag.c?rev=180874&view=auto<br>==============================================================================<br>--- cfe/trunk/test/CodeGen/arm-asm-diag.c (added)<br>+++ cfe/trunk/test/CodeGen/arm-asm-diag.c Wed May  1 14:50:45 2013<br>@@ -0,0 +1,23 @@<br>+// REQUIRES: arm-registered-target<br>+// RUN: %clang_cc1 -triple armv7 %s -S -o /dev/null 2>&1 | Filecheck %s<br>+<br>+// rdar://13446483<br>+typedef __attribute__((neon_vector_type(2))) long long int64x2_t;<br>+typedef struct int64x2x4_t {<br>+  int64x2_t val[4];<br>+} int64x2x4_t;<br>+int64x2x4_t t1(const long long a[]) {<br>+  int64x2x4_t r;<br>+  __asm__("vldm %[a], { %q[r0], %q[r1], %q[r2], %q[r3] }"<br>+          : [r0] "=r"(r.val[0]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}<br>+            [r1] "=r"(r.val[1]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}<br>+            [r2] "=r"(r.val[2]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}<br>+            [r3] "=r"(r.val[3])  // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}<br>+          : [a] "r"(a));<br>+  return r;<br>+}<br>+// We should see all four errors, rather than report a fatal error after the first.<br>+// CHECK: error: non-trivial scalar-to-vector conversion, possible invalid constraint for vector type<br>+// CHECK: error: non-trivial scalar-to-vector conversion, possible invalid constraint for vector type<br>+// CHECK: error: non-trivial scalar-to-vector conversion, possible invalid constraint for vector type<br>+// CHECK: error: non-trivial scalar-to-vector conversion, possible invalid constraint for vector type<br><br><br>_______________________________________________<br>cfe-commits mailing list<br>cfe-commits@cs.uiuc.edu<br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br></blockquote></blockquote><br></blockquote></blockquote></div><br></body></html>