1; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs=branch-folder -verify-machineinstrs -o /dev/null 2>&1 \
2; RUN:   | FileCheck %s -check-prefix=PRINT-BRANCH-FOLD
3; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs -verify-machineinstrs -o /dev/null 2>&1 \
4; RUN:   | FileCheck %s -check-prefix=PRINT
5; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs= -verify-machineinstrs -o /dev/null 2>&1 \
6; RUN:   | FileCheck %s -check-prefix=PRINT
7
8; Note: -verify-machineinstrs is used in order to make this test compatible with EXPENSIVE_CHECKS.
9
10define i64 @foo(i64 %a, i64 %b) nounwind {
11; PRINT-BRANCH-FOLD: -branch-folder -machineverifier -machineinstr-printer
12; PRINT-BRANCH-FOLD: Control Flow Optimizer
13; PRINT-BRANCH-FOLD-NEXT: Verify generated machine code
14; PRINT-BRANCH-FOLD-NEXT: MachineFunction Printer
15; PRINT-BRANCH-FOLD: Machine code for function foo:
16
17; PRINT: -branch-folder -machineinstr-printer
18; PRINT: Control Flow Optimizer
19; PRINT-NEXT: MachineFunction Printer
20; PRINT-NEXT: Verify generated machine code
21; PRINT: Machine code for function foo:
22
23  %c = add i64 %a, %b
24  %d = trunc i64 %c to i32
25  %e = zext i32 %d to i64
26  ret i64 %e
27}
28