File: identify.test

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,696 kB
  • sloc: cpp: 7,438,781; ansic: 1,393,871; asm: 1,012,926; python: 241,771; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 8,596; ml: 5,082; perl: 4,730; makefile: 3,591; awk: 3,523; javascript: 2,251; xml: 892; fortran: 672
file content (69 lines) | stat: -rw-r--r-- 2,114 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Test the -I / --identify option.

Test with both GNU style and LLVM style import libraries; using
sources from yaml to preserve the checking behaviour even if the
output of llvm-dlltool itself would change.

RUN: rm -rf %t && mkdir -p %t
RUN: split-file %s %t

RUN: yaml2obj %S/Inputs/gnu_foo_lib_h.yaml > %t/gnu_foo_lib_h.o
RUN: yaml2obj %S/Inputs/gnu_foo_lib_s00000.yaml > %t/gnu_foo_lib_s00000.o
RUN: yaml2obj %S/Inputs/gnu_foo_lib_t.yaml > %t/gnu_foo_lib_t.o
RUN: llvm-ar rcs %t/gnu.a %t/gnu_foo_lib_h.o %t/gnu_foo_lib_s00000.o %t/gnu_foo_lib_t.o

RUN: yaml2obj %S/Inputs/llvm_foo_dll_1.yaml > %t/llvm_foo_dll_1.o
RUN: yaml2obj %S/Inputs/llvm_foo_dll_2.yaml > %t/llvm_foo_dll_2.o
RUN: yaml2obj %S/Inputs/llvm_foo_dll_3.yaml > %t/llvm_foo_dll_3.o
RUN: llvm-ar rcs %t/llvm.a %t/llvm_foo_dll_1.o %t/llvm_foo_dll_2.o %t/llvm_foo_dll_3.o


Check that we can identify the DLL name from a GNU style import library.

RUN: llvm-dlltool -I %t/gnu.a | FileCheck --check-prefix=FOO %s
RUN: llvm-dlltool --identify %t/gnu.a | count 1

FOO: foo.dll


Check that we successfully can identify run while passing the
--identify-strict option.

RUN: llvm-dlltool -I %t/gnu.a --identify-strict | FileCheck --check-prefix=FOO %s


Check that we can identify the DLL name from an LLVM style import library.

RUN: llvm-dlltool -I %t/llvm.a | FileCheck --check-prefix=FOO %s
RUN: llvm-dlltool -I %t/llvm.a | count 1


Check that we can identify the DLL names from an import library that
contains imports for multiple DLLs.

RUN: llvm-dlltool -m i386:x86-64 -d %t/lib1.def -l %t/lib1.a
RUN: llvm-dlltool -m i386:x86-64 -d %t/lib2.def -l %t/lib2.a
RUN: llvm-ar qcsL %t/merged.a %t/lib1.a %t/lib2.a

RUN: llvm-dlltool -I %t/merged.a | FileCheck --check-prefix=MERGED %s

MERGED-DAG: lib1.dll
MERGED-DAG: lib2.dll

Check that --identify-strict fails this case, when there are multiple
outputs.

RUN: not llvm-dlltool -I %t/merged.a --identify-strict 2>&1 | FileCheck --check-prefix=ERROR %s

ERROR: contains imports for two or more DLLs


#--- lib1.def
LIBRARY lib1.dll
EXPORTS
    func1

#--- lib2.def
LIBRARY lib2.dll
EXPORTS
    func2