<br><br><div class="gmail_quote">On Thu, Dec 15, 2011 at 4:45 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div class="im">On Thu, Dec 15, 2011 at 4:25 PM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>yea, agree. </div><div>asan currently (almost) lacks this kind of testing and we will need to add more tests (not just this one). </div></blockquote><div><br></div></div><div>I understand. It's useful for reviewers as well when fixing bugs to include at least the test for that fix, as it helps document exactly what the end result should be. Might be a good place to start fleshing out the test suite.</div>
</div></blockquote><div><br></div><div>For this particular case, what would you say about this test? </div><div><br></div><div><div><div>; RUN: opt < %s -asan -S | FileCheck %s                                                                                                                                                             </div>
<div>target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"                                  </div><div>
target triple = "x86_64-unknown-linux-gnu"                                                                                                                                                          </div><div>@xxx = global i32 0, align 4                                                                                                                                                                        </div>
<div>; If a global is present, __asan_[un]register_globals should be called from                                                                                                                         </div><div>; module ctor/dtor                                                                                                                                                                                  </div>
<div>; CHECK: llvm.global_dtors                                                                                                                                                                          </div><div>; CHECK: llvm.global_ctors                                                                                                                                                                          </div>
<div>; CHECK: asan.module_ctor                                                                                                                                                                           </div><div>; CHECK: call void @__asan_register_globals                                                                                                                                                         </div>
<div>; CHECK: asan.module_dtor                                                                                                                                                                           </div><div>; CHECK: call void @__asan_unregister_globals           </div>
</div></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div class="im">
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>For example, the current asan test suite has a test that invokes objdump and counts how many specific instructions are present in a given function.</div>


<div>FileCheck-like test should be much simpler. </div></blockquote><div><br></div></div><div>Yikes, yea. If the FileCheck tests are proving hard or onerous to write, we can look for better was to construct them, etc., but I'm hopeful.</div>

</div>
</blockquote></div><br>