Index: src/gas/testsuite/gas/pe/pe_seh.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ src/gas/testsuite/gas/pe/pe_seh.exp 2010-09-12 11:29:30.087780300 +0200 @@ -0,0 +1,38 @@ +# Expect control script for GAS testsuite PE SEH object-format-specific tests. + +# Copyright (C) 2010 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +# Please email any bugs, comments, and/or additions to this file to: +# binutils@gnu.org + +load_lib gas-dg.exp +load_lib gas-defs.exp + +# These tests can only be run on PE/COFF platforms. +if {![is_pecoff_format]} { + return +} + +# These tests are only for x86_64 targets +if ([istarget "x86_64-*-mingw*"]) then { + + run_dump_test "peseh-x64" + run_dump_test "peseh-x64-2" + run_dump_test "peseh-x64-3" +} + Index: src/gas/testsuite/gas/pe/peseh-x64-2.d =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ src/gas/testsuite/gas/pe/peseh-x64-2.d 2010-09-12 11:20:58.119497400 +0200 @@ -0,0 +1,7 @@ +#objdump: -s -j .xdata +#name: PE x64 SEH test 2 + +.*: .* + +Contents of section .xdata: + 0000 01080305 08320403 01500000 .* Index: src/gas/testsuite/gas/pe/peseh-x64-2.s =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ src/gas/testsuite/gas/pe/peseh-x64-2.s 2010-09-12 10:46:34.334455600 +0200 @@ -0,0 +1,26 @@ + .file "t2.c" + .text + .p2align 4,,15 + .globl foo + .def foo; .scl 2; .type 32; .endef + .seh_proc foo +foo: + pushq %rbp + .seh_pushreg %rbp + movq %rsp, %rbp + .seh_setframe %rbp, 0 + subq $32, %rsp + .seh_stackalloc 32 + .seh_endprologue + leal 1(%rcx), %eax + cltq + addq $30, %rax + andq $-16, %rax + call ___chkstk + leaq 32(%rsp), %rcx + call bar + movq %rbp, %rsp + popq %rbp + ret + .seh_endproc + .def bar; .scl 2; .type 32; .endef Index: src/gas/testsuite/gas/pe/peseh-x64-3.d =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ src/gas/testsuite/gas/pe/peseh-x64-3.d 2010-09-12 11:28:49.705470600 +0200 @@ -0,0 +1,9 @@ +#objdump: -s -j .xdata +#name: PE x64 SEH test 3 + +.*: .* + +Contents of section .xdata: + 0000 09080305 08520403 01500000 00000000 .....R...P...... + 0010 01000000 0f000000 1c000000 00000000 ................ + 0020 1c000000 .* Index: src/gas/testsuite/gas/pe/peseh-x64-3.s =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ src/gas/testsuite/gas/pe/peseh-x64-3.s 2010-09-12 11:26:59.303155900 +0200 @@ -0,0 +1,31 @@ + .file "t3.c" + .text + .globl nMainCRTStartup + .def nMainCRTStartup; .scl 2; .type 32; .endef + .seh_proc nMainCRTStartup +nMainCRTStartup: + pushq %rbp + .seh_pushreg %rbp + movq %rsp, %rbp + .seh_setframe %rbp, 0 + subq $48, %rsp + .seh_stackalloc 48 + .seh_endprologue + movl $255, -4(%rbp) +.l_startw: + .seh_handler __C_specific_handler, @except + .seh_handlerdata + .long 1 + .rva .l_startw, .l_endw, _gnu_exception_handler ,.l_endw + .text + call __security_init_cookie + call __tmainCRTStartup + movl %eax, -4(%rbp) +.l_endw: nop + movl -4(%rbp), %eax + addq $48, %rsp + popq %rbp + ret + .seh_endproc + .def __security_init_cookie; .scl 2; .type 32; .endef + .def __tmainCRTStartup; .scl 2; .type 32; .endef Index: src/gas/testsuite/gas/pe/peseh-x64.d =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ src/gas/testsuite/gas/pe/peseh-x64.d 2010-09-12 10:00:42.625066900 +0200 @@ -0,0 +1,7 @@ +#objdump: -s -j .xdata +#name: PE x64 SEH test 1 + +.*: .* + +Contents of section .xdata: + 0000 01040100 04020000 .* Index: src/gas/testsuite/gas/pe/peseh-x64.s =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ src/gas/testsuite/gas/pe/peseh-x64.s 2010-09-12 09:56:44.784463200 +0200 @@ -0,0 +1,14 @@ + .file "t1.c" + .text + .p2align 4,,15 + .globl foo + .def foo; .scl 2; .type 32; .endef + .seh_proc foo +foo: + subq $8, %rsp + .seh_stackalloc 8 + .seh_endprologue + movl $1, %eax + addq $8, %rsp + ret + .seh_endproc