1Test EXPORTAS in importlibs. 2 3RUN: split-file %s %t.dir && cd %t.dir 4RUN: llvm-lib -machine:amd64 -def:test.def -out:test.lib 5 6RUN: llvm-nm --print-armap test.lib | FileCheck --check-prefix=ARMAP %s 7 8ARMAP: Archive map 9ARMAP-NEXT: __IMPORT_DESCRIPTOR_test in test.dll 10ARMAP-NEXT: __NULL_IMPORT_DESCRIPTOR in test.dll 11ARMAP-NEXT: __imp_func in test.dll 12ARMAP-NEXT: __imp_func2 in test.dll 13ARMAP-NEXT: __imp_func3 in test.dll 14ARMAP-NEXT: __imp_mydata in test.dll 15ARMAP-NEXT: func in test.dll 16ARMAP-NEXT: func2 in test.dll 17ARMAP-NEXT: func3 in test.dll 18ARMAP-NEXT: test_NULL_THUNK_DATA in test.dll 19 20RUN: llvm-readobj test.lib | FileCheck --check-prefix=READOBJ %s 21 22READOBJ: File: test.lib(test.dll) 23READOBJ-NEXT: Format: COFF-x86-64 24READOBJ-NEXT: Arch: x86_64 25READOBJ-NEXT: AddressSize: 64bit 26READOBJ-EMPTY: 27READOBJ-NEXT: File: test.lib(test.dll) 28READOBJ-NEXT: Format: COFF-x86-64 29READOBJ-NEXT: Arch: x86_64 30READOBJ-NEXT: AddressSize: 64bit 31READOBJ-EMPTY: 32READOBJ-NEXT: File: test.lib(test.dll) 33READOBJ-NEXT: Format: COFF-x86-64 34READOBJ-NEXT: Arch: x86_64 35READOBJ-NEXT: AddressSize: 64bit 36READOBJ-EMPTY: 37READOBJ-NEXT: File: test.dll 38READOBJ-NEXT: Format: COFF-import-file-x86-64 39READOBJ-NEXT: Type: code 40READOBJ-NEXT: Name type: export as 41READOBJ-NEXT: Export name: expfunc 42READOBJ-NEXT: Symbol: __imp_func 43READOBJ-NEXT: Symbol: func 44READOBJ-EMPTY: 45READOBJ-NEXT: File: test.dll 46READOBJ-NEXT: Format: COFF-import-file-x86-64 47READOBJ-NEXT: Type: data 48READOBJ-NEXT: Name type: export as 49READOBJ-NEXT: Export name: expdata 50READOBJ-NEXT: Symbol: __imp_mydata 51READOBJ-EMPTY: 52READOBJ-NEXT: File: test.dll 53READOBJ-NEXT: Format: COFF-import-file-x86-64 54READOBJ-NEXT: Type: code 55READOBJ-NEXT: Name type: export as 56READOBJ-NEXT: Export name: expfunc2 57READOBJ-NEXT: Symbol: __imp_func2 58READOBJ-NEXT: Symbol: func2 59READOBJ-EMPTY: 60READOBJ-NEXT: File: test.dll 61READOBJ-NEXT: Format: COFF-import-file-x86-64 62READOBJ-NEXT: Type: code 63READOBJ-NEXT: Name type: export as 64READOBJ-NEXT: Export name: expfunc3 65READOBJ-NEXT: Symbol: __imp_func3 66READOBJ-NEXT: Symbol: func3 67 68 69EXPORTAS must be at the end of entry declaration. 70RUN: not llvm-lib -machine:amd64 -def:test2.def -out:test2.lib 2>&1 \ 71RUN: | FileCheck --check-prefix=ERROR %s 72RUN: not llvm-lib -machine:amd64 -def:test3.def -out:test3.lib 2>&1 \ 73RUN: | FileCheck --check-prefix=ERROR %s 74ERROR: Invalid data was encountered while parsing the file 75 76 77#--- test.def 78LIBRARY test.dll 79EXPORTS 80 func EXPORTAS expfunc 81 mydata DATA EXPORTAS expdata 82 func2 = myfunc2 EXPORTAS expfunc2 83 func3 = otherdll.otherfunc3 EXPORTAS expfunc3 84 85#--- test2.def 86LIBRARY test.dll 87EXPORTS 88 func EXPORTAS expfunc 89 mydata EXPORTAS expdata DATA 90 91#--- test3.def 92LIBRARY test.dll 93EXPORTS 94 mydata EXPORTAS 95