Skip to content

Commit 9ef907a

Browse files
committed
[LLD][COFF] Add test for situations where /nodelaultlib doesn't take effect
1 parent e95aef0 commit 9ef907a

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

lld/test/COFF/Inputs/defaultlib.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--- !COFF
2+
header:
3+
Machine: IMAGE_FILE_MACHINE_AMD64
4+
Characteristics: [ ]
5+
sections:
6+
- Name: .drectve
7+
Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
8+
Alignment: 1
9+
SectionData: 202F44454641554C544C49423A64656661756C742E6C6962
10+
SizeOfRawData: 24
11+
symbols:
12+
- Name: .drectve
13+
Value: 0
14+
SectionNumber: 1
15+
SimpleType: IMAGE_SYM_TYPE_NULL
16+
ComplexType: IMAGE_SYM_DTYPE_NULL
17+
StorageClass: IMAGE_SYM_CLASS_STATIC
18+
SectionDefinition:
19+
Length: 24
20+
NumberOfRelocations: 0
21+
NumberOfLinenumbers: 0
22+
CheckSum: 2526009418
23+
Number: 1
24+
...

lld/test/COFF/nodefaultlib.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,8 @@ MSVC stamps uppercase references in OBJ directives, thus ensure that passing low
3636

3737
UPPERCASE-NOT: OLDNAMES
3838
UPPERCASE-NOT: LIBCMT
39+
40+
# RUN: yaml2obj -o %T/defaultlib.obj %p/Inputs/defaultlib.yaml
41+
# RUN: mkdir -p %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x64
42+
# RUN: cp %p/Inputs/ret42.lib %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x64/default.lib
43+
# RUN: not lld-link /winsysroot:%t.dir/sysroot /out:%t.exe /entry:main /subsystem:console /nodefaultlib:default.lib %T/defaultlib.obj

0 commit comments

Comments
 (0)