Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / weak-header-flags.s
blobcf8c1f4bb66e23ca8c812149572065c839da9318
1 # REQUIRES: x86
2 # RUN: rm -rf %t; split-file %s %t
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/libweak-defines.s -o %t/libweak-defines.o
5 # RUN: %lld -dylib %t/libweak-defines.o -o %t/libweak-defines.dylib
6 # RUN: llvm-readobj --file-headers %t/libweak-defines.dylib | FileCheck %s --check-prefix=WEAK-DEFINES-AND-BINDS
8 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/binds-to-weak.s -o %t/binds-to-weak.o
9 # RUN: %lld -lSystem -L%t -lweak-defines -o %t/binds-to-weak %t/binds-to-weak.o
10 # RUN: llvm-readobj --file-headers %t/binds-to-weak | FileCheck %s --check-prefix=WEAK-BINDS-ONLY
12 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/overrides-weak.s -o %t/overrides-weak.o
13 # RUN: %lld -lSystem -L%t -lweak-defines -o %t/overrides-weak %t/overrides-weak.o
14 # RUN: llvm-readobj --file-headers %t/overrides-weak | FileCheck %s --check-prefix=WEAK-DEFINES-ONLY
16 # WEAK-DEFINES-AND-BINDS: MH_BINDS_TO_WEAK
17 # WEAK-DEFINES-AND-BINDS: MH_WEAK_DEFINES
19 # WEAK-BINDS-ONLY-NOT: MH_WEAK_DEFINES
20 # WEAK-BINDS-ONLY: MH_BINDS_TO_WEAK
21 # WEAK-BINDS-ONLY-NOT: MH_WEAK_DEFINES
23 # WEAK-DEFINES-ONLY-NOT: MH_BINDS_TO_WEAK
24 # WEAK-DEFINES-ONLY: MH_WEAK_DEFINES
25 # WEAK-DEFINES-ONLY-NOT: MH_BINDS_TO_WEAK
27 #--- libweak-defines.s
29 .globl _foo
30 .weak_definition _foo
31 _foo:
32 ret
34 #--- binds-to-weak.s
36 .globl _main
37 _main:
38 callq _foo
39 ret
41 ## Don't generate MH_WEAK_DEFINES for weak locals
42 .weak_definition _weak_local
43 _weak_local:
45 #--- overrides-weak.s
47 .globl _main, _foo
48 _foo:
50 _main:
51 ret