Index: llvm/trunk/test/LibDriver/Inputs/a.s =================================================================== --- llvm/trunk/test/LibDriver/Inputs/a.s +++ llvm/trunk/test/LibDriver/Inputs/a.s @@ -1,2 +0,0 @@ -.globl a -a: Index: llvm/trunk/test/LibDriver/Inputs/b.s =================================================================== --- llvm/trunk/test/LibDriver/Inputs/b.s +++ llvm/trunk/test/LibDriver/Inputs/b.s @@ -1,2 +0,0 @@ -.globl b -b: Index: llvm/trunk/test/LibDriver/infer-output-path.test =================================================================== --- llvm/trunk/test/LibDriver/infer-output-path.test +++ llvm/trunk/test/LibDriver/infer-output-path.test @@ -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: llvm/trunk/test/LibDriver/invalid.test =================================================================== --- llvm/trunk/test/LibDriver/invalid.test +++ llvm/trunk/test/LibDriver/invalid.test @@ -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: llvm/trunk/test/LibDriver/libpath.test =================================================================== --- llvm/trunk/test/LibDriver/libpath.test +++ llvm/trunk/test/LibDriver/libpath.test @@ -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: llvm/trunk/test/LibDriver/lit.local.cfg =================================================================== --- llvm/trunk/test/LibDriver/lit.local.cfg +++ llvm/trunk/test/LibDriver/lit.local.cfg @@ -1,3 +0,0 @@ -if not 'X86' in config.root.targets: - config.unsupported = True - Index: llvm/trunk/test/LibDriver/no-inputs.test =================================================================== --- llvm/trunk/test/LibDriver/no-inputs.test +++ llvm/trunk/test/LibDriver/no-inputs.test @@ -1,2 +0,0 @@ -RUN: llvm-lib -out:%t.a -RUN: test ! -e %t.a Index: llvm/trunk/test/LibDriver/resource.test =================================================================== --- llvm/trunk/test/LibDriver/resource.test +++ llvm/trunk/test/LibDriver/resource.test @@ -1,3 +0,0 @@ -RUN: llvm-lib /out:%t %S/Inputs/resource.res -RUN: llvm-ar t %t | FileCheck %s -CHECK: resource.res Index: llvm/trunk/test/LibDriver/thin.test =================================================================== --- llvm/trunk/test/LibDriver/thin.test +++ llvm/trunk/test/LibDriver/thin.test @@ -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: llvm/trunk/test/LibDriver/use-paths.test =================================================================== --- llvm/trunk/test/LibDriver/use-paths.test +++ llvm/trunk/test/LibDriver/use-paths.test @@ -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: llvm/trunk/test/tools/llvm-lib/Inputs/a.s =================================================================== --- llvm/trunk/test/tools/llvm-lib/Inputs/a.s +++ llvm/trunk/test/tools/llvm-lib/Inputs/a.s @@ -0,0 +1,2 @@ +.globl a +a: Index: llvm/trunk/test/tools/llvm-lib/Inputs/b.s =================================================================== --- llvm/trunk/test/tools/llvm-lib/Inputs/b.s +++ llvm/trunk/test/tools/llvm-lib/Inputs/b.s @@ -0,0 +1,2 @@ +.globl b +b: Index: llvm/trunk/test/tools/llvm-lib/infer-output-path.test =================================================================== --- llvm/trunk/test/tools/llvm-lib/infer-output-path.test +++ llvm/trunk/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: llvm/trunk/test/tools/llvm-lib/invalid.test =================================================================== --- llvm/trunk/test/tools/llvm-lib/invalid.test +++ llvm/trunk/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: llvm/trunk/test/tools/llvm-lib/libpath.test =================================================================== --- llvm/trunk/test/tools/llvm-lib/libpath.test +++ llvm/trunk/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: llvm/trunk/test/tools/llvm-lib/lit.local.cfg =================================================================== --- llvm/trunk/test/tools/llvm-lib/lit.local.cfg +++ llvm/trunk/test/tools/llvm-lib/lit.local.cfg @@ -0,0 +1,3 @@ +if not 'X86' in config.root.targets: + config.unsupported = True + Index: llvm/trunk/test/tools/llvm-lib/no-inputs.test =================================================================== --- llvm/trunk/test/tools/llvm-lib/no-inputs.test +++ llvm/trunk/test/tools/llvm-lib/no-inputs.test @@ -0,0 +1,2 @@ +RUN: llvm-lib -out:%t.a +RUN: test ! -e %t.a Index: llvm/trunk/test/tools/llvm-lib/resource.test =================================================================== --- llvm/trunk/test/tools/llvm-lib/resource.test +++ llvm/trunk/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: llvm/trunk/test/tools/llvm-lib/thin.test =================================================================== --- llvm/trunk/test/tools/llvm-lib/thin.test +++ llvm/trunk/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: llvm/trunk/test/tools/llvm-lib/use-paths.test =================================================================== --- llvm/trunk/test/tools/llvm-lib/use-paths.test +++ llvm/trunk/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