aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2005-08-13 21:16:04 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2005-08-13 14:16:04 -0700
commit4179a4142c174197fcf6340fd97e239344f864a3 (patch)
tree3b902b44402f63ebc65b85cda5c256f4157fa1b2
parent0ffb94cd681982d04226863a123d06cf4bdefab4 (diff)
downloadgcc-4179a4142c174197fcf6340fd97e239344f864a3.zip
gcc-4179a4142c174197fcf6340fd97e239344f864a3.tar.gz
gcc-4179a4142c174197fcf6340fd97e239344f864a3.tar.bz2
part of PR testsuite/23348
2005-08-13 Andrew Pinski <pinskia@physics.uc.edu> part of PR testsuite/23348 * lib/objc-torture.exp: Add -fgnu-runtime and/or -fnext-runtime to each of the torture options. * objc/compile/trivial.m: New test. From-SVN: r103061
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/lib/objc-torture.exp47
-rw-r--r--gcc/testsuite/objc/compile/trivial.m6
3 files changed, 48 insertions, 12 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c54ba51..f98e137 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2005-08-13 Andrew Pinski <pinskia@physics.uc.edu>
+
+ part of PR testsuite/23348
+ * lib/objc-torture.exp: Add -fgnu-runtime and/or -fnext-runtime to each
+ of the torture options.
+ * objc/compile/trivial.m: New test.
+
2005-08-12 Thomas Koenig <Thomas.Koenig@online.de>
* gfortran.dg/eoshift.f90: Correct format.
diff --git a/gcc/testsuite/lib/objc-torture.exp b/gcc/testsuite/lib/objc-torture.exp
index 4f7826a..09d0c77 100644
--- a/gcc/testsuite/lib/objc-torture.exp
+++ b/gcc/testsuite/lib/objc-torture.exp
@@ -21,6 +21,24 @@ load_lib file-format.exp
# The default option list can be overridden by
# TORTURE_OPTIONS="{ { list1 } ... { listN } }"
+if ![info exists OBJC_RUNTIME_OPTIONS] {
+ set OBJC_RUNTIME_OPTIONS ""
+ foreach type {-fgnu-runtime -fnext-runtime} {
+ global srcdir subdir
+
+ set comp_output [objc_target_compile \
+ "$srcdir/$subdir/trivial.m" "trivial.exe" executable "additional_flags=$type"]
+
+ # If we get any error, then we failed
+ if ![string match "" $comp_output] then {
+ continue;
+ }
+ lappend OBJC_RUNTIME_OPTIONS $type
+ }
+}
+verbose -log "Using the following runtimes: $OBJC_RUNTIME_OPTIONS"
+
+
if ![info exists TORTURE_OPTIONS] {
# It is theoretically beneficial to group all of the O2/O3 options together,
# as in many cases the compiler will generate identical executables for
@@ -30,28 +48,33 @@ if ![info exists TORTURE_OPTIONS] {
# items below, even though -O3 is also specified, because some ports may
# choose to disable inlining functions by default, even when optimizing.
set TORTURE_OPTIONS [list \
- { -O0 } \
- { -O1 } \
- { -O2 } \
- { -O3 -fomit-frame-pointer } \
- { -O3 -fomit-frame-pointer -funroll-loops } \
- { -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions } \
- { -O3 -g } \
- { -Os } ]
+ " -O0 " \
+ " -O1 " \
+ " -O2 " \
+ " -O3 -fomit-frame-pointer " \
+ " -O3 -fomit-frame-pointer -funroll-loops " \
+ " -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions " \
+ " -O3 -g " \
+ " -Os " ]
}
# Split TORTURE_OPTIONS into two choices: one for testcases with loops and
-# one for testcases without loops.
+# one for testcases without loops. Add in the objc runtime options also.
-set torture_with_loops $TORTURE_OPTIONS
+set torture_with_loops ""
set torture_without_loops ""
-foreach option $TORTURE_OPTIONS {
+foreach objc_option $OBJC_RUNTIME_OPTIONS {
+ foreach option $TORTURE_OPTIONS {
+
if ![string match "*loop*" $option] {
- lappend torture_without_loops $option
+ lappend torture_without_loops "$option $objc_option"
}
+ lappend torture_with_loops "$option $objc_option"
+ }
}
+
#
# objc-torture-compile -- runs the Tege OBJC-torture test
#
diff --git a/gcc/testsuite/objc/compile/trivial.m b/gcc/testsuite/objc/compile/trivial.m
new file mode 100644
index 0000000..c256065
--- /dev/null
+++ b/gcc/testsuite/objc/compile/trivial.m
@@ -0,0 +1,6 @@
+#import <objc/Object.h>
+
+int main(void)
+{
+ [Object class];
+}