brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · eedcc4e Raw
59 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o3# RUN: echo "SECTIONS { .text : { *(.text.1) } }" > %t.script4 5## Check we do not report orphans by default even with -verbose.6# RUN: ld.lld -shared -o %t.out --script %t.script %t.o 2>&1 -verbose \7# RUN:   | FileCheck %s --check-prefix=DEFAULT8# DEFAULT-NOT: placed9 10## Check --orphan-handling=place has the same behavior as default.11# RUN: ld.lld -shared --orphan-handling=place -o %t.out --script %t.script \12# RUN:   %t.o 2>&1 -verbose  -error-limit=0 | FileCheck %s --check-prefix=DEFAULT13 14## Check --orphan-handling=error or =warn do not report errors if no linker15## script is used.16# RUN: ld.lld -shared -orphan-handling=error -o /dev/null %t.o 2>&1 | count 017# RUN: ld.lld -shared -orphan-handling=warn -o /dev/null %t.o 2>&1 | count 018# RUN: ld.lld -r -orphan-handling=error -o /dev/null %t.o 2>&1 | count 019# RUN: ld.lld -r -orphan-handling=warn -o /dev/null %t.o 2>&1 | count 020 21## Check --orphan-handling=error reports errors about orphans.22# RUN: not ld.lld --orphan-handling=error -o /dev/null -T %t.script \23# RUN:   %t.o 2>&1 | FileCheck %s --check-prefixes=COMMON,SYMTAB24 25## --strip-all discards .strtab and .symtab sections. Don't error about them.26# RUN: not ld.lld --orphan-handling=error --strip-all -o /dev/null -T %t.script \27# RUN:   %t.o 2>&1 | FileCheck %s --check-prefix=COMMON28 29## -shared enables some .dynsym related sections.30# RUN: not ld.lld -shared --orphan-handling=error -o /dev/null -T %t.script \31# RUN:   %t.o 2>&1 | FileCheck %s --check-prefixes=COMMON,DYNSYM,SYMTAB32 33# COMMON:      {{.*}}.o:(.text) is being placed in '.text'34# COMMON-NEXT: {{.*}}.o:(.text.2) is being placed in '.text.2'35# COMMON-NEXT: <internal>:(.comment) is being placed in '.comment'36# DYNSYM-NEXT: <internal>:(.dynsym) is being placed in '.dynsym'37# DYNSYM-NEXT: <internal>:(.gnu.hash) is being placed in '.gnu.hash'38# DYNSYM-NEXT: <internal>:(.hash) is being placed in '.hash'39# DYNSYM-NEXT: <internal>:(.dynamic) is being placed in '.dynamic'40# DYNSYM-NEXT: <internal>:(.dynstr) is being placed in '.dynstr'41# SYMTAB-NEXT: <internal>:(.symtab) is being placed in '.symtab'42# COMMON-NEXT: <internal>:(.shstrtab) is being placed in '.shstrtab'43# SYMTAB-NEXT: <internal>:(.strtab) is being placed in '.strtab'44# COMMON-NOT: <internal>45 46## Check --orphan-handling=warn reports warnings about orphans.47# RUN: ld.lld --orphan-handling=warn -o /dev/null -T %t.script \48# RUN:   %t.o 2>&1 | FileCheck %s --check-prefixes=COMMON,SYMTAB49 50# RUN: not ld.lld --orphan-handling=foo -o /dev/null --script %t.script %t.o 2>&1 \51# RUN:   | FileCheck %s --check-prefix=UNKNOWN52# UNKNOWN: unknown --orphan-handling mode: foo53 54.section .text.1,"a"55 nop56 57.section .text.2,"a"58 nop59