2021-03-23 10:05:46 +08:00
|
|
|
# REQUIRES: x86
|
2021-05-09 02:42:15 +08:00
|
|
|
# RUN: rm -rf %t; split-file %s %t
|
2021-03-23 10:05:46 +08:00
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s
|
|
|
|
# RUN: %lld -dylib -o %t/libfoo.dylib %t/foo.o
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/bar.o %t/bar.s
|
|
|
|
# RUN: llvm-ar csr %t/bar.a %t/bar.o
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s
|
|
|
|
|
2021-03-24 23:48:47 +08:00
|
|
|
# RUN: %lld %t/main.o %t/bar.a %t/libfoo.dylib -lSystem -o %t/test.out -dependency_info %t/deps_info.out
|
2021-03-23 10:05:46 +08:00
|
|
|
# RUN: %python %S/Inputs/DependencyDump.py %t/deps_info.out | FileCheck %s
|
|
|
|
|
2021-03-24 07:16:02 +08:00
|
|
|
# CHECK: lld-version: {{.*}}LLD {{.*}}
|
2021-03-24 09:27:58 +08:00
|
|
|
|
|
|
|
# CHECK-DAG: input-file: {{.*}}{{[/\]}}bar.a
|
|
|
|
# CHECK-DAG: input-file: {{.*}}{{[/\]}}libfoo.dylib
|
|
|
|
# CHECK-DAG: input-file: {{.*}}{{[/\]}}libSystem.tbd
|
|
|
|
# CHECK-DAG: input-file: {{.*}}{{[/\]}}main.o
|
2021-03-24 23:48:47 +08:00
|
|
|
# CHECK-DAG: input-file: {{.*}}bar.o
|
2021-03-23 10:05:46 +08:00
|
|
|
|
2021-04-16 09:14:30 +08:00
|
|
|
# CHECK: not-found: {{.*}}{{[/\]}}libdyld.{{.*}}
|
2021-03-23 10:05:46 +08:00
|
|
|
## There could be more not-found here but we are not checking those because it's brittle.
|
|
|
|
|
2021-03-24 09:27:58 +08:00
|
|
|
# CHECK: output-file: {{.*}}{{[/\]}}test.out
|
2021-03-23 10:05:46 +08:00
|
|
|
|
|
|
|
#--- foo.s
|
|
|
|
.globl __Z3foo
|
|
|
|
__Z3foo:
|
|
|
|
ret
|
|
|
|
|
|
|
|
#--- bar.s
|
|
|
|
.globl _bar
|
|
|
|
_bar:
|
|
|
|
callq __Z3foo
|
|
|
|
ret
|
|
|
|
|
|
|
|
#--- main.s
|
|
|
|
.globl _main
|
|
|
|
_main:
|
|
|
|
callq _bar
|
|
|
|
callq __Z3foo
|
|
|
|
ret
|