Index: test/LibDriver/Inputs/a.s =================================================================== --- test/LibDriver/Inputs/a.s +++ /dev/null @@ -1,2 +0,0 @@ -.globl a -a: Index: test/LibDriver/Inputs/b.s =================================================================== --- test/LibDriver/Inputs/b.s +++ /dev/null @@ -1,2 +0,0 @@ -.globl b -b: Index: test/LibDriver/infer-output-path.test =================================================================== --- test/LibDriver/infer-output-path.test +++ /dev/null @@ -1,16 +0,0 @@ -RUN: rm -rf %t && mkdir -p %t -RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/a.obj %S/Inputs/a.s -RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/b.o %S/Inputs/b.s -RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/c %S/Inputs/b.s - -RUN: rm -f %t/a.lib -RUN: llvm-lib %t/a.obj -RUN: test -e %t/a.lib - -RUN: rm -f %t/b.lib -RUN: llvm-lib /libpath:%t b.o -RUN: test -e %t/b.lib - -RUN: rm -f %t/c.lib -RUN: llvm-lib /libpath:%t c -RUN: test -e %t/c.lib Index: test/LibDriver/invalid.test =================================================================== --- test/LibDriver/invalid.test +++ /dev/null @@ -1,2 +0,0 @@ -RUN: not llvm-lib %S/Inputs/cl-gl.obj 2>&1 | FileCheck %s -CHECK: not a COFF object, bitcode or resource file Index: test/LibDriver/libpath.test =================================================================== --- test/LibDriver/libpath.test +++ /dev/null @@ -1,15 +0,0 @@ -RUN: mkdir -p %t/a %t/b -RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/a/foo.obj %S/Inputs/a.s -RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/b/foo.obj %S/Inputs/b.s - -RUN: env "LIB=%t/a;%t/b" llvm-lib /out:%t1.lib foo.obj -RUN: llvm-nm %t1.lib | FileCheck --check-prefix=A %s - -RUN: llvm-lib /out:%t2.lib /libpath:%t/a /libpath:%t/b foo.obj -RUN: llvm-nm %t2.lib | FileCheck --check-prefix=A %s - -RUN: env LIB=%t/a llvm-lib /libpath:%t/b /out:%t3.lib foo.obj -RUN: llvm-nm %t3.lib | FileCheck --check-prefix=B %s - -A: T a -B: T b Index: test/LibDriver/lit.local.cfg =================================================================== --- test/LibDriver/lit.local.cfg +++ /dev/null @@ -1,3 +0,0 @@ -if not 'X86' in config.root.targets: - config.unsupported = True - Index: test/LibDriver/no-inputs.test =================================================================== --- test/LibDriver/no-inputs.test +++ /dev/null @@ -1,2 +0,0 @@ -RUN: llvm-lib -out:%t.a -RUN: test ! -e %t.a Index: test/LibDriver/resource.test =================================================================== --- test/LibDriver/resource.test +++ /dev/null @@ -1,3 +0,0 @@ -RUN: llvm-lib /out:%t %S/Inputs/resource.res -RUN: llvm-ar t %t | FileCheck %s -CHECK: resource.res Index: test/LibDriver/thin.test =================================================================== --- test/LibDriver/thin.test +++ /dev/null @@ -1,9 +0,0 @@ -RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t %S/Inputs/a.s - -RUN: llvm-lib -out:%t.a %t -RUN: FileCheck --check-prefix=FAT %s < %t.a -FAT: ! - -RUN: llvm-lib -out:%t.thin.a -llvmlibthin %t -RUN: FileCheck --check-prefix=THIN %s < %t.thin.a -THIN: ! Index: test/LibDriver/use-paths.test =================================================================== --- test/LibDriver/use-paths.test +++ /dev/null @@ -1,24 +0,0 @@ -llvm-lib should behave like "link.exe /lib" and use relative paths to describe -archive members. - -First, get in a clean working directory. -RUN: rm -rf %t && mkdir -p %t && cd %t - -Make foo/a.obj and foo/b.obj. -RUN: mkdir foo -RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o foo/a.obj %S/Inputs/a.s -RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o foo/b.obj %S/Inputs/b.s - -RUN: llvm-lib -out:foo.lib foo/a.obj foo/b.obj -RUN: llvm-ar t foo.lib | FileCheck %s - -FIXME: We should probably use backslashes on Windows to better match MSVC tools. -CHECK: foo/a.obj -CHECK: foo/b.obj - -Do it again with absolute paths and see that we get something. -RUN: llvm-lib -out:foo.lib %t/foo/a.obj %t/foo/b.obj -RUN: llvm-ar t foo.lib | FileCheck %s --check-prefix=ABS - -ABS: {{.*}}/foo/a.obj -ABS: {{.*}}/foo/b.obj Index: test/tools/llvm-lib/Inputs/a.s =================================================================== --- /dev/null +++ test/tools/llvm-lib/Inputs/a.s @@ -0,0 +1,2 @@ +.globl a +a: Index: test/tools/llvm-lib/Inputs/b.s =================================================================== --- /dev/null +++ test/tools/llvm-lib/Inputs/b.s @@ -0,0 +1,2 @@ +.globl b +b: Index: test/tools/llvm-lib/infer-output-path.test =================================================================== --- /dev/null +++ test/tools/llvm-lib/infer-output-path.test @@ -0,0 +1,16 @@ +RUN: rm -rf %t && mkdir -p %t +RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/a.obj %S/Inputs/a.s +RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/b.o %S/Inputs/b.s +RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/c %S/Inputs/b.s + +RUN: rm -f %t/a.lib +RUN: llvm-lib %t/a.obj +RUN: test -e %t/a.lib + +RUN: rm -f %t/b.lib +RUN: llvm-lib /libpath:%t b.o +RUN: test -e %t/b.lib + +RUN: rm -f %t/c.lib +RUN: llvm-lib /libpath:%t c +RUN: test -e %t/c.lib Index: test/tools/llvm-lib/invalid.test =================================================================== --- /dev/null +++ test/tools/llvm-lib/invalid.test @@ -0,0 +1,2 @@ +RUN: not llvm-lib %S/Inputs/cl-gl.obj 2>&1 | FileCheck %s +CHECK: not a COFF object, bitcode or resource file Index: test/tools/llvm-lib/libpath.test =================================================================== --- /dev/null +++ test/tools/llvm-lib/libpath.test @@ -0,0 +1,15 @@ +RUN: mkdir -p %t/a %t/b +RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/a/foo.obj %S/Inputs/a.s +RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t/b/foo.obj %S/Inputs/b.s + +RUN: env "LIB=%t/a;%t/b" llvm-lib /out:%t1.lib foo.obj +RUN: llvm-nm %t1.lib | FileCheck --check-prefix=A %s + +RUN: llvm-lib /out:%t2.lib /libpath:%t/a /libpath:%t/b foo.obj +RUN: llvm-nm %t2.lib | FileCheck --check-prefix=A %s + +RUN: env LIB=%t/a llvm-lib /libpath:%t/b /out:%t3.lib foo.obj +RUN: llvm-nm %t3.lib | FileCheck --check-prefix=B %s + +A: T a +B: T b Index: test/tools/llvm-lib/lit.local.cfg =================================================================== --- /dev/null +++ test/tools/llvm-lib/lit.local.cfg @@ -0,0 +1,3 @@ +if not 'X86' in config.root.targets: + config.unsupported = True + Index: test/tools/llvm-lib/no-inputs.test =================================================================== --- /dev/null +++ test/tools/llvm-lib/no-inputs.test @@ -0,0 +1,2 @@ +RUN: llvm-lib -out:%t.a +RUN: test ! -e %t.a Index: test/tools/llvm-lib/resource.test =================================================================== --- /dev/null +++ test/tools/llvm-lib/resource.test @@ -0,0 +1,3 @@ +RUN: llvm-lib /out:%t %S/Inputs/resource.res +RUN: llvm-ar t %t | FileCheck %s +CHECK: resource.res Index: test/tools/llvm-lib/thin.test =================================================================== --- /dev/null +++ test/tools/llvm-lib/thin.test @@ -0,0 +1,9 @@ +RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t %S/Inputs/a.s + +RUN: llvm-lib -out:%t.a %t +RUN: FileCheck --check-prefix=FAT %s < %t.a +FAT: ! + +RUN: llvm-lib -out:%t.thin.a -llvmlibthin %t +RUN: FileCheck --check-prefix=THIN %s < %t.thin.a +THIN: ! Index: test/tools/llvm-lib/use-paths.test =================================================================== --- /dev/null +++ test/tools/llvm-lib/use-paths.test @@ -0,0 +1,24 @@ +llvm-lib should behave like "link.exe /lib" and use relative paths to describe +archive members. + +First, get in a clean working directory. +RUN: rm -rf %t && mkdir -p %t && cd %t + +Make foo/a.obj and foo/b.obj. +RUN: mkdir foo +RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o foo/a.obj %S/Inputs/a.s +RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o foo/b.obj %S/Inputs/b.s + +RUN: llvm-lib -out:foo.lib foo/a.obj foo/b.obj +RUN: llvm-ar t foo.lib | FileCheck %s + +FIXME: We should probably use backslashes on Windows to better match MSVC tools. +CHECK: foo/a.obj +CHECK: foo/b.obj + +Do it again with absolute paths and see that we get something. +RUN: llvm-lib -out:foo.lib %t/foo/a.obj %t/foo/b.obj +RUN: llvm-ar t foo.lib | FileCheck %s --check-prefix=ABS + +ABS: {{.*}}/foo/a.obj +ABS: {{.*}}/foo/b.obj