brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 8a87940 Raw
48 lines · plain
1; This test checks that we are not instrumenting sanitizer code.2; RUN: opt < %s -passes=asan -S | FileCheck %s3 4target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"5target triple = "x86_64-unknown-linux-gnu"6 7; Function with sanitize_address is instrumented.8; Function Attrs: nounwind uwtable9define void @instr_sa(ptr %a) sanitize_address {10entry:11  %tmp1 = load i32, ptr %a, align 412  %tmp2 = add i32 %tmp1,  113  store i32 %tmp2, ptr %a, align 414  ret void15}16 17; CHECK-LABEL: @instr_sa18; CHECK: call void @__asan_report_load19 20 21; Function with disable_sanitizer_instrumentation is not instrumented.22; Function Attrs: nounwind uwtable23define void @noinstr_dsi(ptr %a) disable_sanitizer_instrumentation {24entry:25  %tmp1 = load i32, ptr %a, align 426  %tmp2 = add i32 %tmp1,  127  store i32 %tmp2, ptr %a, align 428  ret void29}30 31; CHECK-LABEL: @noinstr_dsi32; CHECK-NOT: call void @__asan_report_load33 34 35; disable_sanitizer_instrumentation takes precedence over sanitize_address.36; Function Attrs: nounwind uwtable37define void @noinstr_dsi_sa(ptr %a) disable_sanitizer_instrumentation sanitize_address {38entry:39  %tmp1 = load i32, ptr %a, align 440  %tmp2 = add i32 %tmp1,  141  store i32 %tmp2, ptr %a, align 442  ret void43}44 45; CHECK-LABEL: @noinstr_dsi_sa46; CHECK-NOT: call void @__asan_report_load47 48