1; REQUIRES: asserts
2; RUN: llc %s -debug-pass=Structure -verify-machineinstrs \
3; RUN: --debug-only=machine-outliner -enable-machine-outliner=always \
4; RUN: -mtriple arm64---- -o /dev/null 2>&1 \
5; RUN: | FileCheck %s -check-prefix=ALWAYS
6
7; RUN: llc %s -debug-pass=Structure -verify-machineinstrs \
8; RUN: --debug-only=machine-outliner -enable-machine-outliner \
9; RUN: -mtriple arm64---- -o /dev/null 2>&1 \
10; RUN: | FileCheck %s -check-prefix=ENABLE
11
12; RUN: llc %s -debug-pass=Structure -verify-machineinstrs \
13; RUN: -enable-machine-outliner=never -mtriple arm64---- -o /dev/null 2>&1 \
14; RUN: | FileCheck %s -check-prefix=NEVER
15
16; RUN: llc %s -debug-pass=Structure -verify-machineinstrs \
17; RUN: --debug-only=machine-outliner -mtriple arm64---- -o /dev/null 2>&1 \
18; RUN: | FileCheck %s -check-prefix=NOT-ADDED
19
20; RUN: llc %s -O=0 -debug-pass=Structure -verify-machineinstrs \
21; RUN: -mtriple arm64---- -o /dev/null 2>&1 \
22; RUN: | FileCheck %s -check-prefix=OPTNONE
23
24; Make sure that the outliner is added to the pass pipeline only when the
25; appropriate flags/settings are set. Make sure it isn't added otherwise.
26;
27; Cases where it should be added:
28;  * -enable-machine-outliner
29;  * -enable-machine-outliner=always
30;  * -enable-machine-outliner is not passed (AArch64 supports
31;     target-default outlining)
32;
33; Cases where it should not be added:
34;  * -O0 or equivalent
35;  * -enable-machine-outliner=never is passed
36
37; ALWAYS: Machine Outliner
38; ALWAYS: Machine Outliner: Running on all functions
39; ENABLE: Machine Outliner
40; ENABLE: Machine Outliner: Running on all functions
41; NEVER-NOT: Machine Outliner
42; NOT-ADDED: Machine Outliner
43; NOT-ADDED: Machine Outliner: Running on target-default functions
44; OPTNONE-NOT: Machine Outliner
45
46define void @foo() {
47  ret void;
48}
49
50