2015-06-17 08:16:33 +08:00
|
|
|
# RUN: yaml2obj < %p/Inputs/export.yaml > %t.obj
|
|
|
|
#
|
2015-08-07 00:47:46 +08:00
|
|
|
# RUN: lld-link /out:%t.dll /dll %t.obj /export:exportfn1 /export:exportfn2
|
2015-06-17 08:16:33 +08:00
|
|
|
# RUN: llvm-objdump -p %t.dll | FileCheck -check-prefix=CHECK1 %s
|
|
|
|
|
|
|
|
CHECK1: Export Table:
|
|
|
|
CHECK1: DLL name: export.test.tmp.dll
|
|
|
|
CHECK1: Ordinal RVA Name
|
|
|
|
CHECK1-NEXT: 0 0
|
|
|
|
CHECK1-NEXT: 1 0x1008 exportfn1
|
|
|
|
CHECK1-NEXT: 2 0x1010 exportfn2
|
|
|
|
|
2015-08-07 00:47:46 +08:00
|
|
|
# RUN: lld-link /out:%t.dll /dll %t.obj /export:exportfn1,@5 /export:exportfn2
|
2015-06-17 08:16:33 +08:00
|
|
|
# RUN: llvm-objdump -p %t.dll | FileCheck -check-prefix=CHECK2 %s
|
|
|
|
|
|
|
|
CHECK2: Export Table:
|
|
|
|
CHECK2: DLL name: export.test.tmp.dll
|
|
|
|
CHECK2: Ordinal RVA Name
|
|
|
|
CHECK2-NEXT: 0 0
|
|
|
|
CHECK2-NEXT: 1 0
|
|
|
|
CHECK2-NEXT: 2 0
|
|
|
|
CHECK2-NEXT: 3 0
|
|
|
|
CHECK2-NEXT: 4 0
|
|
|
|
CHECK2-NEXT: 5 0x1008 exportfn1
|
|
|
|
CHECK2-NEXT: 6 0x1010 exportfn2
|
|
|
|
CHECK2-NEXT: 7 0x1010 exportfn3
|
|
|
|
|
2015-08-07 00:47:46 +08:00
|
|
|
# RUN: lld-link /out:%t.dll /dll %t.obj /export:exportfn1,@5,noname /export:exportfn2
|
2015-06-17 08:16:33 +08:00
|
|
|
# RUN: llvm-objdump -p %t.dll | FileCheck -check-prefix=CHECK3 %s
|
|
|
|
|
|
|
|
CHECK3: Export Table:
|
|
|
|
CHECK3: DLL name: export.test.tmp.dll
|
|
|
|
CHECK3: Ordinal RVA Name
|
|
|
|
CHECK3-NEXT: 0 0
|
|
|
|
CHECK3-NEXT: 1 0
|
|
|
|
CHECK3-NEXT: 2 0
|
|
|
|
CHECK3-NEXT: 3 0
|
|
|
|
CHECK3-NEXT: 4 0
|
|
|
|
CHECK3-NEXT: 5 0x1008
|
|
|
|
CHECK3-NEXT: 6 0x1010 exportfn2
|
|
|
|
|
2017-08-16 13:23:00 +08:00
|
|
|
# RUN: lld-link /out:%t.dll /dll %t.obj /export:f1=exportfn1 /export:f2=exportfn2 /implib:%t.lib
|
2015-06-17 08:16:33 +08:00
|
|
|
# RUN: llvm-objdump -p %t.dll | FileCheck -check-prefix=CHECK4 %s
|
2017-08-16 13:23:00 +08:00
|
|
|
# RUN: llvm-nm %t.lib | FileCheck -check-prefix=CHECK4-NM %s
|
2015-06-17 08:16:33 +08:00
|
|
|
|
|
|
|
CHECK4: Export Table:
|
|
|
|
CHECK4: DLL name: export.test.tmp.dll
|
|
|
|
CHECK4: Ordinal RVA Name
|
|
|
|
CHECK4-NEXT: 0 0
|
|
|
|
CHECK4-NEXT: 1 0x1010 exportfn3
|
|
|
|
CHECK4-NEXT: 2 0x1008 f1
|
|
|
|
CHECK4-NEXT: 3 0x1010 f2
|
2017-08-16 13:23:00 +08:00
|
|
|
CHECK4-NM: 00000000 T f1
|
|
|
|
CHECK4-NM: 00000000 T f2
|
2015-06-18 03:19:25 +08:00
|
|
|
|
|
|
|
# RUN: echo "EXPORTS exportfn1 @3" > %t.def
|
|
|
|
# RUN: echo "fn2=exportfn2 @2" >> %t.def
|
2015-08-07 00:47:46 +08:00
|
|
|
# RUN: lld-link /out:%t.dll /dll %t.obj /def:%t.def
|
2015-06-18 03:19:25 +08:00
|
|
|
# RUN: llvm-objdump -p %t.dll | FileCheck -check-prefix=CHECK5 %s
|
|
|
|
|
|
|
|
CHECK5: Export Table:
|
|
|
|
CHECK5: DLL name: export.test.tmp.dll
|
|
|
|
CHECK5: Ordinal RVA Name
|
|
|
|
CHECK5-NEXT: 0 0
|
|
|
|
CHECK5-NEXT: 1 0
|
|
|
|
CHECK5-NEXT: 2 0x1010 fn2
|
|
|
|
CHECK5-NEXT: 3 0x1008 exportfn1
|
|
|
|
CHECK5-NEXT: 4 0x1010 exportfn3
|
2015-07-04 07:23:29 +08:00
|
|
|
|
2015-09-02 15:27:31 +08:00
|
|
|
# RUN: lld-link /out:%t.DLL /dll %t.obj /export:exportfn1 /export:exportfn2 \
|
2015-07-04 07:23:29 +08:00
|
|
|
# RUN: /export:exportfn1 /export:exportfn2,@5 >& %t.log
|
|
|
|
# RUN: FileCheck -check-prefix=CHECK6 %s < %t.log
|
|
|
|
|
|
|
|
CHECK6: duplicate /export option: exportfn2
|
|
|
|
CHECK6-NOT: duplicate /export option: exportfn1
|
2015-09-01 14:46:10 +08:00
|
|
|
|
|
|
|
# RUN: llvm-nm -M %t.lib | FileCheck --check-prefix=SYMTAB %s
|
|
|
|
|
2015-09-02 15:27:31 +08:00
|
|
|
SYMTAB: __imp_exportfn1 in export.test.tmp.DLL
|
|
|
|
SYMTAB: exportfn1 in export.test.tmp.DLL
|
|
|
|
SYMTAB: __imp_exportfn2 in export.test.tmp.DLL
|
|
|
|
SYMTAB: exportfn2 in export.test.tmp.DLL
|
|
|
|
SYMTAB: __imp_exportfn3 in export.test.tmp.DLL
|
|
|
|
SYMTAB: exportfn3 in export.test.tmp.DLL
|
2016-01-09 09:22:00 +08:00
|
|
|
|
|
|
|
# RUN: lld-link /out:%t.dll /dll %t.obj /export:foo=kernel32.foobar
|
|
|
|
# RUN: llvm-objdump -p %t.dll | FileCheck -check-prefix=FORWARDER %s
|
|
|
|
|
|
|
|
FORWARDER: Export Table:
|
|
|
|
FORWARDER: DLL name: export.test.tmp.dll
|
|
|
|
FORWARDER: Ordinal base: 0
|
|
|
|
FORWARDER: Ordinal RVA Name
|
|
|
|
FORWARDER: 0 0
|
|
|
|
FORWARDER: 1 0x1010 exportfn
|
2016-01-13 07:29:42 +08:00
|
|
|
FORWARDER: 2 foo (forwarded to kernel32.foobar)
|