public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch gas/testsuite SEH x64]: Some initial tests about SEH pseudo-operators
@ 2010-09-12  9:44 Kai Tietz
  2010-09-12 15:10 ` Dave Korn
  0 siblings, 1 reply; 5+ messages in thread
From: Kai Tietz @ 2010-09-12  9:44 UTC (permalink / raw)
  To: Binutils; +Cc: Dave Korn

[-- Attachment #1: Type: text/plain, Size: 610 bytes --]

Hello,

this patch adds some x64 SEH related tests to gas' testsuite.

ChangeLog

2010-09-12  Kai Tietz

          * /gas/pe/pe_seh.exp: New.
          * /gas/pe/peseh-x64.s: New.
          * /gas/pe/peseh-x64.d: New.
          * /gas/pe/peseh-x64-2.s: New.
          * /gas/pe/peseh-x64-2.d: New.
          * /gas/pe/peseh-x64-3.s: New.
          * /gas/pe/peseh-x64-3.d: New.

Tested for x86_64-w64-mingw32 and for i686-pc-cygwin. Ok for apply?

Regards,
Kai

-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

[-- Attachment #2: pe_seh.diff --]
[-- Type: application/octet-stream, Size: 4949 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch gas/testsuite SEH x64]: Some initial tests about SEH pseudo-operators
  2010-09-12  9:44 [patch gas/testsuite SEH x64]: Some initial tests about SEH pseudo-operators Kai Tietz
@ 2010-09-12 15:10 ` Dave Korn
  2010-09-12 15:39   ` Kai Tietz
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Korn @ 2010-09-12 15:10 UTC (permalink / raw)
  To: Kai Tietz; +Cc: Binutils, Dave Korn

On 12/09/2010 10:43, Kai Tietz wrote:
> Hello,
> 
> this patch adds some x64 SEH related tests to gas' testsuite.

  Thank you!  Even these kinds of trivial smoke-tests are worthwhile.

> ChangeLog
> 
> 2010-09-12  Kai Tietz
> 
>           * /gas/pe/pe_seh.exp: New.
>           * /gas/pe/peseh-x64.s: New.
>           * /gas/pe/peseh-x64.d: New.
>           * /gas/pe/peseh-x64-2.s: New.
>           * /gas/pe/peseh-x64-2.d: New.
>           * /gas/pe/peseh-x64-3.s: New.
>           * /gas/pe/peseh-x64-3.d: New.
> 
> Tested for x86_64-w64-mingw32 and for i686-pc-cygwin. Ok for apply?

  Please let's not multiply expect scripts unnecessarily.  I can't think of
any reason not to just tag the "if ([istarget "x86_64-*-mingw*"])" clause onto
the end of the existing gas/pe/pe.exp, so OK with that change.  Also, don't
forget to remove those leading slashes from the filenames in your changelog
entry when you check it in.

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch gas/testsuite SEH x64]: Some initial tests about SEH pseudo-operators
  2010-09-12 15:10 ` Dave Korn
@ 2010-09-12 15:39   ` Kai Tietz
  2010-09-12 16:35     ` Dave Korn
  0 siblings, 1 reply; 5+ messages in thread
From: Kai Tietz @ 2010-09-12 15:39 UTC (permalink / raw)
  To: Dave Korn; +Cc: Binutils, Dave Korn

2010/9/12 Dave Korn <dave.korn.cygwin@gmail.com>:
> On 12/09/2010 10:43, Kai Tietz wrote:
>> Hello,
>>
>> this patch adds some x64 SEH related tests to gas' testsuite.
>
>  Thank you!  Even these kinds of trivial smoke-tests are worthwhile.
>
>> ChangeLog
>>
>> 2010-09-12  Kai Tietz
>>
>>           * /gas/pe/pe_seh.exp: New.
>>           * /gas/pe/peseh-x64.s: New.
>>           * /gas/pe/peseh-x64.d: New.
>>           * /gas/pe/peseh-x64-2.s: New.
>>           * /gas/pe/peseh-x64-2.d: New.
>>           * /gas/pe/peseh-x64-3.s: New.
>>           * /gas/pe/peseh-x64-3.d: New.
>>
>> Tested for x86_64-w64-mingw32 and for i686-pc-cygwin. Ok for apply?
>
>  Please let's not multiply expect scripts unnecessarily.  I can't think of
> any reason not to just tag the "if ([istarget "x86_64-*-mingw*"])" clause onto
> the end of the existing gas/pe/pe.exp, so OK with that change.  Also, don't
> forget to remove those leading slashes from the filenames in your changelog
> entry when you check it in.
>
>    cheers,
>      DaveK
>
>

Hmm, I think it is worth having here a separate .exp script. SEH is
present for other PE-COFF targets, too. And so tests of features
should be grouped IMHO.
What make you think that it is better to have just on giant .exp files
containing everything unsorted?

Cheers,
Kai

PS: Thanks for the catch of those leading /


-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch gas/testsuite SEH x64]: Some initial tests about SEH pseudo-operators
  2010-09-12 15:39   ` Kai Tietz
@ 2010-09-12 16:35     ` Dave Korn
  2010-09-13  7:15       ` Kai Tietz
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Korn @ 2010-09-12 16:35 UTC (permalink / raw)
  To: Kai Tietz; +Cc: Binutils, Dave Korn

On 12/09/2010 16:39, Kai Tietz wrote:
> 2010/9/12 Dave Korn <dave.korn.cygwin:
>> On 12/09/2010 10:43, Kai Tietz wrote:

>>> this patch adds some x64 SEH related tests to gas' testsuite.

>>>           * /gas/pe/pe_seh.exp: New.

>>  Please let's not multiply expect scripts unnecessarily.  I can't think of
>> any reason not to just tag the "if ([istarget "x86_64-*-mingw*"])" clause onto
>> the end of the existing gas/pe/pe.exp, 

> Hmm, I think it is worth having here a separate .exp script. SEH is
> present for other PE-COFF targets, too. And so tests of features
> should be grouped IMHO.

  That is a non-sequitur.  Yes, SEH is present for other PE-COFF targets too,
but they could run the tests just the same regardless of whether those tests
are in the same .exp file or a separate one.

> What make you think that it is better to have just on giant .exp files
> containing everything unsorted?

  There's no need for it to be "unsorted"; tests within the file can still be
arranged into logical groups, and the whole thing formatted nicely.  Nor will
it be "giant"; there's only a few lines of tests in there already, so adding a
handful more won't make it giant.  (If we had hundreds of tests in there,
you'd have a point, but that's not going to happen any time in the foreseeable
future, so let's cross that bridge /if/ we come to it!)

  My advice is based on Alan's advice to me in an earlier thread(*):

> Yes, this was to avoid proliferation of .exp files.  More
> .exp files means slightly slower testsuite runs, for all targets.
> There isn't really any reason to put simple run_dump_test style tests
> in separate files.  You can select targets, set as and ld flags
> etc. all in their .d files.  I think the ideal is one main .exp file
> per directory to handle all the simple tests, with other .exp files as
> necessary for more complex tests, but it's not terribly important.

  Your new .exp file has 38 lines, of which all but 5 are an exact duplicate
of the contents of the existing pe.exp.  Redundancy is bad, and so is
redundancy!  This is why I can't see any value in having them in a separate file.

    cheers,
      DaveK
-- 
(*) - http://sourceware.org/ml/binutils/2009-05/msg00263.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch gas/testsuite SEH x64]: Some initial tests about SEH pseudo-operators
  2010-09-12 16:35     ` Dave Korn
@ 2010-09-13  7:15       ` Kai Tietz
  0 siblings, 0 replies; 5+ messages in thread
From: Kai Tietz @ 2010-09-13  7:15 UTC (permalink / raw)
  To: Dave Korn; +Cc: Binutils, Dave Korn

2010/9/12 Dave Korn <dave.korn.cygwin@gmail.com>:
> On 12/09/2010 16:39, Kai Tietz wrote:
>> 2010/9/12 Dave Korn <dave.korn.cygwin:
>>> On 12/09/2010 10:43, Kai Tietz wrote:
>
>>>> this patch adds some x64 SEH related tests to gas' testsuite.
>
>>>>           * /gas/pe/pe_seh.exp: New.
>
>>>  Please let's not multiply expect scripts unnecessarily.  I can't think of
>>> any reason not to just tag the "if ([istarget "x86_64-*-mingw*"])" clause onto
>>> the end of the existing gas/pe/pe.exp,
>
>> Hmm, I think it is worth having here a separate .exp script. SEH is
>> present for other PE-COFF targets, too. And so tests of features
>> should be grouped IMHO.
>
>  That is a non-sequitur.  Yes, SEH is present for other PE-COFF targets too,
> but they could run the tests just the same regardless of whether those tests
> are in the same .exp file or a separate one.
>
>> What make you think that it is better to have just on giant .exp files
>> containing everything unsorted?
>
>  There's no need for it to be "unsorted"; tests within the file can still be
> arranged into logical groups, and the whole thing formatted nicely.  Nor will
> it be "giant"; there's only a few lines of tests in there already, so adding a
> handful more won't make it giant.  (If we had hundreds of tests in there,
> you'd have a point, but that's not going to happen any time in the foreseeable
> future, so let's cross that bridge /if/ we come to it!)
>
>  My advice is based on Alan's advice to me in an earlier thread(*):
>
>> Yes, this was to avoid proliferation of .exp files.  More
>> .exp files means slightly slower testsuite runs, for all targets.
>> There isn't really any reason to put simple run_dump_test style tests
>> in separate files.  You can select targets, set as and ld flags
>> etc. all in their .d files.  I think the ideal is one main .exp file
>> per directory to handle all the simple tests, with other .exp files as
>> necessary for more complex tests, but it's not terribly important.
>
>  Your new .exp file has 38 lines, of which all but 5 are an exact duplicate
> of the contents of the existing pe.exp.  Redundancy is bad, and so is
> redundancy!  This is why I can't see any value in having them in a separate file.
>
>    cheers,
>      DaveK
> --
> (*) - http://sourceware.org/ml/binutils/2009-05/msg00263.html
>
>

Ok, moved tests into pe.exp. Applied.

Cheers,
Kai

-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-09-13  7:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-12  9:44 [patch gas/testsuite SEH x64]: Some initial tests about SEH pseudo-operators Kai Tietz
2010-09-12 15:10 ` Dave Korn
2010-09-12 15:39   ` Kai Tietz
2010-09-12 16:35     ` Dave Korn
2010-09-13  7:15       ` Kai Tietz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).