xref: /llvm-project/llvm/test/Instrumentation/AddressSanitizer/do-not-instrument-sanitizers.ll (revision 855fe35064674c4601ea9c659a015cacdcec9f63)
1; This test checks that we are not instrumenting sanitizer code.
2; RUN: opt < %s -passes=asan -S | FileCheck %s
3
4target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5target triple = "x86_64-unknown-linux-gnu"
6
7; Function Attrs: nounwind uwtable
8define void @__asan_default_options(ptr %a) sanitize_address {
9entry:
10  %tmp1 = load i32, ptr %a, align 4
11  %tmp2 = add i32 %tmp1,  1
12  store i32 %tmp2, ptr %a, align 4
13  ret void
14}
15
16; CHECK-NOT: call void @__asan_report_load
17
18; Function Attrs: nounwind uwtable
19define i32 @main() #0 {
20entry:
21  ret i32 0
22}
23
24; CHECK: declare void @__asan_init()
25