[llvm-commits] [llvm] r146688 - in /llvm/trunk: include/llvm/Transforms/Utils/ModuleUtils.h lib/Transforms/Instrumentation/AddressSanitizer.cpp lib/Transforms/Utils/ModuleUtils.cpp

Kostya Serebryany kcc at google.com
Thu Dec 15 17:14:00 PST 2011


On Thu, Dec 15, 2011 at 4:45 PM, Chandler Carruth <chandlerc at google.com>wrote:

> On Thu, Dec 15, 2011 at 4:25 PM, Kostya Serebryany <kcc at google.com> wrote:
>
>> yea, agree.
>> asan currently (almost) lacks this kind of testing and we will need to
>> add more tests (not just this one).
>>
>
> 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.
>

For this particular case, what would you say about this test?

; RUN: opt < %s -asan -S | FileCheck %s


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"

target triple = "x86_64-unknown-linux-gnu"


@xxx = global i32 0, align 4


; If a global is present, __asan_[un]register_globals should be called from


; module ctor/dtor


; CHECK: llvm.global_dtors


; CHECK: llvm.global_ctors


; CHECK: asan.module_ctor


; CHECK: call void @__asan_register_globals


; CHECK: asan.module_dtor


; CHECK: call void @__asan_unregister_globals




>
> 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.
>> FileCheck-like test should be much simpler.
>>
>
> 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111215/461762c7/attachment.html>


More information about the llvm-commits mailing list