brintos

brintos / llvm-project-archived public Read only

0
0
Text · 7.4 KiB · e0ca735 Raw
189 lines · plain
1# REQUIRES: x862# RUN: rm -rf %t; split-file %s %t3# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o4# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o5# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/abs.s -o %t/abs.o6# RUN: llvm-ar rcs %t/foo.a %t/foo.o7 8# FOO-FIRST: <_bar>:9# FOO-FIRST: <_main>:10 11# FOO-SECOND: <_main>:12# FOO-SECOND: <_bar>:13 14# RUN: %lld -lSystem -o %t/test-1 %t/test.o %t/foo.o -order_file %t/ord-115# RUN: llvm-objdump -d %t/test-1 | FileCheck %s --check-prefix=FOO-FIRST16## Output should be the same regardless of the command-line order of object files17# RUN: %lld -lSystem -o %t/test-1 %t/foo.o %t/test.o -order_file %t/ord-118# RUN: llvm-objdump -d %t/test-1 | FileCheck %s --check-prefix=FOO-FIRST19 20# RUN: %lld -lSystem -o %t/test-2 %t/test.o %t/foo.o -order_file %t/ord-221# RUN: llvm-objdump -d %t/test-2 | FileCheck %s --check-prefix=FOO-SECOND22# RUN: %lld -lSystem -o %t/test-2 %t/foo.o %t/test.o -order_file %t/ord-223# RUN: llvm-objdump -d %t/test-2 | FileCheck %s --check-prefix=FOO-SECOND24 25# RUN: %lld -lSystem -o %t/test-file-match %t/test.o %t/foo.o -order_file %t/ord-file-match26# RUN: llvm-objdump -d %t/test-file-match | FileCheck %s --check-prefix=FOO-FIRST27## Output should be the same regardless of the command-line order of object files28# RUN: %lld -lSystem -o %t/test-file-match %t/foo.o %t/test.o -order_file %t/ord-file-match29# RUN: llvm-objdump -d %t/test-file-match | FileCheck %s --check-prefix=FOO-FIRST30 31# RUN: %lld -lSystem -o %t/test-file-nomatch %t/test.o %t/foo.o -order_file %t/ord-file-nomatch32# RUN: llvm-objdump -d %t/test-file-nomatch | FileCheck %s --check-prefix=FOO-SECOND33# RUN: %lld -lSystem -o %t/test-file-nomatch %t/foo.o %t/test.o -order_file %t/ord-file-nomatch34# RUN: llvm-objdump -d %t/test-file-nomatch | FileCheck %s --check-prefix=FOO-SECOND35 36# RUN: %lld -lSystem -o %t/test-arch-match %t/test.o %t/foo.o -order_file %t/ord-arch-match37# RUN: llvm-objdump -d %t/test-arch-match | FileCheck %s --check-prefix=FOO-FIRST38# RUN: %lld -lSystem -o %t/test-arch-match %t/foo.o %t/test.o -order_file %t/ord-arch-match39# RUN: llvm-objdump -d %t/test-arch-match | FileCheck %s --check-prefix=FOO-FIRST40 41# RUN: %lld -lSystem -o %t/test-arch-nomatch %t/test.o %t/foo.o -order_file %t/ord-arch-nomatch42# RUN: llvm-objdump -d %t/test-arch-nomatch | FileCheck %s --check-prefix=FOO-SECOND43# RUN: %lld -lSystem -o %t/test-arch-nomatch %t/foo.o %t/test.o -order_file %t/ord-arch-nomatch44# RUN: llvm-objdump -d %t/test-arch-nomatch | FileCheck %s --check-prefix=FOO-SECOND45 46# RUN: %lld -lSystem -o %t/test-arch-match %t/test.o %t/foo.o -order_file %t/ord-arch-match47# RUN: llvm-objdump -d %t/test-arch-match | FileCheck %s --check-prefix=FOO-FIRST48# RUN: %lld -lSystem -o %t/test-arch-match %t/foo.o %t/test.o -order_file %t/ord-arch-match49# RUN: llvm-objdump -d %t/test-arch-match | FileCheck %s --check-prefix=FOO-FIRST50 51## Test archives52 53# RUN: %lld -lSystem -o %t/test-archive-1 %t/test.o %t/foo.a -order_file %t/ord-154# RUN: llvm-objdump -d %t/test-archive-1 | FileCheck %s --check-prefix=FOO-FIRST55# RUN: %lld -lSystem -o %t/test-archive-1 %t/foo.a %t/test.o -order_file %t/ord-156# RUN: llvm-objdump -d %t/test-archive-1 | FileCheck %s --check-prefix=FOO-FIRST57 58# RUN: %lld -lSystem -o %t/test-archive-file-no-match %t/test.o %t/foo.a -order_file %t/ord-file-match59# RUN: llvm-objdump -d %t/test-archive-file-no-match | FileCheck %s --check-prefix=FOO-SECOND60# RUN: %lld -lSystem -o %t/test-archive %t/foo.a %t/test.o -order_file %t/ord-file-match61# RUN: llvm-objdump -d %t/test-archive-file-no-match | FileCheck %s --check-prefix=FOO-SECOND62 63# RUN: %lld -lSystem -o %t/test-archive-1 %t/test.o %t/foo.a -order_file %t/ord-archive-match64# RUN: llvm-objdump -d %t/test-archive-1 | FileCheck %s --check-prefix=FOO-FIRST65# RUN: %lld -lSystem -o %t/test-archive-1 %t/foo.a %t/test.o -order_file %t/ord-archive-match66# RUN: llvm-objdump -d %t/test-archive-1 | FileCheck %s --check-prefix=FOO-FIRST67 68# RUN: %lld -lSystem -o %t/test-archive-file-no-match %t/test.o %t/foo.a -order_file %t/ord-file-nomatch69# RUN: llvm-objdump -d %t/test-archive-file-no-match | FileCheck %s --check-prefix=FOO-SECOND70# RUN: %lld -lSystem -o %t/test-archive %t/foo.a %t/test.o -order_file %t/ord-file-nomatch71# RUN: llvm-objdump -d %t/test-archive-file-no-match | FileCheck %s --check-prefix=FOO-SECOND72 73## The following tests check that if an address is matched by multiple order74## file entries, it should always use the lowest-ordered match.75 76# RUN: %lld -lSystem -o %t/test-1 %t/test.o %t/foo.o -order_file %t/ord-multiple-177# RUN: llvm-objdump -d %t/test-1 | FileCheck %s --check-prefix=FOO-FIRST78# RUN: %lld -lSystem -o %t/test-1 %t/foo.o %t/test.o -order_file %t/ord-multiple-179# RUN: llvm-objdump -d %t/test-1 | FileCheck %s --check-prefix=FOO-FIRST80 81# RUN: %lld -lSystem -o %t/test-2 %t/test.o %t/foo.o -order_file %t/ord-multiple-282# RUN: llvm-objdump -d %t/test-2 | FileCheck %s --check-prefix=FOO-FIRST83# RUN: %lld -lSystem -o %t/test-2 %t/foo.o %t/test.o -order_file %t/ord-multiple-284# RUN: llvm-objdump -d %t/test-2 | FileCheck %s --check-prefix=FOO-FIRST85 86# RUN: %lld -lSystem -o %t/test-3 %t/test.o %t/foo.o -order_file %t/ord-multiple-387# RUN: llvm-objdump -d %t/test-3 | FileCheck %s --check-prefix=FOO-FIRST88# RUN: %lld -lSystem -o %t/test-3 %t/foo.o %t/test.o -order_file %t/ord-multiple-389# RUN: llvm-objdump -d %t/test-3 | FileCheck %s --check-prefix=FOO-FIRST90 91# RUN: %lld -lSystem -o %t/test-4 %t/test.o %t/foo.o -order_file %t/ord-multiple-492# RUN: llvm-objdump -d %t/test-4 | FileCheck %s --check-prefix=FOO-FIRST93# RUN: %lld -lSystem -o %t/test-4 %t/foo.o %t/test.o -order_file %t/ord-multiple-494# RUN: llvm-objdump -d %t/test-4 | FileCheck %s --check-prefix=FOO-FIRST95 96## -[Foo doFoo:andBar:] and _bar both point to the same location. When both97## symbols appear in an order file, the location in question should be ordered98## according to the lowest-ordered symbol that references it.99 100# RUN: %lld -lSystem -o %t/test-alias %t/test.o %t/foo.o -order_file %t/ord-alias101# RUN: llvm-objdump -d %t/test-alias | FileCheck %s --check-prefix=FOO-FIRST102# RUN: %lld -lSystem -o %t/test-alias %t/foo.o %t/test.o -order_file %t/ord-alias103# RUN: llvm-objdump -d %t/test-alias | FileCheck %s --check-prefix=FOO-FIRST104 105## Absolute in symbols in order files make no sense. Just ignore them.106# RUN: %lld -lSystem -dylib -o %t/test-abs %t/abs.o -order_file %t/ord-abs107 108#--- ord-1109-[Foo doFoo:andBar:] # just a comment110_main # another comment111 112#--- ord-2113_main # just a comment114-[Foo doFoo:andBar:] # another comment115 116#--- ord-file-match117foo.o:-[Foo doFoo:andBar:]118_main119 120#--- ord-archive-match121foo.a(foo.o):-[Foo doFoo:andBar:]122_main123 124#--- ord-file-nomatch125bar.o:-[Foo doFoo:andBar:]126_main127-[Foo doFoo:andBar:]128 129#--- ord-arch-match130x86_64:-[Foo doFoo:andBar:]131_main132 133#--- ord-arch-nomatch134arm64:-[Foo doFoo:andBar:]135_main136-[Foo doFoo:andBar:]137 138#--- ord-arch-file-match139x86_64:bar.o:-[Foo doFoo:andBar:]140_main141 142#--- ord-multiple-1143-[Foo doFoo:andBar:]144_main145foo.o:-[Foo doFoo:andBar:]146 147#--- ord-multiple-2148foo.o:-[Foo doFoo:andBar:]149_main150-[Foo doFoo:andBar:]151 152#--- ord-multiple-3153-[Foo doFoo:andBar:]154_main155-[Foo doFoo:andBar:]156 157#--- ord-multiple-4158foo.o:-[Foo doFoo:andBar:]159_main160foo.o:-[Foo doFoo:andBar:]161 162#--- ord-alias163_bar164_main165-[Foo doFoo:andBar:]166 167#--- ord-abs168_abs169 170#--- foo.s171.globl "-[Foo doFoo:andBar:]"172"-[Foo doFoo:andBar:]":173_bar:174  ret175 176#--- test.s177.globl _main178 179_main:180  callq "-[Foo doFoo:andBar:]"181  ret182 183.section  __DWARF,__debug_aranges,regular,debug184ltmp1:185  .byte 0186 187#--- abs.s188_abs = 42189