2 # RUN: llvm-mc -triple i686-windows-msvc %s -filetype=obj -o %t.obj
3 # RUN: not lld-link %t.obj -safeseh -out:%t.exe -entry:main 2>&1 | FileCheck %s --check-prefix=ERROR
4 # safe seh should be on by default.
5 # RUN: not lld-link %t.obj -out:%t.exe -entry:main 2>&1 | FileCheck %s --check-prefix=ERROR
6 # RUN: lld-link %t.obj -safeseh:no -out:%t.exe -entry:main
7 # RUN: llvm-readobj --file-headers --coff-load-config %t.exe | FileCheck %s
8 # -lldmingw should also turn off safeseh by default.
9 # RUN: lld-link %t.obj -lldmingw -out:%t.exe -entry:main
10 # RUN: llvm-readobj --file-headers --coff-load-config %t.exe | FileCheck %s
12 # ERROR: /safeseh: {{.*}}safeseh-no.s.tmp.obj is not compatible with SEH
14 # CHECK: Characteristics [
15 # CHECK-NOT: IMAGE_DLL_CHARACTERISTICS_NO_SEH
19 # CHECK: SEHandlerTable: 0x0
20 # CHECK: SEHandlerCount: 0
25 # Explicitly mark the object as not having safeseh. LLD should error unless
26 # -safeseh:no is passed.
27 .def @feat.00; .scl 3; .type 0; .endef
35 .section .text,"xr",one_only,_main
41 # Add a handler to create an .sxdata section, which -safeseh:no should ignore.
42 .def _my_handler; .scl 3; .type 32;
44 .section .text,"xr",one_only,_my_handler
51 .globl __load_config_used
55 .long ___safe_se_handler_table
56 .long ___safe_se_handler_count