brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 70324e1 Raw
53 lines · plain
1; REQUIRES: x862; RUN: rm -rf %t; split-file %s %t3 4; RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/swift-foo.s -o %t/swift-foo.o5; RUN: llvm-ar rcs %t/libswiftFoo.a %t/swift-foo.o6; RUN: llvm-as %t/lc-linker-opt.ll -o %t/lc-linker-opt.o7; RUN: llvm-as %t/no-lc-linker-opt.ll -o %t/no-lc-linker-opt.o8 9; RUN: %lld -lSystem -force_load_swift_libs -L%t %t/lc-linker-opt.o -o \10; RUN:   %t/lc-linker-opt -why_load 2>&1 | FileCheck %s --check-prefix=WHY-LOAD11; RUN: llvm-objdump --macho --syms %t/lc-linker-opt | FileCheck %s --check-prefix=HAS-SWIFT12 13; RUN: %lld -lSystem -L%t %t/lc-linker-opt.o -o %t/lc-linker-opt-no-force14; RUN: llvm-objdump --macho --syms %t/lc-linker-opt-no-force | FileCheck %s --check-prefix=NO-SWIFT15 16;; Swift libraries passed on the CLI don't get force-loaded!17; RUN: %lld -lSystem -force_load_swift_libs -lswiftFoo -L%t %t/no-lc-linker-opt.o -o %t/no-lc-linker-opt18; RUN: llvm-objdump --macho --syms %t/no-lc-linker-opt | FileCheck %s --check-prefix=NO-SWIFT19 20;; Moreover, if a Swift library is passed on the CLI, that supersedes any21;; LC_LINKER_OPTIONs that reference it.22; RUN: %lld -lSystem -force_load_swift_libs -lswiftFoo -L%t %t/lc-linker-opt.o -o %t/both-cli-and-lc-linker-opt23; RUN: llvm-objdump --macho --syms  %t/both-cli-and-lc-linker-opt | FileCheck %s --check-prefix=NO-SWIFT24; RUN: %lld -lSystem -force_load_swift_libs -L%t %t/lc-linker-opt.o -lswiftFoo -o %t/both-cli-and-lc-linker-opt25; RUN: llvm-objdump --macho --syms  %t/both-cli-and-lc-linker-opt | FileCheck %s --check-prefix=NO-SWIFT26 27; WHY-LOAD: LC_LINKER_OPTION forced load of {{.*}}libswiftFoo.a(swift-foo.o)28; HAS-SWIFT: _swift_foo29; NO-SWIFT-NOT: _swift_foo30 31;--- lc-linker-opt.ll32target triple = "x86_64-apple-macosx10.15.0"33target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"34 35!0 = !{!"-lswiftFoo"}36!llvm.linker.options = !{!0}37 38define void @main() {39  ret void40}41 42;--- no-lc-linker-opt.ll43target triple = "x86_64-apple-macosx10.15.0"44target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"45 46define void @main() {47  ret void48}49 50;--- swift-foo.s51.globl _swift_foo52_swift_foo:53