| OLD | NEW |
| 1 # Copyright (C) 2002-2003, 2005, 2007-2012 Free Software Foundation, | 1 # Copyright (C) 2002-2003, 2005, 2007-2012 Free Software Foundation, |
| 2 # Inc. | 2 # Inc. |
| 3 # | 3 # |
| 4 # This program is free software; you can redistribute it and/or modify | 4 # This program is free software; you can redistribute it and/or modify |
| 5 # it under the terms of the GNU General Public License as published by | 5 # it under the terms of the GNU General Public License as published by |
| 6 # the Free Software Foundation; either version 3 of the License, or | 6 # the Free Software Foundation; either version 3 of the License, or |
| 7 # (at your option) any later version. | 7 # (at your option) any later version. |
| 8 # | 8 # |
| 9 # This program is distributed in the hope that it will be useful, | 9 # This program is distributed in the hope that it will be useful, |
| 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 # GNU General Public License for more details. | 12 # GNU General Public License for more details. |
| 13 # | 13 # |
| 14 # You should have received a copy of the GNU General Public License | 14 # You should have received a copy of the GNU General Public License |
| 15 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 # | 16 # |
| 17 | 17 |
| 18 # Tests for Powerpc AltiVec register setting and fetching | 18 # Tests for Powerpc AltiVec register setting and fetching |
| 19 | 19 |
| 20 if $tracelevel then { | |
| 21 strace $tracelevel | |
| 22 } | |
| 23 | |
| 24 # | 20 # |
| 25 # Test the use of registers, especially AltiVec registers, for Powerpc. | 21 # Test the use of registers, especially AltiVec registers, for Powerpc. |
| 26 # This file uses altivec-regs.c for input. | 22 # This file uses altivec-regs.c for input. |
| 27 # | 23 # |
| 28 | 24 |
| 29 | 25 |
| 30 if {![istarget "powerpc*"] || [skip_altivec_tests]} then { | 26 if {![istarget "powerpc*"] || [skip_altivec_tests]} then { |
| 31 verbose "Skipping altivec register tests." | 27 verbose "Skipping altivec register tests." |
| 32 return | 28 return |
| 33 } | 29 } |
| 34 | 30 |
| 35 set testfile "altivec-regs" | 31 set testfile "altivec-regs" |
| 36 set binfile ${objdir}/${subdir}/${testfile} | 32 set binfile ${objdir}/${subdir}/${testfile} |
| 37 set srcfile ${testfile}.c | 33 set srcfile ${testfile}.c |
| 38 | 34 |
| 39 set compile_flags {debug nowarnings} | 35 set compile_flags {debug nowarnings} |
| 40 if [get_compiler_info $binfile] { | 36 if [get_compiler_info] { |
| 41 warning "get_compiler failed" | 37 warning "get_compiler failed" |
| 42 return -1 | 38 return -1 |
| 43 } | 39 } |
| 44 | 40 |
| 45 if [test_compiler_info gcc*] { | 41 if [test_compiler_info gcc*] { |
| 46 set compile_flags "$compile_flags additional_flags=-maltivec additional_flag
s=-mabi=altivec" | 42 set compile_flags "$compile_flags additional_flags=-maltivec additional_flag
s=-mabi=altivec" |
| 47 } elseif [test_compiler_info xlc*] { | 43 } elseif [test_compiler_info xlc*] { |
| 48 set compile_flags "$compile_flags additional_flags=-qaltivec" | 44 set compile_flags "$compile_flags additional_flags=-qaltivec" |
| 49 } else { | 45 } else { |
| 50 warning "unknown compiler" | 46 warning "unknown compiler" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 gdb_test "down" \ | 221 gdb_test "down" \ |
| 226 ".0 vector_fun \\(a=.0x2020202, 0x2020202, 0x2020202, 0x2020202., b=.0x303030
3, 0x3030303, 0x3030303, 0x3030303.\\) at.*altivec-regs.c.*c = vec_add \\(a, b\\
);" \ | 222 ".0 vector_fun \\(a=.0x2020202, 0x2020202, 0x2020202, 0x2020202., b=.0x303030
3, 0x3030303, 0x3030303, 0x3030303.\\) at.*altivec-regs.c.*c = vec_add \\(a, b\\
);" \ |
| 227 "down to vector_fun" | 223 "down to vector_fun" |
| 228 | 224 |
| 229 gdb_test "finish" \ | 225 gdb_test "finish" \ |
| 230 "Run till exit from .0 vector_fun \\(a=.0x2020202, 0x2020202, 0x2020202, 0x20
20202., b=.0x3030303, 0x3030303, 0x3030303, 0x3030303.\\) at.*altivec-regs.c.*in
main \\(\\) at.*altivec-regs.c.*z = vector_fun \\(x, y\\);.*Value returned is.*
= .0x5050505, 0x5050505, 0x5050505, 0x5050505." \ | 226 "Run till exit from .0 vector_fun \\(a=.0x2020202, 0x2020202, 0x2020202, 0x20
20202., b=.0x3030303, 0x3030303, 0x3030303, 0x3030303.\\) at.*altivec-regs.c.*in
main \\(\\) at.*altivec-regs.c.*z = vector_fun \\(x, y\\);.*Value returned is.*
= .0x5050505, 0x5050505, 0x5050505, 0x5050505." \ |
| 231 "finish returned correct value" | 227 "finish returned correct value" |
| 232 | 228 |
| 233 | 229 |
| 234 | 230 |
| OLD | NEW |