File: exportas.test

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (94 lines) | stat: -rw-r--r-- 2,793 bytes parent folder | download | duplicates (7)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Test EXPORTAS in importlibs.

RUN: split-file %s %t.dir && cd %t.dir
RUN: llvm-lib -machine:amd64 -def:test.def -out:test.lib

RUN: llvm-nm --print-armap test.lib | FileCheck --check-prefix=ARMAP %s

ARMAP:      Archive map
ARMAP-NEXT: __IMPORT_DESCRIPTOR_test in test.dll
ARMAP-NEXT: __NULL_IMPORT_DESCRIPTOR in test.dll
ARMAP-NEXT: __imp_func in test.dll
ARMAP-NEXT: __imp_func2 in test.dll
ARMAP-NEXT: __imp_func3 in test.dll
ARMAP-NEXT: __imp_mydata in test.dll
ARMAP-NEXT: func in test.dll
ARMAP-NEXT: func2 in test.dll
ARMAP-NEXT: func3 in test.dll
ARMAP-NEXT: test_NULL_THUNK_DATA in test.dll

RUN: llvm-readobj test.lib | FileCheck --check-prefix=READOBJ %s

READOBJ:      File: test.lib(test.dll)
READOBJ-NEXT: Format: COFF-x86-64
READOBJ-NEXT: Arch: x86_64
READOBJ-NEXT: AddressSize: 64bit
READOBJ-EMPTY:
READOBJ-NEXT: File: test.lib(test.dll)
READOBJ-NEXT: Format: COFF-x86-64
READOBJ-NEXT: Arch: x86_64
READOBJ-NEXT: AddressSize: 64bit
READOBJ-EMPTY:
READOBJ-NEXT: File: test.lib(test.dll)
READOBJ-NEXT: Format: COFF-x86-64
READOBJ-NEXT: Arch: x86_64
READOBJ-NEXT: AddressSize: 64bit
READOBJ-EMPTY:
READOBJ-NEXT: File: test.dll
READOBJ-NEXT: Format: COFF-import-file-x86-64
READOBJ-NEXT: Type: code
READOBJ-NEXT: Name type: export as
READOBJ-NEXT: Export name: expfunc
READOBJ-NEXT: Symbol: __imp_func
READOBJ-NEXT: Symbol: func
READOBJ-EMPTY:
READOBJ-NEXT: File: test.dll
READOBJ-NEXT: Format: COFF-import-file-x86-64
READOBJ-NEXT: Type: data
READOBJ-NEXT: Name type: export as
READOBJ-NEXT: Export name: expdata
READOBJ-NEXT: Symbol: __imp_mydata
READOBJ-EMPTY:
READOBJ-NEXT: File: test.dll
READOBJ-NEXT: Format: COFF-import-file-x86-64
READOBJ-NEXT: Type: code
READOBJ-NEXT: Name type: export as
READOBJ-NEXT: Export name: expfunc2
READOBJ-NEXT: Symbol: __imp_func2
READOBJ-NEXT: Symbol: func2
READOBJ-EMPTY:
READOBJ-NEXT: File: test.dll
READOBJ-NEXT: Format: COFF-import-file-x86-64
READOBJ-NEXT: Type: code
READOBJ-NEXT: Name type: export as
READOBJ-NEXT: Export name: expfunc3
READOBJ-NEXT: Symbol: __imp_func3
READOBJ-NEXT: Symbol: func3


EXPORTAS must be at the end of entry declaration.
RUN: not llvm-lib -machine:amd64 -def:test2.def -out:test2.lib 2>&1 \
RUN:              | FileCheck --check-prefix=ERROR %s
RUN: not llvm-lib -machine:amd64 -def:test3.def -out:test3.lib 2>&1 \
RUN:              | FileCheck --check-prefix=ERROR %s
ERROR: Invalid data was encountered while parsing the file


#--- test.def
LIBRARY test.dll
EXPORTS
        func EXPORTAS expfunc
        mydata DATA EXPORTAS expdata
        func2 = myfunc2 EXPORTAS expfunc2
        func3 = otherdll.otherfunc3 EXPORTAS expfunc3

#--- test2.def
LIBRARY test.dll
EXPORTS
        func EXPORTAS expfunc
        mydata EXPORTAS expdata DATA

#--- test3.def
LIBRARY test.dll
EXPORTS
        mydata EXPORTAS