llvm.org GIT mirror llvm / 478a4d9
[asan] add a test for instrumenting globals git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146718 91177308-0d34-0410-b5e6-96231b3b80d8 Kostya Serebryany 7 years ago
1 changed file(s) with 20 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt < %s -asan -S | FileCheck %s
1 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"
2 target triple = "x86_64-unknown-linux-gnu"
3 @xxx = global i32 0, align 4
4
5 ; If a global is present, __asan_[un]register_globals should be called from
6 ; module ctor/dtor
7
8 ; CHECK: llvm.global_dtors
9 ; CHECK: llvm.global_ctors
10
11 ; CHECK: define internal void @asan.module_ctor
12 ; CHECK-NOT: ret
13 ; CHECK: call void @__asan_register_globals
14 ; CHECK: ret
15
16 ; CHECK: define internal void @asan.module_dtor
17 ; CHECK-NOT: ret
18 ; CHECK: call void @__asan_unregister_globals
19 ; CHECK: ret