OSDN Git Service

gcc/testsuite
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / lib / target-supports.exp
index d4242e6..68b6206 100644 (file)
@@ -454,6 +454,14 @@ proc check_effective_target_fpic { } {
     return 0
 }
 
+# Return true if the target supports -mpaired-single (as used on MIPS).
+
+proc check_effective_target_mpaired_single { } {
+    return [check_no_compiler_messages freorder object {
+       void foo (void) { }
+    } "-mpaired-single"]
+}
+
 # Return true if iconv is supported on the target. In particular IBM1047.
 
 proc check_iconv_available { test_what } {
@@ -981,7 +989,7 @@ proc check_cxa_atexit_available { } {
        puts $f "{ return 0; }"
        close $f
 
-       set lines [v3_target_compile $src $exe executable ""]
+       set lines [${tool}_target_compile $src $exe executable ""]
        file delete $src
 
        if [string match "" $lines] {
@@ -1226,6 +1234,40 @@ proc check_effective_target_arm32 { } {
     return $et_arm32_saved
 }
 
+# Return 1 if this is a PowerPC target with floating-point registers.
+
+proc check_effective_target_powerpc_fprs { } {
+    if { [istarget powerpc*-*-*]
+        || [istarget rs6000-*-*] } {
+       return [check_no_compiler_messages powerpc_fprs object {
+           #ifdef __NO_FPRS__
+           #error no FPRs
+           #else
+           int dummy;
+           #endif
+       }]
+    } else {
+       return 0
+    }
+}
+
+# Return 1 if this is a PowerPC target supporting -maltivec.
+
+proc check_effective_target_powerpc_altivec_ok { } {
+    if { [istarget powerpc*-*-*]
+        || [istarget rs6000-*-*] } {
+       # AltiVec is not supported on Aix.
+       if { [istarget powerpc*-*-aix*] } {
+           return 0
+       }
+       return [check_no_compiler_messages powerpc_altivec_ok object {
+           int dummy;
+       } "-maltivec"]
+    } else {
+       return 0
+    }
+}
+
 # Return 1 if the target supports hardware vector shift operation.
 
 proc check_effective_target_vect_shift { } {