• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: x86
2# RUN: rm -rf %t
3# RUN: split-file %s %t
4
5# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s
6# RUN: %lld -dylib -o %t/libfoo.dylib %t/foo.o
7
8# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/bar.o %t/bar.s
9# RUN: llvm-ar csr  %t/bar.a %t/bar.o
10
11# RUN: llvm-as %t/baz.ll -o %t/baz.o
12
13# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s
14
15# RUN: %lld %t/main.o %t/baz.o %t/bar.a %t/libfoo.dylib -lSystem -o /dev/null -t | FileCheck -DPATH='%t' %s
16
17# CHECK-DAG: bar.a(bar.o)
18# CHECK-DAG: [[PATH]]/main.o
19# CHECK-DAG: [[PATH]]/baz.o
20# CHECK-DAG: [[PATH]]/libfoo.dylib
21# CHECK-DAG: {{.*}}/usr/lib{{[/\\]}}libSystem.tbd
22
23#--- foo.s
24.globl __Z3foo
25__Z3foo:
26  ret
27
28#--- bar.s
29.globl _bar
30_bar:
31  callq __Z3foo
32  ret
33
34#--- baz.ll
35
36target triple = "x86_64-apple-macosx10.15.0"
37target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
38
39define void @baz() {
40  ret void
41}
42
43#--- main.s
44.globl _main
45_main:
46  callq _bar
47  callq __Z3foo
48  callq _baz
49  ret
50