brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · eb2792a Raw
70 lines · plain
1Test the -I / --identify option.2 3Test with both GNU style and LLVM style import libraries; using4sources from yaml to preserve the checking behaviour even if the5output of llvm-dlltool itself would change.6 7RUN: rm -rf %t && mkdir -p %t8RUN: split-file %s %t9 10RUN: yaml2obj %S/Inputs/gnu_foo_lib_h.yaml > %t/gnu_foo_lib_h.o11RUN: yaml2obj %S/Inputs/gnu_foo_lib_s00000.yaml > %t/gnu_foo_lib_s00000.o12RUN: yaml2obj %S/Inputs/gnu_foo_lib_t.yaml > %t/gnu_foo_lib_t.o13RUN: llvm-ar rcs %t/gnu.a %t/gnu_foo_lib_h.o %t/gnu_foo_lib_s00000.o %t/gnu_foo_lib_t.o14 15RUN: yaml2obj %S/Inputs/llvm_foo_dll_1.yaml > %t/llvm_foo_dll_1.o16RUN: yaml2obj %S/Inputs/llvm_foo_dll_2.yaml > %t/llvm_foo_dll_2.o17RUN: yaml2obj %S/Inputs/llvm_foo_dll_3.yaml > %t/llvm_foo_dll_3.o18RUN: llvm-ar rcs %t/llvm.a %t/llvm_foo_dll_1.o %t/llvm_foo_dll_2.o %t/llvm_foo_dll_3.o19 20 21Check that we can identify the DLL name from a GNU style import library.22 23RUN: llvm-dlltool -I %t/gnu.a | FileCheck --check-prefix=FOO %s24RUN: llvm-dlltool --identify %t/gnu.a | count 125 26FOO: foo.dll27 28 29Check that we successfully can identify run while passing the30--identify-strict option.31 32RUN: llvm-dlltool -I %t/gnu.a --identify-strict | FileCheck --check-prefix=FOO %s33 34 35Check that we can identify the DLL name from an LLVM style import library.36 37RUN: llvm-dlltool -I %t/llvm.a | FileCheck --check-prefix=FOO %s38RUN: llvm-dlltool -I %t/llvm.a | count 139 40 41Check that we can identify the DLL names from an import library that42contains imports for multiple DLLs.43 44RUN: llvm-dlltool -m i386:x86-64 -d %t/lib1.def -l %t/lib1.a45RUN: llvm-dlltool -m i386:x86-64 -d %t/lib2.def -l %t/lib2.a46RUN: llvm-ar qcsL %t/merged.a %t/lib1.a %t/lib2.a47 48RUN: llvm-dlltool -I %t/merged.a | FileCheck --check-prefix=MERGED %s49 50MERGED-DAG: lib1.dll51MERGED-DAG: lib2.dll52 53Check that --identify-strict fails this case, when there are multiple54outputs.55 56RUN: not llvm-dlltool -I %t/merged.a --identify-strict 2>&1 | FileCheck --check-prefix=ERROR %s57 58ERROR: contains imports for two or more DLLs59 60 61#--- lib1.def62LIBRARY lib1.dll63EXPORTS64    func165 66#--- lib2.def67LIBRARY lib2.dll68EXPORTS69    func270