1 ; This test checks that we are not instrumenting unnecessary globals
2 ; (llvm.metadata, init_array sections, and other llvm internal globals).
3 ; RUN: opt < %s -passes=asan -S | FileCheck %s
5 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6 target triple = "x86_64-unknown-linux-gnu"
8 ; Function Attrs: nounwind uwtable
9 define internal void @_ZL3foov() #0 {
14 @__call_foo = global ptr @_ZL3foov, section ".preinit_array", align 8
15 @__call_foo_2 = global ptr @_ZL3foov, section ".init_array", align 8
16 @__call_foo_3 = global ptr @_ZL3foov, section ".fini_array", align 8
18 ; CHECK-NOT: asan_gen{{.*}}__call_foo
20 ; Function Attrs: nounwind uwtable
21 define i32 @main() #0 {
23 %retval = alloca i32, align 4
24 store i32 0, ptr %retval, align 4
28 @.str_noinst = private unnamed_addr constant [4 x i8] c"aaa\00", section "llvm.metadata"
29 @.str_noinst_prof = private unnamed_addr constant [4 x i8] c"aaa\00", section "__llvm_prf_data"
30 @.str_inst = private unnamed_addr constant [4 x i8] c"aaa\00"
32 ; CHECK-NOT: {{asan_gen.*str_noinst}}
33 ; CHECK-NOT: {{asan_gen.*str_noinst_prof}}
34 ; CHECK: {{asan_gen.*str_inst}}
35 ; CHECK: @asan.module_ctor