Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / COFF / guardcf-thunk.s
blob6411a54ba71bc6576c7aa659fa8b82ec89b4e3a7
1 # REQUIRES: x86
3 # Make a DLL that exports exportfn1.
4 # RUN: yaml2obj %p/Inputs/export.yaml -o %t.obj
5 # RUN: lld-link /out:%t.dll /dll %t.obj /export:exportfn1 /implib:%t.lib
7 # Make an obj that takes the address of that exported function.
8 # RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t2.obj
9 # RUN: lld-link -entry:main -guard:cf %t2.obj %t.lib -nodefaultlib -out:%t.exe
10 # RUN: llvm-readobj --coff-load-config %t.exe | FileCheck %s
12 # Check that the gfids table contains *exactly* two entries, one for exportfn1
13 # and one for main.
14 # CHECK: GuardFidTable [
15 # CHECK-NEXT: 0x{{[0-9A-Fa-f]+0$}}
16 # CHECK-NEXT: 0x{{[0-9A-Fa-f]+0$}}
17 # CHECK-NEXT: ]
20 .def @feat.00;
21 .scl 3;
22 .type 0;
23 .endef
24 .globl @feat.00
25 @feat.00 = 0x001
27 .section .text,"rx"
28 .def main; .scl 2; .type 32; .endef
29 .global main
30 main:
31 leaq exportfn1(%rip), %rax
32 retq
34 .section .rdata,"dr"
35 .globl _load_config_used
36 _load_config_used:
37 .long 256
38 .fill 124, 1, 0
39 .quad __guard_fids_table
40 .quad __guard_fids_count
41 .long __guard_flags
42 .fill 128, 1, 0