[LV] Add test showing debug output for loops with uncountable BTCs.
[llvm-project.git] / bolt / test / X86 / pt_gnu_relro.s
blobff897b96e090970ff1befa9b9809b9e41a20e19f
1 # REQUIRES: system-linux
3 ## Check that BOLT recognizes PT_GNU_RELRO segment and marks respective sections
4 ## accordingly.
6 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o
7 # RUN: ld.lld %t.o -o %t.exe -q --no-relax
8 # RUN: llvm-readelf -We %t.exe | FileCheck --check-prefix=READELF %s
9 # Unfortunately there's no direct way to extract a segment to section mapping
10 # for a given section from readelf. Use the fool-proof way of matching
11 # readelf output line-by-line.
12 # READELF: Program Headers:
13 # READELF-NEXT: Type Offset {{.*}}
14 # READELF-NEXT: PHDR
15 # READELF-NEXT: LOAD
16 # READELF-NEXT: LOAD
17 # READELF-NEXT: LOAD
18 # READELF-NEXT: GNU_RELRO
19 # (GNU_RELRO is segment 4)
21 # READELF: Section to Segment mapping:
22 # READELF: 04 .got
24 # RUN: llvm-bolt %t.exe --relocs -o %t.null -v=1 \
25 # RUN: 2>&1 | FileCheck --check-prefix=BOLT %s
26 # BOLT: BOLT-INFO: marking .got as GNU_RELRO
28 .globl _start
29 .type _start, %function
30 _start:
31 .cfi_startproc
32 jmp *foo@GOTPCREL(%rip)
33 ret
34 .cfi_endproc
35 .size _start, .-_start
37 .globl foo
38 .type foo, %function
39 foo:
40 .cfi_startproc
41 ret
42 .cfi_endproc
43 .size foo, .-foo