Skip to content

Commit 3c52ce8

Browse files
committed
fix test
1 parent 9e6664e commit 3c52ce8

12 files changed

+105
-20
lines changed

lld/test/COFF/cetcompat.test

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
RUN: yaml2obj %p/Inputs/hascetret42.yaml -o %t.obj
2+
RUN: lld-link /out:%t.exe /entry:main /cetcompat %t.obj
3+
RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck %s
4+
5+
CHECK: DebugEntry {
6+
CHECK: Characteristics: 0x0
7+
CHECK: Type: ExtendedDLLCharacteristics (0x14)
8+
CHECK: ExtendedCharacteristics [ (0x1)
9+
CHECK: IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT (0x1)
10+
CHECK: ]
11+
CHECK: RawData (
12+
CHECK: 0000: 01000000 |....|
13+
CHECK: )
14+
CHECK: }
15+

lld/test/COFF/cetcompatstrict.test

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
RUN: yaml2obj %p/Inputs/ret42.yaml -o %t.obj
2+
RUN: lld-link /out:%t.exe /entry:main /cetcompatstrict %t.obj
3+
RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck %s
4+
5+
CHECK: DebugEntry {
6+
CHECK: Characteristics: 0x0
7+
CHECK: Type: ExtendedDLLCharacteristics (0x14)
8+
CHECK: ExtendedCharacteristics [ (0x2)
9+
CHECK: IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT_STRICT_MODE (0x2)
10+
CHECK: ]
11+
CHECK: RawData (
12+
CHECK: 0000: 02000000 |....|
13+
CHECK: )
14+
CHECK: }
15+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
RUN: yaml2obj %p/Inputs/ret42.yaml -o %t.obj
2+
RUN: lld-link /out:%t.exe /entry:main /cetdynamicapisinproc %t.obj
3+
RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck %s
4+
5+
CHECK: DebugEntry {
6+
CHECK: Characteristics: 0x0
7+
CHECK: Type: ExtendedDLLCharacteristics (0x14)
8+
CHECK: ExtendedCharacteristics [ (0x8)
9+
CHECK: IMAGE_DLL_CHARACTERISTICS_EX_CET_DYNAMIC_APIS_ALLOW_IN_PROC_ONLY (0x8)
10+
CHECK: ]
11+
CHECK: RawData (
12+
CHECK: 0000: 08000000 |....|
13+
CHECK: )
14+
CHECK: }
15+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
RUN: yaml2obj %p/Inputs/ret42.yaml -o %t.obj
2+
RUN: lld-link /out:%t.exe /entry:main /cetipvalidationrelaxed %t.obj
3+
RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck %s
4+
5+
CHECK: DebugEntry {
6+
CHECK: Characteristics: 0x0
7+
CHECK: Type: ExtendedDLLCharacteristics (0x14)
8+
CHECK: ExtendedCharacteristics [ (0x4)
9+
CHECK: IMAGE_DLL_CHARACTERISTICS_EX_CET_SET_CONTEXT_IP_VALIDATION_RELAXED_MODE (0x4)
10+
CHECK: ]
11+
CHECK: RawData (
12+
CHECK: 0000: 04000000 |....|
13+
CHECK: )
14+
CHECK: }
15+

lld/test/COFF/hotpatchcompatible.test

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
RUN: yaml2obj %p/Inputs/ret42.yaml -o %t.obj
2+
RUN: lld-link /out:%t.exe /entry:main /hotpatchcompatible %t.obj
3+
RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck %s
4+
5+
CHECK: DebugEntry {
6+
CHECK: Characteristics: 0x0
7+
CHECK: Type: ExtendedDLLCharacteristics (0x14)
8+
CHECK: ExtendedCharacteristics [ (0x80)
9+
CHECK: IMAGE_DLL_CHARACTERISTICS_EX_HOTPATCH_COMPATIBLE (0x80)
10+
CHECK: ]
11+
CHECK: RawData (
12+
CHECK: 0000: 80000000 |....|
13+
CHECK: )
14+
CHECK: }
15+
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--- !COFF
2+
header:
3+
Machine: IMAGE_FILE_MACHINE_AMD64
4+
Characteristics: []
5+
sections:
6+
- Name: .text
7+
Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
8+
SectionData: B82A000000C3 # mov eax, 42; ret
9+
symbols:
10+
- Name: main
11+
Value: 0
12+
SectionNumber: 1
13+
SimpleType: IMAGE_SYM_TYPE_NULL
14+
ComplexType: IMAGE_SYM_DTYPE_FUNCTION
15+
StorageClass: IMAGE_SYM_CLASS_EXTERNAL

llvm/test/tools/llvm-readobj/COFF/cetcompat.test

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# To regenerate has-cet.exe
2-
# $ echo int main() { return 0; } > has-cet.c
3-
# $ cl has-cet.c /link /cetcompat
4-
RUN: llvm-readobj --coff-debug-directory %p/Inputs/has-cet.exe | FileCheck %s
1+
RUN: yaml2obj %p/Inputs/hascetret42.yaml -o %t.obj
2+
RUN: lld-link /out:%t.exe /entry:main /cetcompat %t.obj
3+
RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck %s
54

65
CHECK: DebugEntry {
76
CHECK: Characteristics: 0x0

llvm/test/tools/llvm-readobj/COFF/cetcompatstrict.test

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# To regenerate has-cetstrict.exe
2-
# $ echo int main() { return 0; } > has-cetstrict.c
3-
# $ cl has-cetstrict.c /link /cetcompatstrict
4-
RUN: llvm-readobj --coff-debug-directory %p/Inputs/has-cetstrict.exe | FileCheck %s
1+
RUN: yaml2obj %p/Inputs/hascetret42.yaml -o %t.obj
2+
RUN: lld-link /out:%t.exe /entry:main /cetcompatstrict %t.obj
3+
RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck %s
54

65
CHECK: DebugEntry {
76
CHECK: Characteristics: 0x0

llvm/test/tools/llvm-readobj/COFF/cetdynamicapisinproc.test

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# To regenerate has-cetdynamicapisinproc.exe
2-
# $ echo int main() { return 0; } > has-cetdynamicapisinproc.c
3-
# $ cl has-cetdynamicapisinproc.c /link /cetdynamicapisinproc
4-
RUN: llvm-readobj --coff-debug-directory %p/Inputs/has-cetdynamicapisinproc.exe | FileCheck %s
1+
RUN: yaml2obj %p/Inputs/hascetret42.yaml -o %t.obj
2+
RUN: lld-link /out:%t.exe /entry:main /cetdynamicapisinproc %t.obj
3+
RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck %s
54

65
CHECK: DebugEntry {
76
CHECK: Characteristics: 0x0

0 commit comments

Comments
 (0)