1# REQUIRES: x86 2# RUN: rm -rf %t 3# RUN: split-file %s %t 4 5# RUN: llvm-as %t/framework.ll -o %t/framework.o 6# RUN: %lld %t/framework.o -o %t/frame 7# RUN: llvm-objdump --macho --all-headers %t/frame | FileCheck --check-prefix=FRAME %s 8# FRAME: cmd LC_LOAD_DYLIB 9# FRAME-NEXT: cmdsize 10# FRAME-NEXT: name /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 11 12# RUN: llvm-as %t/l.ll -o %t/l.o 13# RUN: %lld %t/l.o -o %t/l 14# RUN: llvm-objdump --macho --all-headers %t/l | FileCheck --check-prefix=LIB %s 15# LIB: cmd LC_LOAD_DYLIB 16# LIB-NEXT: cmdsize 17# LIB-NEXT: name /usr/lib/libSystem.B.dylib 18 19# RUN: llvm-as %t/invalid.ll -o %t/invalid.o 20# RUN: not %lld %t/invalid.o -o /dev/null 2>&1 | FileCheck --check-prefix=INVALID %s 21# INVALID: error: -why_load is not allowed in LC_LINKER_OPTION 22 23#--- framework.ll 24target triple = "x86_64-apple-macosx10.15.0" 25target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 26 27!0 = !{!"-framework", !"CoreFoundation"} 28!llvm.linker.options = !{!0} 29 30define void @main() { 31 ret void 32} 33 34#--- l.ll 35target triple = "x86_64-apple-macosx10.15.0" 36target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 37 38!0 = !{!"-lSystem"} 39!llvm.linker.options = !{!0} 40 41define void @main() { 42 ret void 43} 44 45#--- invalid.ll 46 47target triple = "x86_64-apple-macosx10.15.0" 48target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 49 50!0 = !{!"-why_load"} 51!llvm.linker.options = !{!0} 52 53define void @main() { 54 ret void 55} 56