• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Révision3099e1c48ab7a1218bc2105293ca44cd949d545d (tree)
l'heure2008-09-06 04:00:41
AuteurThiago Jung Bauermann <bauerman@br.i...>
CommiterThiago Jung Bauermann

Message de Log

* gdb.arch/ppc-fp.exp: New file.
* gdb.arch/ppc-fp.c: New file.

Change Summary

Modification

--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
1+2008-09-05 Thiago Jung Bauermann <bauerman@br.ibm.com>
2+
3+ * gdb.arch/ppc-fp.exp: New file.
4+ * gdb.arch/ppc-fp.c: New file.
5+
16 2008-09-05 Paul Pluzhnikov <ppluzhnikov@google.com>
27
38 *gdb.base/mips_pro.exp: compile with gcc -fno-inline,
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/ppc-fp.c
@@ -0,0 +1,36 @@
1+/* Copyright 2008 Free Software Foundation, Inc.
2+
3+ This file is part of GDB.
4+
5+ This program is free software; you can redistribute it and/or modify
6+ it under the terms of the GNU General Public License as published by
7+ the Free Software Foundation; either version 3 of the License, or
8+ (at your option) any later version.
9+
10+ This program is distributed in the hope that it will be useful,
11+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+ GNU General Public License for more details.
14+
15+ You should have received a copy of the GNU General Public License
16+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
17+
18+int
19+main (int argc, char *argv[])
20+{
21+ double result;
22+
23+ asm ("fdiv %0, %1, %1\n" /* Invalid operation. */
24+ : "=f" (result)
25+ : "f" (0.0));
26+
27+ asm ("mtfsf 0xff, %0\n" /* Reset FPSCR. */
28+ :
29+ : "f" (0.0));
30+
31+ asm ("fdiv %0, %1, %2\n" /* Division by zero. */
32+ : "=f" (result)
33+ : "f" (1.25), "f" (0.0));
34+
35+ return 0;
36+}
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/ppc-fp.exp
@@ -0,0 +1,100 @@
1+# Copyright (C) 2008 Free Software Foundation, Inc.
2+#
3+# This program is free software; you can redistribute it and/or modify
4+# it under the terms of the GNU General Public License as published by
5+# the Free Software Foundation; either version 3 of the License, or
6+# (at your option) any later version.
7+#
8+# This program is distributed in the hope that it will be useful,
9+# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+# GNU General Public License for more details.
12+#
13+# You should have received a copy of the GNU General Public License
14+# along with this program. If not, see <http://www.gnu.org/licenses/>.
15+#
16+# Please email any bugs, comments, and/or additions to this file to:
17+# bug-gdb@prep.ai.mit.edu
18+#
19+
20+# Tests for Powerpc floating point register setting and fetching
21+
22+if $tracelevel then {
23+ strace $tracelevel
24+}
25+
26+if ![istarget "powerpc*"] then {
27+ verbose "Skipping powerpc floating point register tests."
28+ return
29+}
30+
31+set testfile "ppc-fp"
32+set binfile ${objdir}/${subdir}/${testfile}
33+set srcfile ${testfile}.c
34+
35+if [get_compiler_info $binfile] {
36+ warning "get_compiler failed"
37+ return -1
38+}
39+
40+if ![test_compiler_info gcc*] {
41+ # We use GCC's extended asm syntax
42+ warning "unknown compiler"
43+ return -1
44+}
45+
46+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {quiet debug}] != "" } {
47+ verbose "Skipping FPSCR tests."
48+ return -1
49+}
50+
51+# Start with a fresh gdb.
52+
53+gdb_exit
54+gdb_start
55+gdb_reinitialize_dir $srcdir/$subdir
56+gdb_load ${binfile}
57+
58+gdb_breakpoint [gdb_get_line_number "Invalid operation."]
59+gdb_breakpoint [gdb_get_line_number "Division by zero."]
60+
61+gdb_run_cmd
62+
63+# When the prompt comes back we'll be in the invalid operation breakpoint.
64+gdb_expect { -re ".*$gdb_prompt $" {} }
65+
66+# First, verify if FPSCR exists and is all zeroes.
67+gdb_test_multiple "print \$fpscr" "FPSCR exists" {
68+ -re " = 0\[\r\n\]+$gdb_prompt $" { pass "FPSCR is all zeroes" }
69+
70+ -re " = void\[\r\n\]+$gdb_prompt $" {
71+ # There's no FPSCR. Skip this testcase.
72+ verbose "Skipping powerpc floating point register tests."
73+ return
74+ }
75+}
76+
77+# Step over invalid operation.
78+gdb_test "next" "" ""
79+
80+# Verify that the following bits are set (See Power ISA for details):
81+#
82+# 32 - Floating-Point Exception Summary (FX)
83+# 34 - Floating-Point Invalid Operation Summary (VX)
84+# 42 - Floating-Point Invalid Operation Exception (VXZDZ)
85+# 47 - Floating-Point Result Class Descriptor (C)
86+# 51 - Floating-Point Unordered or NaN (FU or ?)
87+gdb_test "print/t \$fpscr" " = 10100000001000010001000000000000" "FPSCR for invalid operation"
88+
89+gdb_continue_to_breakpoint "go to division by zero"
90+
91+# Step over division by zero.
92+gdb_test "next" "" ""
93+
94+# Verify that the following bits are set (See Power ISA for details):
95+#
96+# 32 - Floating-Point Exception Summary (FX)
97+# 37 - Floating-Point Zero Divide Exception (ZX)
98+# 49 - Floating-Point Greater Than or Positive (FG or >)
99+# 51 - Floating-Point Unordered or NaN (FU or ?)
100+gdb_test "print/t \$fpscr" " = 10000100000000000101000000000000" "FPSCR for division by zero"