aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gas/testsuite/ChangeLog10
-rwxr-xr-xgas/testsuite/gas/pe/pe.exp10
-rw-r--r--gas/testsuite/gas/pe/peseh-x64-2.d7
-rw-r--r--gas/testsuite/gas/pe/peseh-x64-2.s26
-rw-r--r--gas/testsuite/gas/pe/peseh-x64-3.d9
-rw-r--r--gas/testsuite/gas/pe/peseh-x64-3.s31
-rw-r--r--gas/testsuite/gas/pe/peseh-x64.d7
-rw-r--r--gas/testsuite/gas/pe/peseh-x64.s14
8 files changed, 114 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 988d073..83ff1bd 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2010-09-13 Kai Tietz <kai.tietz@onevision.com>
+
+ * gas/pe/pe.exp: Add x64 SEH tests.
+ * 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.
+
2010-09-09 Nick Clifton <nickc@redhat.com>
PR gas/11973
diff --git a/gas/testsuite/gas/pe/pe.exp b/gas/testsuite/gas/pe/pe.exp
index aadf972..8982719 100755
--- a/gas/testsuite/gas/pe/pe.exp
+++ b/gas/testsuite/gas/pe/pe.exp
@@ -35,3 +35,13 @@ run_dump_test "aligncomm-d"
run_dump_test "section-align-1"
run_dump_test "section-align-3"
+
+# SEH related tests
+
+# 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"
+}
diff --git a/gas/testsuite/gas/pe/peseh-x64-2.d b/gas/testsuite/gas/pe/peseh-x64-2.d
new file mode 100644
index 0000000..acfd727
--- /dev/null
+++ b/gas/testsuite/gas/pe/peseh-x64-2.d
@@ -0,0 +1,7 @@
+#objdump: -s -j .xdata
+#name: PE x64 SEH test 2
+
+.*: .*
+
+Contents of section .xdata:
+ 0000 01080305 08320403 01500000 .*
diff --git a/gas/testsuite/gas/pe/peseh-x64-2.s b/gas/testsuite/gas/pe/peseh-x64-2.s
new file mode 100644
index 0000000..d43df94
--- /dev/null
+++ b/gas/testsuite/gas/pe/peseh-x64-2.s
@@ -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
diff --git a/gas/testsuite/gas/pe/peseh-x64-3.d b/gas/testsuite/gas/pe/peseh-x64-3.d
new file mode 100644
index 0000000..9ec6458
--- /dev/null
+++ b/gas/testsuite/gas/pe/peseh-x64-3.d
@@ -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 .*
diff --git a/gas/testsuite/gas/pe/peseh-x64-3.s b/gas/testsuite/gas/pe/peseh-x64-3.s
new file mode 100644
index 0000000..dc132f8
--- /dev/null
+++ b/gas/testsuite/gas/pe/peseh-x64-3.s
@@ -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
diff --git a/gas/testsuite/gas/pe/peseh-x64.d b/gas/testsuite/gas/pe/peseh-x64.d
new file mode 100644
index 0000000..8af15ab
--- /dev/null
+++ b/gas/testsuite/gas/pe/peseh-x64.d
@@ -0,0 +1,7 @@
+#objdump: -s -j .xdata
+#name: PE x64 SEH test 1
+
+.*: .*
+
+Contents of section .xdata:
+ 0000 01040100 04020000 .*
diff --git a/gas/testsuite/gas/pe/peseh-x64.s b/gas/testsuite/gas/pe/peseh-x64.s
new file mode 100644
index 0000000..05afabf
--- /dev/null
+++ b/gas/testsuite/gas/pe/peseh-x64.s
@@ -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