* gdb.arch/altivec-abi.exp: Check for compiler and set
authorPaul Gilliam <pgilliam@us.ibm.com>
Fri, 1 Apr 2005 18:43:22 +0000 (18:43 +0000)
committerPaul Gilliam <pgilliam@us.ibm.com>
Fri, 1 Apr 2005 18:43:22 +0000 (18:43 +0000)
        use altivec' flag accordingly.
        * gdb.arch/altivec-regs.exp: Likewise.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/altivec-abi.exp
gdb/testsuite/gdb.arch/altivec-regs.exp

index 0e8dfdf2a34c5344d7f76e7e7222e793e2b91e94..769f54f78e3a37eb83923b06af7256fd0ffc67ab 100644 (file)
@@ -1,3 +1,9 @@
+2005-04-01  Paul Gilliam  <pgilliam@us.ibm.com>
+
+       * gdb.arch/altivec-abi.exp: Check for compiler and set
+       use altivec' flag accordingly.
+       * gdb.arch/altivec-regs.exp: Likewise.
+
 2005-03-29  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * gdb.base/ptr-typedef.exp, gdb.base/ptr-typedef.c: New files.
index 70fc3e01b21b448b55d3d24693581a23783207cd..6b22c9a20c5ea7c0b894c00eff3f080ef2f411b1 100644 (file)
@@ -41,7 +41,22 @@ set testfile "altivec-abi"
 set binfile ${objdir}/${subdir}/${testfile}
 set srcfile ${testfile}.c
 
-if  { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug additional_flags=-w}] != "" } {
+set compile_flags {debug additional_flags=-w}
+if [get_compiler_info $binfile] {
+    warning "get_compiler failed"
+    return -1
+}
+
+if [test_compiler_info gcc*] {
+    set compile_flags "$compile_flags additional_flags=-maltivec"
+} elseif [test_compiler_info xlc*] {
+    set compile_flags "$compile_flags additional_flags=-qaltivec"
+} else {
+    warning "unknown compiler"
+    return -1
+}
+
+if  { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable $compile_flags] != "" } {
      gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
 }
 
index fe8ec21ebcd18bf455433dfff8167149aa90b68a..a1330d0a8d279c0dd10a77ec6ba407d4413c4149 100644 (file)
@@ -41,7 +41,22 @@ set testfile "altivec-regs"
 set binfile ${objdir}/${subdir}/${testfile}
 set srcfile ${testfile}.c
 
-if  { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug additional_flags=-w}] != "" } {
+set compile_flags {debug additional_flags=-w}
+if [get_compiler_info $binfile] {
+    warning "get_compiler failed"
+    return -1
+}
+
+if [test_compiler_info gcc*] {
+    set compile_flags "$compile_flags additional_flags=-maltivec"
+} elseif [test_compiler_info xlc*] {
+    set compile_flags "$compile_flags additional_flags=-qaltivec"
+} else {
+    warning "unknown compiler"
+    return -1
+}
+
+if  { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable $compile_flags] != "" } {
      gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
 }