2 # RUN: rm -rf %t; split-file %s %t
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/objc.o %t/objc.s
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s
6 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/bar.o %t/bar.s
7 # RUN: llvm-ar csr %t/lib.a %t/objc.o %t/foo.o %t/bar.o
9 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s
11 # The first line checks that we never demangle symbols in -why_load output.
12 # RUN: %lld %t/main.o %t/lib.a -o /dev/null -why_load -demangle | \
13 # RUN: FileCheck %s --check-prefix=WHY
14 # RUN: %lld %t/main.o -force_load %t/lib.a -o /dev/null -whyload | \
15 # RUN: FileCheck %s --check-prefix=WHYFORCE
16 # RUN: %lld %t/main.o %t/lib.a -o /dev/null -all_load -why_load | \
17 # RUN: FileCheck %s --check-prefix=WHYALL
18 # RUN: %lld %t/main.o -force_load %t/lib.a -o /dev/null -all_load -why_load | \
19 # RUN: FileCheck %s --check-prefix=WHYALLFORCE
21 # RUN: %lld %t/main.o %t/lib.a -o /dev/null -ObjC -why_load | \
22 # RUN: FileCheck %s --check-prefix=WHYOBJC
23 # RUN: %lld %t/main.o -force_load %t/lib.a -o /dev/null -ObjC -why_load | \
24 # RUN: FileCheck %s --check-prefix=WHYOBJCFORCE
25 # RUN: %lld %t/main.o %t/lib.a -o /dev/null -ObjC -all_load -why_load | \
26 # RUN: FileCheck %s --check-prefix=WHYOBJCALL
27 # RUN: %lld %t/main.o -force_load %t/lib.a -o /dev/null -ObjC -all_load -why_load | \
28 # RUN: FileCheck %s --check-prefix=WHYOBJCALLFORCE
30 # WHY-DAG: _bar forced load of {{.+}}lib.a(bar.o)
31 # WHY-DAG: __Z3foo forced load of {{.+}}lib.a(foo.o)
32 # WHY-NOT: {{.+}} forced load of {{.+}}lib.a(objc.o)
34 # WHYFORCE-DAG: -force_load forced load of {{.+}}lib.a(bar.o)
35 # WHYFORCE-DAG: -force_load forced load of {{.+}}lib.a(foo.o)
36 # WHYFORCE-DAG: -force_load forced load of {{.+}}lib.a(objc.o)
38 # WHYALL-DAG: -all_load forced load of {{.+}}lib.a(bar.o)
39 # WHYALL-DAG: -all_load forced load of {{.+}}lib.a(foo.o)
40 # WHYALL-DAG: -all_load forced load of {{.+}}lib.a(objc.o)
42 # WHYALLFORCE-DAG: -force_load forced load of {{.+}}lib.a(bar.o)
43 # WHYALLFORCE-DAG: -force_load forced load of {{.+}}lib.a(foo.o)
44 # WHYALLFORCE-DAG: -force_load forced load of {{.+}}lib.a(objc.o)
46 # WHYOBJC-DAG: _bar forced load of {{.+}}lib.a(bar.o)
47 # WHYOBJC-DAG: __Z3foo forced load of {{.+}}lib.a(foo.o)
48 # WHYOBJC-DAG: -ObjC forced load of {{.+}}lib.a(objc.o)
50 # WHYOBJCFORCE-DAG: -force_load forced load of {{.+}}lib.a(bar.o)
51 # WHYOBJCFORCE-DAG: -force_load forced load of {{.+}}lib.a(foo.o)
52 # WHYOBJCFORCE-DAG: -force_load forced load of {{.+}}lib.a(objc.o)
54 # WHYOBJCALL-DAG: -all_load forced load of {{.+}}lib.a(bar.o)
55 # WHYOBJCALL-DAG: -all_load forced load of {{.+}}lib.a(foo.o)
56 # WHYOBJCALL-DAG: -all_load forced load of {{.+}}lib.a(objc.o)
58 # WHYOBJCALLFORCE-DAG: -force_load forced load of {{.+}}lib.a(bar.o)
59 # WHYOBJCALLFORCE-DAG: -force_load forced load of {{.+}}lib.a(foo.o)
60 # WHYOBJCALLFORCE-DAG: -force_load forced load of {{.+}}lib.a(objc.o)
63 .section __DATA,__objc_catlist