[clang-tidy][use-internal-linkage]fix false positives for global overloaded operator...
[llvm-project.git] / lld / test / COFF / guard-ehcont.s
blob73807688feee666850efa2b73cfd310956e61778
1 # REQUIRES: x86
2 # RUN: llvm-mc -triple x86_64-windows-msvc %s -filetype=obj -o %t.obj
3 # RUN: lld-link %t.obj -guard:cf -guard:ehcont -out:%t.exe -entry:main
4 # RUN: llvm-readobj --file-headers --coff-load-config %t.exe | FileCheck %s
6 # CHECK: ImageBase: 0x140000000
7 # CHECK: LoadConfig [
8 # CHECK: SEHandlerTable: 0x0
9 # CHECK: SEHandlerCount: 0
10 # CHECK: GuardCFCheckFunction: 0x0
11 # CHECK: GuardCFCheckDispatch: 0x0
12 # CHECK: GuardCFFunctionTable: 0x14000{{.*}}
13 # CHECK: GuardCFFunctionCount: 1
14 # CHECK: GuardFlags [ (0x400500)
15 # CHECK: CF_FUNCTION_TABLE_PRESENT (0x400)
16 # CHECK: CF_INSTRUMENTED (0x100)
17 # CHECK: EH_CONTINUATION_TABLE_PRESENT (0x400000)
18 # CHECK: ]
19 # CHECK: GuardAddressTakenIatEntryTable: 0x0
20 # CHECK: GuardAddressTakenIatEntryCount: 0
21 # CHECK: GuardEHContinuationTable: 0x14000{{.*}}
22 # CHECK: GuardEHContinuationCount: 2
23 # CHECK: ]
24 # CHECK: GuardEHContTable [
25 # CHECK-NEXT: 0x14000{{.*}}
26 # CHECK-NEXT: 0x14000{{.*}}
27 # CHECK-NEXT: ]
29 # We need @feat.00 to have 0x4000 to indicate /guard:ehcont.
30 .def @feat.00;
31 .scl 3;
32 .type 0;
33 .endef
34 .globl @feat.00
35 @feat.00 = 0x4000
36 .def main; .scl 2; .type 32; .endef
37 .globl main # -- Begin function main
38 .p2align 4, 0x90
39 main:
40 .seh_proc main
41 .seh_handler __C_specific_handler, @unwind, @except
42 .seh_handlerdata
43 .long 2
44 .long (seh_begin)@IMGREL
45 .long (seh_end)@IMGREL
46 .long 1
47 .long (seh_except)@IMGREL
48 .long (seh2_begin)@IMGREL
49 .long (seh2_end)@IMGREL
50 .long 1
51 .long (seh2_except)@IMGREL
52 .text
53 seh_begin:
54 nop
55 int3
56 nop
57 seh_end:
58 nop
59 seh_except:
60 nop
62 seh2_begin:
63 nop
64 int3
65 nop
66 seh2_end:
67 nop
68 seh2_except:
69 nop
71 xor %eax, %eax
72 ret
73 .seh_endproc
75 __C_specific_handler:
76 ret
78 .section .gehcont$y,"dr"
79 .symidx seh_except
80 .symidx seh2_except
82 .section .rdata,"dr"
83 .globl _load_config_used
84 _load_config_used:
85 .long 312
86 .fill 124, 1, 0
87 .quad __guard_fids_table
88 .quad __guard_fids_count
89 .long __guard_flags
90 .fill 12, 1, 0
91 .quad __guard_iat_table
92 .quad __guard_iat_count
93 .quad __guard_longjmp_table
94 .quad __guard_longjmp_count
95 .fill 72, 1, 0
96 .quad __guard_eh_cont_table
97 .quad __guard_eh_cont_count
98 .fill 32, 1, 0