• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; This is a smoke test of function reordering.
2
3; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \
4; RUN:    -sz-seed=1 -reorder-functions \
5; RUN:    | FileCheck %s --check-prefix=DEFAULTWINDOWSIZE
6; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \
7; RUN:    -sz-seed=1 -reorder-functions \
8; RUN:    | FileCheck %s --check-prefix=DEFAULTWINDOWSIZE
9
10
11; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \
12; RUN:    -sz-seed=1 -reorder-functions \
13; RUN:    -reorder-functions-window-size=1 \
14; RUN:    | FileCheck %s --check-prefix=WINDOWSIZE1
15; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \
16; RUN:    -sz-seed=1 -reorder-functions \
17; RUN:    -reorder-functions-window-size=1 \
18; RUN:    | FileCheck %s --check-prefix=WINDOWSIZE1
19
20
21; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \
22; RUN:    -sz-seed=1 -reorder-functions \
23; RUN:    -threads=0 \
24; RUN:    | FileCheck %s --check-prefix=SEQUENTIAL
25; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \
26; RUN:    -sz-seed=1 -reorder-functions \
27; RUN:    -threads=0 \
28; RUN:    | FileCheck %s --check-prefix=SEQUENTIAL
29
30
31; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \
32; RUN:    -sz-seed=1 -reorder-functions \
33; RUN:    -reorder-functions-window-size=0xffffffff \
34; RUN:    | FileCheck %s --check-prefix=WINDOWSIZEMAX
35; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \
36; RUN:    -sz-seed=1 -reorder-functions \
37; RUN:    -reorder-functions-window-size=0xffffffff \
38; RUN:    | FileCheck %s --check-prefix=WINDOWSIZEMAX
39
40define internal void @func1() {
41  ret void
42}
43
44define internal void @func2() {
45  ret void
46}
47
48define internal void @func3() {
49  ret void
50}
51
52define internal void @func4() {
53  ret void
54}
55
56define internal void @func5() {
57  ret void
58}
59
60define internal void @func6() {
61  ret void
62}
63
64; DEFAULTWINDOWSIZE-LABEL: func1
65; DEFAULTWINDOWSIZE-LABEL: func4
66; DEFAULTWINDOWSIZE-LABEL: func5
67; DEFAULTWINDOWSIZE-LABEL: func2
68; DEFAULTWINDOWSIZE-LABEL: func6
69; DEFAULTWINDOWSIZE-LABEL: func3
70
71; WINDOWSIZE1-LABEL: func1
72; WINDOWSIZE1-LABEL: func2
73; WINDOWSIZE1-LABEL: func3
74; WINDOWSIZE1-LABEL: func4
75; WINDOWSIZE1-LABEL: func5
76; WINDOWSIZE1-LABEL: func6
77
78; SEQUENTIAL-LABEL: func1
79; SEQUENTIAL-LABEL: func2
80; SEQUENTIAL-LABEL: func3
81; SEQUENTIAL-LABEL: func4
82; SEQUENTIAL-LABEL: func5
83; SEQUENTIAL-LABEL: func6
84
85; WINDOWSIZEMAX-LABEL: func1
86; WINDOWSIZEMAX-LABEL: func4
87; WINDOWSIZEMAX-LABEL: func5
88; WINDOWSIZEMAX-LABEL: func2
89; WINDOWSIZEMAX-LABEL: func6
90; WINDOWSIZEMAX-LABEL: func3
91