1 ; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=4 -sanitizer-coverage-trace-pc -sanitizer-coverage-prune-blocks=1 -S | FileCheck %s
2 ; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=4 -sanitizer-coverage-trace-pc -sanitizer-coverage-prune-blocks=0 -S | FileCheck %s --check-prefix=CHECK_NO_PRUNE
4 define i32 @foo(i32) #0 {
5 %2 = icmp sgt i32 %0, 0
6 br i1 %2, label %left, label %right
7 ; CHECK: call void @__sanitizer_cov_trace_pc()
9 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
12 %3 = icmp sgt i32 %0, 10
13 br i1 %3, label %left_left, label %left_right
15 ; CHECK-NOT: call void @__sanitizer_cov_trace_pc()
17 ; CHECK_NO_PRUNE-LABEL: left:
18 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
22 ; CHECK-LABEL: left_left:
23 ; CHECK: call void @__sanitizer_cov_trace_pc()
25 ; CHECK_NO_PRUNE-LABEL: left_left:
26 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
30 ; CHECK-LABEL: left_right:
31 ; CHECK: call void @__sanitizer_cov_trace_pc()
33 ; CHECK_NO_PRUNE-LABEL: left_right:
34 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
38 ; CHECK-LABEL: left_join:
39 ; CHECK-NOT: call void @__sanitizer_cov_trace_pc()
41 ; CHECK_NO_PRUNE-LABEL: left_join:
42 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
45 %4 = icmp sgt i32 %0, 10
46 br i1 %4, label %right_left, label %right_right
48 ; CHECK-NOT: call void @__sanitizer_cov_trace_pc()
50 ; CHECK_NO_PRUNE-LABEL: right:
51 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
55 ; CHECK-LABEL: right_left:
56 ; CHECK: call void @__sanitizer_cov_trace_pc()
58 ; CHECK_NO_PRUNE-LABEL: right_left:
59 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
63 ; CHECK-LABEL: right_right:
64 ; CHECK: call void @__sanitizer_cov_trace_pc()
66 ; CHECK_NO_PRUNE-LABEL: right_right:
67 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
71 ; CHECK-LABEL: right_join:
72 ; CHECK-NOT: call void @__sanitizer_cov_trace_pc()
74 ; CHECK_NO_PRUNE-LABEL: right_join:
75 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
79 ; CHECK-LABEL: finish:
80 ; CHECK-NOT: call void @__sanitizer_cov_trace_pc()
82 ; CHECK_NO_PRUNE-LABEL: finish:
83 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()