xref: /llvm-project/bolt/test/X86/fatal-error.s (revision 11791ae7b0b05b8bd8d806331ff51da618912cf8)
1## Tests whether llvm-bolt will correctly exit with error code and printing
2## fatal error message in case one occurs. Here we test opening a function
3## reordering file that does not exist.
4
5# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
6# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
7# RUN: not llvm-bolt %t.exe -o %t.null \
8# RUN:   --reorder-blocks=normal --reorder-functions=user \
9# RUN:   --function-order=/DOES/NOT/EXIST  2>&1 \
10# RUN:   | FileCheck --check-prefix=CHECK %s
11
12# CHECK: FATAL BOLT-ERROR: Ordered functions file "/DOES/NOT/EXIST" can't be opened
13
14# Sample function reordering input, based off function-order-lite.s
15  .globl main
16  .type main, %function
17main:
18	.cfi_startproc
19.LBB06:
20	callq	func_a
21	retq
22	.cfi_endproc
23.size main, .-main
24
25  .globl func_a
26  .type func_a, %function
27func_a:
28	.cfi_startproc
29	retq
30	.cfi_endproc
31.size func_a, .-func_a
32
33  .globl func_b
34  .type func_b, %function
35func_b:
36	.cfi_startproc
37	retq
38	.cfi_endproc
39.size func_b, .-func_b
40