2011-05-25 05:22:53 +08:00
|
|
|
# RUN: llvm-mc -triple x86_64-pc-win32 %s | FileCheck %s
|
|
|
|
|
2019-10-19 05:01:41 +08:00
|
|
|
# Round trip via intel syntax printing and back.
|
|
|
|
# RUN: llvm-mc -triple x86_64-pc-win32 %s -output-asm-variant=1 | \
|
|
|
|
# RUN: llvm-mc -triple x86_64-pc-win32 -x86-asm-syntax=intel | FileCheck %s
|
|
|
|
|
2011-05-25 05:22:53 +08:00
|
|
|
.text
|
|
|
|
.globl func
|
|
|
|
.def func; .scl 2; .type 32; .endef
|
|
|
|
.seh_proc func
|
2014-06-11 04:16:47 +08:00
|
|
|
# CHECK: .seh_proc func
|
2011-05-25 05:22:53 +08:00
|
|
|
func:
|
2011-05-25 12:08:15 +08:00
|
|
|
.seh_pushframe @code
|
2014-06-11 04:16:47 +08:00
|
|
|
# CHECK: .seh_pushframe @code
|
2011-05-25 09:33:42 +08:00
|
|
|
subq $24, %rsp
|
|
|
|
.seh_stackalloc 24
|
2014-06-11 04:16:47 +08:00
|
|
|
# CHECK: .seh_stackalloc 24
|
2011-05-25 12:51:25 +08:00
|
|
|
movq %rsi, 16(%rsp)
|
|
|
|
.seh_savereg %rsi, 16
|
2019-08-31 05:23:05 +08:00
|
|
|
# CHECK: .seh_savereg %rsi, 16
|
|
|
|
.seh_savereg 6, 16
|
|
|
|
# CHECK: .seh_savereg %rsi, 16
|
2011-05-25 12:51:25 +08:00
|
|
|
movups %xmm8, (%rsp)
|
|
|
|
.seh_savexmm %xmm8, 0
|
2019-08-31 05:23:05 +08:00
|
|
|
# CHECK: .seh_savexmm %xmm8, 0
|
|
|
|
.seh_savexmm 8, 0
|
|
|
|
# CHECK: .seh_savexmm %xmm8, 0
|
2011-05-26 05:43:45 +08:00
|
|
|
pushq %rbx
|
2019-08-31 05:23:05 +08:00
|
|
|
.seh_pushreg %rbx
|
|
|
|
# CHECK: .seh_pushreg %rbx
|
2011-05-26 05:43:45 +08:00
|
|
|
.seh_pushreg 3
|
2019-08-31 05:23:05 +08:00
|
|
|
# CHECK: .seh_pushreg %rbx
|
2011-05-26 05:43:45 +08:00
|
|
|
mov %rsp, %rbx
|
|
|
|
.seh_setframe 3, 0
|
2019-08-31 05:23:05 +08:00
|
|
|
# CHECK: .seh_setframe %rbx, 0
|
2011-05-25 05:22:53 +08:00
|
|
|
.seh_endprologue
|
2019-08-31 05:23:05 +08:00
|
|
|
# CHECK: .seh_endprologue
|
2011-05-25 09:33:42 +08:00
|
|
|
.seh_handler __C_specific_handler, @except
|
2019-08-31 05:23:05 +08:00
|
|
|
# CHECK: .seh_handler __C_specific_handler, @except
|
2011-05-26 05:43:45 +08:00
|
|
|
.seh_handlerdata
|
2019-08-31 05:23:05 +08:00
|
|
|
# CHECK-NOT: .section{{.*}}.xdata
|
|
|
|
# CHECK: .seh_handlerdata
|
2011-05-26 05:43:45 +08:00
|
|
|
.long 0
|
|
|
|
.text
|
2011-05-26 10:45:47 +08:00
|
|
|
.seh_startchained
|
|
|
|
.seh_endprologue
|
|
|
|
.seh_endchained
|
2014-06-11 04:16:47 +08:00
|
|
|
# CHECK: .text
|
|
|
|
# CHECK: .seh_startchained
|
|
|
|
# CHECK: .seh_endprologue
|
|
|
|
# CHECK: .seh_endchained
|
2011-05-26 05:43:45 +08:00
|
|
|
lea (%rbx), %rsp
|
|
|
|
pop %rbx
|
2011-05-25 09:33:42 +08:00
|
|
|
addq $24, %rsp
|
2011-05-25 05:22:53 +08:00
|
|
|
ret
|
|
|
|
.seh_endproc
|
2014-06-11 04:16:47 +08:00
|
|
|
# CHECK: .seh_endproc
|
2019-10-19 05:01:41 +08:00
|
|
|
|
|
|
|
# Re-run more or less the same test, but with intel syntax. Previously LLVM
|
|
|
|
# required percent prefixing in the .seh_* directives that take registers.
|
|
|
|
|
|
|
|
.intel_syntax noprefix
|
|
|
|
.text
|
|
|
|
.globl func_intel
|
|
|
|
.def func_intel; .scl 2; .type 32; .endef
|
|
|
|
.seh_proc func_intel
|
|
|
|
# CHECK: .seh_proc func_intel
|
|
|
|
func_intel:
|
|
|
|
sub RSP, 24
|
|
|
|
.seh_stackalloc 24
|
|
|
|
# CHECK: .seh_stackalloc 24
|
|
|
|
mov [16+RSP], RSI
|
|
|
|
.seh_savereg rsi, 16
|
|
|
|
# CHECK: .seh_savereg %rsi, 16
|
|
|
|
.seh_savereg 6, 16
|
|
|
|
# CHECK: .seh_savereg %rsi, 16
|
|
|
|
movups [RSP], XMM8
|
|
|
|
.seh_savexmm XMM8, 0
|
|
|
|
# CHECK: .seh_savexmm %xmm8, 0
|
|
|
|
.seh_savexmm 8, 0
|
|
|
|
# CHECK: .seh_savexmm %xmm8, 0
|
|
|
|
push rbx
|
|
|
|
.seh_pushreg rbx
|
|
|
|
# CHECK: .seh_pushreg %rbx
|
|
|
|
.seh_pushreg 3
|
|
|
|
# CHECK: .seh_pushreg %rbx
|
|
|
|
mov rbx, rsp
|
|
|
|
.seh_setframe rbx, 0
|
|
|
|
# CHECK: .seh_setframe %rbx, 0
|
|
|
|
.seh_endprologue
|
|
|
|
# CHECK: .seh_endprologue
|
|
|
|
.seh_handler __C_specific_handler, @except
|
|
|
|
# CHECK: .seh_handler __C_specific_handler, @except
|
|
|
|
.seh_handlerdata
|
|
|
|
# CHECK-NOT: .section{{.*}}.xdata
|
|
|
|
# CHECK: .seh_handlerdata
|
|
|
|
.long 0
|
|
|
|
.text
|
|
|
|
.seh_endproc
|