Thanks, committed r169439. <br><br><div class="gmail_quote">On Wed, Dec 5, 2012 at 2:24 PM, Kaylor, Andrew <span dir="ltr"><<a href="mailto:andrew.kaylor@intel.com" target="_blank">andrew.kaylor@intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Look good.<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">-Andy<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 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:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>]
<b>On Behalf Of </b>Akira Hatanaka<br>
<b>Sent:</b> Tuesday, December 04, 2012 1:33 PM<br>
<b>To:</b> LLVM Developers Mailing List<br>
<b>Subject:</b> [LLVMdev] [PATCH][Review request] MappedMemoryTest: Prevent tests from running if read flag is not set.<u></u><u></u></span></p>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">The attached patch prevents MappedMemoryTest.BasicWrite and MappedMemoryTest.MultipleWrite (both in unittests/Support/MemoryTest.cpp) from running if the correct protection flags for memory allocation are not
 set. Without this patch, the two tests fail when I run "make check-all" on a mips octeon board.<br>
<br>
The problem with the current code is that it allocates a block of memory without setting the read flag. This results in a segfault at line 115 of MemoryTest.cpp where it reads the allocated block to check whether 1 has been written into the first word of the
 block. This patch fixes this, and checks that both read and write flags are set.
<br>
<br>
<br>
unittests/Support/MemoryTest.cpp (line 101)<br>
<br>
TEST_P(MappedMemoryTest, BasicWrite) {<br>
  // This test applies only to writeable combinations<br>
  if (Flags && !(Flags & Memory::MF_WRITE))<br>
    return;<br>
<br>
  MemoryBlock M1 = Memory::allocateMappedMemory(sizeof(int), 0, Flags, EC);<br>
  ...<br>
  int *a = (int*)M1.base();<br>
  *a = 1;<br>
  EXPECT_EQ(1, *a); // This line segfaults.<br>
  ...<br>
}<u></u><u></u></p>
</div></div></div>
</div>

</blockquote></div><br>