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
41 ## Don't generate MH_WEAK_DEFINES for weak locals
42 .weak_definition _weak_local