<div dir="ltr">On Thu, Apr 18, 2013 at 10:16 AM, Jyotsna Verma <span dir="ltr"><<a href="mailto:jverma@codeaurora.org" target="_blank">jverma@codeaurora.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><div class="im"><p class="MsoNormal"><span style="color:#1f497d">></span>These tests are testing the behavior of our <stdint.h> implementation. It would certainly make sense to make them avoid including a system-provided <stdint.h>. That will probably require somewhat different fixes for each test:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span style="color:#1f497d">></span>I think (perhaps Daniel can confirm) that the c11.c test just wants to test the contents of our own <stdint.h>, so modifying the test's RUN: line so that the system-provided <stdint.h> is not on the search path would suffice.<u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p></div><p class="MsoNormal"><span style="color:#1f497d">I don’t think changing the search path alone will help. As I mentioned earlier, system-provided stdint.h is included from lib/Headers/stdint.h if __STDC_HOSTED__ macro is defined.</span></p>
</div></div></blockquote><div><br></div><div style>It's also conditional on __has_include_next(<stdint.h>), and changing the search path to remove the system headers would make that false.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple"><p class="MsoNormal"><span style="color:#1f497d">I found this piece of code in lib/Frontend/InitPreprocessor.cpp which defines the macro:<u></u><u></u></span></p><p class="MsoNormal">
<span style="color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal" style="margin-left:5.25pt"><span style="color:#1f497d">  if (LangOpts.Freestanding)<u></u><u></u></span></p><p class="MsoNormal" style="margin-left:5.25pt">
<span style="color:#1f497d">    Builder.defineMacro("__STDC_HOSTED__", "0");<u></u><u></u></span></p><p class="MsoNormal" style="margin-left:5.25pt"><span style="color:#1f497d">  else<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">    Builder.defineMacro("__STDC_HOSTED__");<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I think the only way to avoid system stdint.h from being included is to specify –ffreestanding option at the run command.</span></p>
</div></blockquote><div><br></div><div style>Sure, that's another option, and would be fine by me.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple"><div class="im"><p class="MsoNormal"><span style="color:#1f497d">></span>For the cxx11.c test, what we're checking is that our builtin <stdint.h> correctly works around <a href="http://sourceware.org/PR15366" target="_blank">http://sourceware.org/PR15366</a> -- though a better (non-system-dependent) test here would be to craft a "system header" <stdint.h> with the C99-specified behavior and put that in the system headers include path for the test.<span style="color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p></div><pre><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I’m not sure if I understand it correctly. <stdint.h> in lib/Headers defines __STDC_LIMIT_MACROS and  __STDC_CONSTANT_MACROS which are used by system <stdint.h> to define SIZE_MAX which is checked in the test. So, I suppose you want to craft the new header file with these sections. But, what do you mean by putting the file in the system headers include path? Are you proposing to modify the RUN: line to search some temporary location?</span></pre>
</div></blockquote><div style>Exactly, yes. We set up some fake system headers area which contains a stdint.h, and put something inside it which verifies that we have defined those macros before including it.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple"><pre><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I’m planning to XFAIL these two tests for Hexagon until the fix.</span></pre>
</div></blockquote><div style>OK.</div><div style><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div class="im">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thanks,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Jyotsna <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">--<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p></div><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:metafoo@gmail.com" target="_blank">metafoo@gmail.com</a> [mailto:<a href="mailto:metafoo@gmail.com" target="_blank">metafoo@gmail.com</a>] <b>On Behalf Of </b>Richard Smith<br>
<b>Sent:</b> Wednesday, April 17, 2013 2:19 PM<br><b>To:</b> Jyotsna Verma<br><b>Cc:</b> Daniel Dunbar; <a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a> Developers<br><b>Subject:</b> Re: c11.c/cxx11.cpp tests are failing for Hexagon<u></u><u></u></span></p>
</div></div><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Wed, Apr 17, 2013 at 10:39 AM, Jyotsna Verma <<a href="mailto:jverma@codeaurora.org" target="_blank">jverma@codeaurora.org</a>> wrote:<u></u><u></u></p>
<div><div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><p class="MsoNormal">Hi Daniel/Richard,<br><br>I'm seeing c11.c and cxx11.cpp tests failing on Hexagon with these two<br>
changes - r179427 and r179419.<br><br>After your changes, we include stdint.h file (from lib/Headers) in both<br>these tests. However,  if  __STDC_HOSTED__ macro is defined,<br>lib/Headers/stdint.h includes system stdint.h file which includes features.h<br>
-> gnu/stubs-32.h. Since, we don't have stubs-32.h header file available for<br>Hexagon, it causes the tests to fail.<br><br>Please help me understand why the tests were modified to include stdint.h<br>file and how to fix them for Hexagon.<u></u><u></u></p>
</blockquote><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">These tests are testing the behavior of our <stdint.h> implementation. It would certainly make sense to make them avoid including a system-provided <stdint.h>. That will probably require somewhat different fixes for each test:<u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I think (perhaps Daniel can confirm) that the c11.c test just wants to test the contents of our own <stdint.h>, so modifying the test's RUN: line so that the system-provided <stdint.h> is not on the search path would suffice.<u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">For the cxx11.c test, what we're checking is that our builtin <stdint.h> correctly works around <a href="http://sourceware.org/PR15366" target="_blank">http://sourceware.org/PR15366</a> -- though a better (non-system-dependent) test here would be to craft a "system header" <stdint.h> with the C99-specified behavior and put that in the system headers include path for the test.<u></u><u></u></p>
</div></div></div></div></div></div></div></div></blockquote></div><br></div></div>