1# RUN: llc -o - %s -mtriple=aarch64 -run-pass branch-folder -verify-machineinstrs | FileCheck %s
2# Check that BranchFolding pass is able to hoist a common instruction into a block with a single branch instruction.
3name: func
4tracksRegLiveness: true
5body: |
6  bb.0:
7    ; CHECK-LABEL: name: func
8    ; CHECK-LABEL: bb.0:
9    ; CHECK: $x0 = ADDXri $x0, 1, 0
10    ; CHECK: CBZX $x1, %bb.2
11    liveins: $x0, $x1
12    CBZX $x1, %bb.2
13
14  bb.1:
15    ; CHECK-LABEL: bb.1:
16    ; CHECK-NOT: $x0 = ADDXri $x0, 1, 0
17    liveins: $x0
18    $x0 = ADDXri $x0, 1, 0
19    $x0 = ADDXri $x0, 2, 0
20    RET_ReallyLR implicit $x0
21
22  bb.2:
23    ; CHECK-LABEL: bb.2:
24    ; CHECK-NOT: $x0 = ADDXri $x0, 1, 0
25    liveins: $x0
26    $x0 = ADDXri $x0, 1, 0
27    $x0 = ADDXri $x0, 3, 0
28    RET_ReallyLR implicit $x0
29...
30