[X86][MC,LLD][NFC] Rename R_X86_64_REX2_GOTPCRELX (#116737)
[llvm-project.git] / lld / test / MachO / t.s
blob8626950448dc30e28b5fe26b58e3df2cc61529d5
1 # REQUIRES: x86
2 # RUN: rm -rf %t; split-file %s %t
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s
5 # RUN: %lld -dylib -o %t/libfoo.dylib %t/foo.o
7 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/bar.o %t/bar.s
8 # RUN: llvm-ar csr %t/bar.a %t/bar.o
10 # RUN: llvm-as %t/baz.ll -o %t/baz.o
12 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s
14 # RUN: %lld %t/main.o %t/baz.o %t/bar.a %t/libfoo.dylib -lSystem -o /dev/null -t | FileCheck -DPATH='%t' %s
16 # CHECK-DAG: bar.a(bar.o)
17 # CHECK-DAG: [[PATH]]/main.o
18 # CHECK-DAG: [[PATH]]/baz.o
19 # CHECK-DAG: [[PATH]]/libfoo.dylib
20 # CHECK-DAG: {{.*}}/usr/lib{{[/\\]}}libSystem.tbd
22 #--- foo.s
23 .globl __Z3foo
24 __Z3foo:
25 ret
27 #--- bar.s
28 .globl _bar
29 _bar:
30 callq __Z3foo
31 ret
33 #--- baz.ll
35 target triple = "x86_64-apple-macosx10.15.0"
36 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
38 define void @baz() {
39 ret void
42 #--- main.s
43 .globl _main
44 _main:
45 callq _bar
46 callq __Z3foo
47 callq _baz
48 ret