Recommit "rL366894: [yaml2obj] - Allow custom fields for the SHT_UNDEF sections."
[llvm-complete.git] / test / Instrumentation / SanitizerCoverage / backedge-pruning.ll
blob103198311279b79e10cf25879715cb27b3836c28
1 ; Test -sanitizer-coverage-trace-compares=1 and how it prunes backedge compares.
2 ; RUN: opt < %s -sancov -sanitizer-coverage-level=1 -sanitizer-coverage-trace-compares=1  -sanitizer-coverage-prune-blocks=1 -S | FileCheck %s --check-prefix=PRUNE
3 ; RUN: opt < %s -sancov -sanitizer-coverage-level=1 -sanitizer-coverage-trace-compares=1  -sanitizer-coverage-prune-blocks=0 -S | FileCheck %s --check-prefix=NOPRUNE
5 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"
6 target triple = "x86_64-unknown-linux-gnu"
8 define dso_local void @foo(i32* nocapture readnone %a, i32 %n) local_unnamed_addr {
9 entry:
10   br label %do.body
12 do.body:
13   %i.0 = phi i32 [ 0, %entry ], [ %inc, %do.body ]
14   tail call void (...) @bar()
15   %inc = add nuw nsw i32 %i.0, 1
16   %cmp = icmp slt i32 %inc, %n
17 ;PRUNE-LABEL: foo
18 ;PRUNE-NOT: __sanitizer_cov_trace_cmp4
19 ;PRUNE: ret void
21 ;NOPRUNE-LABEL: foo
22 ;NOPRUNE: call void @__sanitizer_cov_trace_cmp4
23 ;NOPRUNE-NEXT: icmp
24 ;NOPRUNE: ret void
26   br i1 %cmp, label %do.body, label %do.end
28 do.end:
29   ret void
32 declare dso_local void @bar(...) local_unnamed_addr