1 # REQUIRES: system-linux
3 ## Check that BOLT correctly reads ORC unwind information used by Linux Kernel.
5 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
6 # RUN: %clang %cflags %t.o -o %t.exe
8 # RUN: llvm-bolt %t.exe --print-normalized --dump-orc --print-orc -o %t.out \
11 # CHECK: BOLT-INFO: ORC unwind information:
12 # CHECK-NEXT: {sp: 8, bp: 0, info: 0x5}: _start
13 # CHECK-NEXT: {sp: 0, bp: 0, info: 0x0}: _start
14 # CHECK-NEXT: {sp: 8, bp: 0, info: 0x5}: foo
15 # CHECK-NEXT: {sp: 16, bp: -16, info: 0x15}: foo
16 # CHECK-NEXT: {sp: 16, bp: -16, info: 0x14}: foo
17 # CHECK-NEXT: {sp: 8, bp: 0, info: 0x5}: foo
18 # CHECK-NEXT: {sp: 0, bp: 0, info: 0x0}: bar
22 .type _start, %function
27 # CHECK: callq foo # ORC: {sp: 8, bp: 0, info: 0x5}
30 .size _start, .-_start
37 # CHECK: pushq %rbp # ORC: {sp: 8, bp: 0, info: 0x5}
40 # CHECK: movq %rsp, %rbp # ORC: {sp: 16, bp: -16, info: 0x15}
43 # CHECK: popq %rbp # ORC: {sp: 16, bp: -16, info: 0x14}
46 # CHECK: retq # ORC: {sp: 8, bp: 0, info: 0x5}
53 # Same ORC info propagated from foo above.
54 # CHECK: retq # ORC: {sp: 8, bp: 0, info: 0x5}
59 .section .orc_unwind,"a",@progbits
61 .section .orc_unwind_ip,"a",@progbits
69 .section .orc_unwind_ip
76 .section .orc_unwind_ip
84 .section .orc_unwind_ip
91 .section .orc_unwind_ip
98 .section .orc_unwind_ip
105 .section .orc_unwind_ip
112 .section .orc_unwind_ip
115 # Fake Linux Kernel sections
116 .section __ksymtab,"a",@progbits
117 .section __ksymtab_gpl,"a",@progbits
118 .section .pci_fixup,"a",@progbits