llvm-project

Форк
0
/
winsysroot.test 
60 строк · 2.9 Кб
1
Check that /winsysroot results in the correct machine-specific subdirectory
2
being searched for the defaultlibs, for a 32-bit .obj.
3
# RUN: yaml2obj %p/Inputs/hello32.yaml -o %t.obj
4
# RUN: mkdir -p %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x86
5
# RUN: mkdir -p %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x64
6
# RUN: cp %p/Inputs/std32.lib %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x86
7
# RUN: cp %p/Inputs/std64.lib %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x64
8
# RUN: lld-link %t.obj /winsysroot:%t.dir/sysroot \
9
# RUN:          /defaultlib:std32 /entry:main@0
10

11
Check the same for a 64-bit input .obj.
12
# RUN: lld-link %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot \
13
# RUN:          /defaultlib:std64 /entry:main
14

15
Check directly passed lib with /machine:
16
# RUN: lld-link %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot /machine:x64 \
17
# RUN:          std64.lib /entry:main
18

19
# RUN: lld-link %t.obj /winsysroot:%t.dir/sysroot /machine:x86 \
20
# RUN:          std32.lib /entry:main
21

22
Check directly passed lib without /machine: (should infer from obj arch)
23
# RUN: lld-link %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot \
24
# RUN:          std64.lib /entry:main
25

26
# RUN: lld-link %t.obj /winsysroot:%t.dir/sysroot \
27
# RUN:          std32.lib /entry:main
28

29
Check that passing a lib from /winsysroot twice is ok
30
# RUN: lld-link %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot \
31
# RUN:          std64.lib std64.lib /entry:main
32

33
Check unknown library
34
# RUN: not lld-link %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot \
35
# RUN:          notfound.lib /entry:main 2>&1 | FileCheck --check-prefix=UNKNOWNLIB %s
36
UNKNOWNLIB: could not open 'notfound.lib'
37

38
If winsysroot lib appears before we can detect arch we don't find it
39
# RUN: not lld-link std64.lib %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot \
40
# RUN:          /entry:main 2>&1 | FileCheck --check-prefix=NO64 %s
41

42
Check we don't choose the wrong arch
43
# RUN: not lld-link %t.obj /winsysroot:%t.dir/sysroot \
44
# RUN:          std64.lib /entry:main 2>&1 | FileCheck --check-prefix=NO64 %s
45
NO64: could not open 'std64.lib'
46

47
# RUN: not lld-link %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot \
48
# RUN:          std32.lib /entry:main 2>&1 | FileCheck --check-prefix=NO32 %s
49
NO32: could not open 'std32.lib'
50

51
Check that when /winsysroot is specified, %LIB% is ignored.
52
# RUN: env LIB=%t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x86 not lld-link %t.obj /winsysroot:%t.dir/doesnotexist /defaultlib:std32 2>&1 | FileCheck -check-prefix=LIBIGNORED %s
53
LIBIGNORED: could not open 'std32.lib'
54

55
Check that when -lldmingw is specified, %LIB% is ignored.
56
# RUN: env LIB=%t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x86 not lld-link -lldmingw %t.obj /defaultlib:std32 2>&1 | FileCheck -check-prefix=LIBIGNORED_MINGW %s
57
LIBIGNORED_MINGW: could not open 'libstd32.a'
58

59
# RUN: not lld-link -lldmingw %t.obj /defaultlib:std32 /winsysroot:%t.dir/sysroot 2>&1 | FileCheck -check-prefix=IGNORED_ARG %s
60
IGNORED_ARG: warning: ignoring /vctoolsdir or /winsysroot flags in MinGW mode
61

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.