Recommit "rL366894: [yaml2obj] - Allow custom fields for the SHT_UNDEF sections."
[llvm-complete.git] / test / Instrumentation / SanitizerCoverage / div-tracing.ll
blob0de2ddf68e7591f7421b54de379fc709c6b06fd7
1 ; Test -sanitizer-coverage-trace-divs=1
2 ; RUN: opt < %s -sancov -sanitizer-coverage-level=1 -sanitizer-coverage-trace-divs=1  -S | FileCheck %s
4 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"
5 target triple = "x86_64-unknown-linux-gnu"
7 define i32 @div_a_b(i32 %a, i32 %b) local_unnamed_addr {
8 entry:
9   %div = sdiv i32 %a, %b
10   ret i32 %div
13 ; CHECK-LABEL: @div_a_b
14 ; CHECK: call void @__sanitizer_cov_trace_div4(i32 %b)
15 ; CHECK: ret
18 define i32 @div_a_10(i32 %a) local_unnamed_addr {
19 entry:
20   %div = sdiv i32 %a, 10
21   ret i32 %div
24 ; CHECK-LABEL: @div_a_10
25 ; CHECK-NOT: __sanitizer_cov_trace_div
26 ; CHECK: ret
28 define i64 @div_a_b_64(i64 %a, i64 %b) local_unnamed_addr {
29 entry:
30   %div = udiv i64 %a, %b
31   ret i64 %div
34 ; CHECK-LABEL: @div_a_b_64
35 ; CHECK: call void @__sanitizer_cov_trace_div8(i64 %b)
36 ; CHECK: ret