Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / Instrumentation / SanitizerCoverage / postdominator_check.ll
blob63b66008070958820a56c681ca56f7551e96266a
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()
11 left:
12   %3 = icmp sgt i32 %0, 10
13   br i1 %3, label %left_left, label %left_right
14 ; CHECK-LABEL: left:
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()
20 left_left:
21   br label %left_join
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()
28 left_right:
29   br label %left_join
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()
36 left_join:
37   br label %finish
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()
44 right:
45   %4 = icmp sgt i32 %0, 10
46   br i1 %4, label %right_left, label %right_right
47 ; CHECK-LABEL: 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()
53 right_left:
54   br label %right_join
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()
61 right_right:
62   br label %right_join
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()
69 right_join:
70   br label %finish
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()
77 finish:
78   ret i32 %0
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()