[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / lld / test / MachO / alias-option.s
blob087a5e021b8f173e53b6e8f63a08259324653947
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: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s
7 # RUN: %lld -alias _foo _bar -u _bar -exported_symbol _bar %t/main.o %t/foo.o -o %t/bar.o
8 # RUN: llvm-nm %t/bar.o | FileCheck %s --check-prefix=BAR
10 # BAR: [[#%x,FOO_ADDR:]] T _bar
11 # BAR: [[#FOO_ADDR]] t _foo
13 # RUN: not %lld -alias _missing _bar -alias _missing2 _baz %t/main.o -o %t/missing.o %s 2>&1 | FileCheck %s --check-prefix=MISSING
15 # MISSING-DAG: undefined base symbol '_missing' for alias '_bar'
16 # MISSING-DAG: undefined base symbol '_missing2' for alias '_baz'
18 # RUN: %lld -alias _foo _main %t/foo.o -o %t/main_rename.o
19 # RUN: llvm-nm %t/main_rename.o | FileCheck %s --check-prefix=MAIN
21 # MAIN: [[#%x,FOO_ADDR:]] T _foo
22 # MAIN: [[#FOO_ADDR]] T _main
24 ## Verify dead stripping doesn't remove the aliased symbol. This behavior differs
25 ## from ld64 where it actually does dead strip only the alias, not the original symbol.
26 # RUN: %lld -dead_strip -alias _foo _bar -alias _main _fake_main %t/main.o %t/foo.o -o %t/multiple.o
27 # RUN: llvm-nm %t/multiple.o | FileCheck %s --check-prefix=MULTIPLE
29 # MULTIPLE: [[#%x,FOO_ADDR:]] T _bar
30 # MULTIPLE: [[#%x,MAIN_ADDR:]] T _fake_main
31 # MULTIPLE: [[#FOO_ADDR]] T _foo
32 # MULTIPLE: [[#MAIN_ADDR]] T _main
34 #--- foo.s
35 .subsections_via_symbols
36 .globl _foo
37 _foo:
38 ret
40 #--- main.s
41 .subsections_via_symbols
42 .globl _main
43 _main:
44 ret