brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.8 KiB · b1195cc Raw
198 lines · plain
1# REQUIRES: x862# Unsupported on Windows due to maximum path length limitations.3# UNSUPPORTED: system-windows4 5# RUN: rm -rf %t.dir6# RUN: split-file %s %t.dir7 8# RUN: yaml2obj %p/Inputs/hello32.yaml -o %t.obj9# RUN: llvm-mc -filetype=obj -triple=i386-windows %t.dir/drectve.s -o %t.dir/drectve.obj10# RUN: echo '_main@0' > %t.order11# RUN: touch %t.def12# RUN: touch %t.cg13 14Test link.exe-style /linkrepro: flag.15# RUN: mkdir -p %t.dir/build116# RUN: cd %t.dir/build117# RUN: lld-link %t.obj %p/Inputs/std32.lib /subsystem:console \18# RUN:   /entry:main@0 /linkrepro:. /out:%t.exe19# RUN: tar xf repro.tar20# RUN: diff %t.obj repro/%:t.obj21# RUN: diff %p/Inputs/std32.lib repro/%:p/Inputs/std32.lib22# RUN: FileCheck %s --check-prefix=RSP < repro/response.txt23 24Test lld-style /reproduce: flag.25# RUN: lld-link %t.obj %p/Inputs/std32.lib /subsystem:console \26# RUN:   /entry:main@0 /reproduce:repro2.tar /out:%t.exe27# RUN: tar xf repro2.tar28# RUN: diff %t.obj repro2/%:t.obj29# RUN: diff %p/Inputs/std32.lib repro2/%:p/Inputs/std32.lib30# RUN: FileCheck %s --check-prefix=RSP < repro2/response.txt31 32Test LLD_REPRODUCE env var.33# RUN: mkdir -p %t.dir/build234# RUN: cd %t.dir/build235# RUN: env LLD_REPRODUCE=repro.tar lld-link %t.obj %p/Inputs/std32.lib \36# RUN:    /subsystem:console /entry:main@0 /out:%t.exe37# RUN: tar xf repro.tar38# RUN: diff %t.obj repro/%:t.obj39# RUN: diff %p/Inputs/std32.lib repro/%:p/Inputs/std32.lib40# RUN: FileCheck %s --check-prefix=RSP < repro/response.txt41 42Test adding .lib files with /libpath: to repro archive,43and various other flags.44# RUN: mkdir -p %t.dir/build345# RUN: cd %t.dir/build346# RUN: lld-link %t.obj /libpath:%p/Inputs /defaultlib:std32 /subsystem:console \47# RUN:   /entry:main@0 /linkrepro:. /out:%t.exe /order:@%t.order /def:%t.def48# RUN: tar tf repro.tar | FileCheck --check-prefix=LIST %s49# RUN: tar xf repro.tar50# RUN: diff %t.obj repro/%:t.obj51# RUN: diff %t.order repro/%:t.order52# RUN: diff %t.def repro/%:t.def53# RUN: diff %p/Inputs/std32.lib repro/%:p/Inputs/std32.lib54# RUN: FileCheck %s --check-prefix=RSP-DEFAULTLIB < repro/response.txt55# RUN: cd repro; lld-link @response.txt56 57Test adding .lib files with LIB env var to repro archive,58and various other flags.59# RUN: mkdir -p %t.dir/build460# RUN: cd %t.dir/build461# RUN: env LIB=%p/Inputs lld-link %t.obj /defaultlib:std32 /subsystem:console \62# RUN:   /entry:main@0 /linkrepro:. /out:%t.exe /order:@%t.order /def:%t.def63# RUN: tar tf repro.tar | FileCheck --check-prefix=LIST %s64# RUN: tar xf repro.tar65# RUN: diff %t.obj repro/%:t.obj66# RUN: diff %t.order repro/%:t.order67# RUN: diff %t.def repro/%:t.def68# RUN: diff %p/Inputs/std32.lib repro/%:p/Inputs/std32.lib69# RUN: FileCheck %s --check-prefix=RSP-DEFAULTLIB < repro/response.txt70# RUN: cd repro; lld-link @response.txt71 72# LIST: .obj73# LIST: std32.lib74# LIST: response.txt75# LIST: .def76# LIST: .order77 78# RSP: linkrepro.test.tmp.obj79# RSP: std32.lib80# RSP: /subsystem:console81# RSP: /entry:main@082# RSP: /out:83# RSP-NOT: /order:@/84# RSP-NOT: /def:/85 86# RSP-DEFAULTLIB: linkrepro.test.tmp.obj87# RSP-DEFAULTLIB: /defaultlib:std3288# RSP-DEFAULTLIB: /subsystem:console89# RSP-DEFAULTLIB: /entry:main@090# RSP-DEFAULTLIB: /out:91# RSP-DEFAULTLIB-NOT: /order:@/92# RSP-DEFAULTLIB-NOT: /def:/93 94Test /call-graph-ordering-file (can't be used with /order:, needs separate test)95# RUN: mkdir -p %t.dir/build596# RUN: cd %t.dir/build597# RUN: lld-link %t.obj %p/Inputs/std32.lib /subsystem:console \98# RUN:     /entry:main@0 /linkrepro:. /out:%t.exe /call-graph-ordering-file:%t.cg99# RUN: tar tf repro.tar | FileCheck --check-prefix=LISTCG %s100# RUN: tar xf repro.tar101# RUN: diff %t.obj repro/%:t.obj102# RUN: diff %t.cg repro/%:t.cg103# RUN: FileCheck %s --check-prefix=RSPCG < repro/response.txt104# RUN: cd repro; lld-link @response.txt105 106# LISTCG: .obj107# LISTCG: response.txt108# LISTCG: .cg109 110# RSPCG-NOT: /call-graph-ordering-file:/111 112Test /defaultlib: from a .drectve section113# RUN: mkdir -p %t.dir/build6114# RUN: cd %t.dir/build6115# RUN: lld-link %t.obj %t.dir/drectve.obj /libpath:%p/Inputs /subsystem:console \116# RUN:   /entry:main@0 /linkrepro:. -safeseh:no /out:%t.exe /order:@%t.order /def:%t.def117# RUN: tar tf repro.tar | FileCheck --check-prefix=LIST %s118# RUN: tar xf repro.tar119# RUN: diff %t.obj repro/%:t.obj120# RUN: diff %t.order repro/%:t.order121# RUN: diff %t.def repro/%:t.def122# RUN: diff %p/Inputs/std32.lib repro/%:p/Inputs/std32.lib123# RUN: FileCheck %s --check-prefix=RSP-DRECTVE < repro/response.txt124# RUN: cd repro; lld-link @response.txt125 126# RSP-DRECTVE: linkrepro.test.tmp.obj127# RSP-DRECTVE: drectve.obj128# RSP-DRECTVE: /subsystem:console129# RSP-DRECTVE: /entry:main@0130# RSP-DRECTVE: -safeseh:no131# RSP-DRECTVE: /out:132 133Test /wholearchive: with /linkrepro:134# RUN: llvm-mc -filetype=obj -triple=i386-windows %t.dir/archive.s -o %t.dir/archive.obj135# RUN: rm -f %t.dir/build7/archive.lib136# RUN: llvm-ar rcs %t.dir/archive.lib %t.dir/archive.obj137# RUN: mkdir -p %t.dir/build7138# RUN: cd %t.dir/build7139 RUN: lld-link %t.obj /defaultlib:std32 /libpath:%p/Inputs /subsystem:console \140# RUN:   /entry:main@0 /linkrepro:. -safeseh:no /wholearchive:%t.dir/archive.lib \141# RUN:   /out:%t.exe /order:@%t.order /def:%t.def142# RUN: tar tf repro.tar | FileCheck --check-prefix=LIST %s143# RUN: tar xf repro.tar144# RUN: diff %t.obj repro/%:t.obj145# RUN: diff %t.order repro/%:t.order146# RUN: diff %t.def repro/%:t.def147# RUN: diff %p/Inputs/std32.lib repro/%:p/Inputs/std32.lib148# RUN: FileCheck %s --check-prefix=RSP-WHOLEARCHIVE < repro/response.txt149# RUN: cd repro; lld-link @response.txt150 151# RSP-WHOLEARCHIVE: linkrepro.test.tmp.obj152# RSP-WHOLEARCHIVE: /defaultlib:std32153# RSP-WHOLEARCHIVE: /subsystem:console154# RSP-WHOLEARCHIVE: /entry:main@0155# RSP-WHOLEARCHIVE: -safeseh:no156# RSP-WHOLEARCHIVE: /wholearchive:{{.*}}archive.lib157# RSP-WHOLEARCHIVE: /out:158 159Test /start-lib / /end-lib with /linkrepro:160# RUN: mkdir -p %t.dir/build8161# RUN: cd %t.dir/build8162# RUN: lld-link %t.obj /defaultlib:std32 /libpath:%p/Inputs /subsystem:console \163# RUN:   /entry:main@0 /linkrepro:. -safeseh:no /start-lib %t.dir/drectve.obj /end-lib \164# RUN:   /out:%t.exe /order:@%t.order /def:%t.def165# RUN: tar tf repro.tar | FileCheck --check-prefix=LIST %s166# RUN: tar xf repro.tar167# RUN: diff %t.obj repro/%:t.obj168# RUN: diff %t.order repro/%:t.order169# RUN: diff %t.def repro/%:t.def170# RUN: diff %p/Inputs/std32.lib repro/%:p/Inputs/std32.lib171# RUN: FileCheck %s --check-prefix=RSP-STARTLIB < repro/response.txt172# RUN: cd repro; lld-link @response.txt173 174# RSP-STARTLIB: linkrepro.test.tmp.obj175# RSP-STARTLIB: /defaultlib:std32176# RSP-STARTLIB: /subsystem:console177# RSP-STARTLIB: /entry:main@0178# RSP-STARTLIB: -safeseh:no179# RSP-STARTLIB: /start-lib180# RSP-STARTLIB-NEXT: drectve.obj181# RSP-STARTLIB-NEXT: /end-lib182# RSP-STARTLIB: /out:183 184#--- drectve.s185        .section .drectve, "yn"186        .ascii "/defaultlib:std32"187 188#--- archive.s189	.text190	.intel_syntax noprefix191	.globl	exportfn3192	.p2align	4193exportfn3:194	ret195 196	.section	.drectve,"yni"197	.ascii	" /EXPORT:exportfn3"198