Make compiler options in dejagnu runs compiler specific
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
diff --git a/ChangeLog b/ChangeLog
index 163197c..7719a48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2013-01-08 Anthony Green <green@moxielogic.com>
+ * testsuite/libffi.call/call.exp: Run tests with different
+ options, depending on whether or not we are using gcc or the
+ vendor compiler.
+ * testsuite/lib/libffi.exp (libffi-init): Set using_gcc based on
+ whether or not we are building/testing with gcc.
+
+2013-01-08 Anthony Green <green@moxielogic.com>
+
* configure.ac: Switch x86 solaris target to X86 by default.
* configure: Rebuilt.
diff --git a/testsuite/lib/libffi.exp b/testsuite/lib/libffi.exp
index 8ee3f15..1ac2c36 100644
--- a/testsuite/lib/libffi.exp
+++ b/testsuite/lib/libffi.exp
@@ -101,9 +101,17 @@ proc libffi-init { args } {
global tool_root_dir
global ld_library_path
+ global using_gcc
+
set blddirffi [pwd]/..
verbose "libffi $blddirffi"
+ # Are we building with GCC?
+ set tmp [grep ../config.status "GCC='yes'"]
+ if { [string match $tmp "GCC='yes'"] } {
+
+ set using_gcc "yes"
+
set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
if {$gccdir != ""} {
set gccdir [file dirname $gccdir]
@@ -127,6 +135,13 @@ proc libffi-init { args } {
}
}
}
+
+ } else {
+
+ set using_gcc "no"
+
+ }
+
# add the library path for libffi.
append ld_library_path ":${blddirffi}/.libs"
diff --git a/testsuite/libffi.call/call.exp b/testsuite/libffi.call/call.exp
index 26acd81..c334685 100644
--- a/testsuite/libffi.call/call.exp
+++ b/testsuite/libffi.call/call.exp
@@ -19,11 +19,20 @@ libffi-init
global srcdir subdir
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O0 -W -Wall" ""
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2" ""
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O3" ""
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-Os" ""
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2 -fomit-frame-pointer" ""
+if { [string match $using_gcc "yes"] } {
+
+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O0 -W -Wall" ""
+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2" ""
+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O3" ""
+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-Os" ""
+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2 -fomit-frame-pointer" ""
+
+} else {
+
+ # Assume we are using the vendor compiler.
+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" ""
+
+}
dg-finish