1 ; RUN: opt < %s -sancov -sanitizer-coverage-level=4 -sanitizer-coverage-trace-pc -sanitizer-coverage-prune-blocks=1 -S | FileCheck %s
2 ; RUN: opt < %s -sancov -sanitizer-coverage-level=4 -sanitizer-coverage-trace-pc -sanitizer-coverage-prune-blocks=0 -S | FileCheck %s --check-prefix=CHECK_NO_PRUNE
3 ; RUN: opt < %s -passes='module(sancov-module),function(sancov-func)' -sanitizer-coverage-level=4 -sanitizer-coverage-trace-pc -sanitizer-coverage-prune-blocks=1 -S | FileCheck %s
4 ; RUN: opt < %s -passes='module(sancov-module),function(sancov-func)' -sanitizer-coverage-level=4 -sanitizer-coverage-trace-pc -sanitizer-coverage-prune-blocks=0 -S | FileCheck %s --check-prefix=CHECK_NO_PRUNE
6 define i32 @foo(i32) #0 {
7 %2 = icmp sgt i32 %0, 0
8 br i1 %2, label %left, label %right
9 ; CHECK: call void @__sanitizer_cov_trace_pc()
11 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
14 %3 = icmp sgt i32 %0, 10
15 br i1 %3, label %left_left, label %left_right
17 ; CHECK-NOT: call void @__sanitizer_cov_trace_pc()
19 ; CHECK_NO_PRUNE-LABEL: left:
20 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
24 ; CHECK-LABEL: left_left:
25 ; CHECK: call void @__sanitizer_cov_trace_pc()
27 ; CHECK_NO_PRUNE-LABEL: left_left:
28 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
32 ; CHECK-LABEL: left_right:
33 ; CHECK: call void @__sanitizer_cov_trace_pc()
35 ; CHECK_NO_PRUNE-LABEL: left_right:
36 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
40 ; CHECK-LABEL: left_join:
41 ; CHECK-NOT: call void @__sanitizer_cov_trace_pc()
43 ; CHECK_NO_PRUNE-LABEL: left_join:
44 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
47 %4 = icmp sgt i32 %0, 10
48 br i1 %4, label %right_left, label %right_right
50 ; CHECK-NOT: call void @__sanitizer_cov_trace_pc()
52 ; CHECK_NO_PRUNE-LABEL: right:
53 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
57 ; CHECK-LABEL: right_left:
58 ; CHECK: call void @__sanitizer_cov_trace_pc()
60 ; CHECK_NO_PRUNE-LABEL: right_left:
61 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
65 ; CHECK-LABEL: right_right:
66 ; CHECK: call void @__sanitizer_cov_trace_pc()
68 ; CHECK_NO_PRUNE-LABEL: right_right:
69 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
73 ; CHECK-LABEL: right_join:
74 ; CHECK-NOT: call void @__sanitizer_cov_trace_pc()
76 ; CHECK_NO_PRUNE-LABEL: right_join:
77 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()
81 ; CHECK-LABEL: finish:
82 ; CHECK-NOT: call void @__sanitizer_cov_trace_pc()
84 ; CHECK_NO_PRUNE-LABEL: finish:
85 ; CHECK_NO_PRUNE: call void @__sanitizer_cov_trace_pc()