+2010-04-26 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
+
+ PR testsuite/35165
+ * obj-c++.dg/stubify-2.mm: Restrict to ilp32 targets. Require
+ Darwin8/OSX10.4 - compatible code generation.
+ Use scan-rtl-dump.
+ * obj-c++.dg/stubify-1.mm: Ditto.
+ * lib/objc-torture.exp: Do not require link success for
+ "trivial.m" in the runtime checks when dowhat = 'compile'.
+ * lib/dg-pch.exp: (dg-flags-pch): New Proc.
+ * objc.dg/stubify-1.m: Restrict to ilp32 targets. Require
+ Darwin8/OSX10.4 - compatible code generation.
+ * objc.dg/stubify-2.m: Ditto.
+ * objc.dg/symtab-1.m: Match '.quad' for m64 code.
+ * objc.dg/next-runtime-1.m: Ditto.
+ * objc.dg/stret-2.m: Restrict to ilp32 targets.
+ * objc.dg/pch/pch.exp: Apply tests to both Gnu and NeXT
+ runtimes on Darwin.
+
2010-04-26 Jack Howarth <howarth@bromo.med.uc.edu>
PR 43715
load_lib copy-file.exp
-proc dg-pch { subdir test options suffix } {
+proc dg-flags-pch { subdir test otherflags options suffix } {
global runtests dg-do-what-default
# If we're only testing specific files and this isn't one of them, skip it.
# We don't try to use the loop-optimizing options, since they are highly
# unlikely to make any difference to PCH.
foreach flags $options {
- verbose "Testing $nshort, $flags" 1
+ verbose "Testing $nshort, $otherflags $flags" 1
# For the header files, the default is to precompile.
set dg-do-what-default precompile
catch { file_on_host delete "$bname$suffix" }
gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix"
- dg-test -keep-output "./$bname$suffix" $flags ""
+ dg-test -keep-output "./$bname$suffix" "$otherflags $flags" ""
# For the rest, the default is to compile to .s.
set dg-do-what-default compile
# Ensure that the PCH file is used, not the original header.
file_on_host delete "$bname$suffix"
- dg-test -keep-output $test "$flags -I." ""
+ dg-test -keep-output $test "$otherflags $flags -I." ""
file_on_host delete "$bname$suffix.gch"
if { !$have_errs } {
if { [ file_on_host exists "$bname.s" ] } {
remote_upload host "$bname.s" "$bname.s-gch"
remote_download host "$bname.s-gch"
gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix"
- dg-test -keep-output $test $flags "-I."
+ dg-test -keep-output $test "$otherflags $flags -I." ""
remote_upload host "$bname.s"
set tmp [ diff "$bname.s" "$bname.s-gch" ]
if { $tmp == 0 } {
verbose -log "assembly file '$bname.s', '$bname.s-gch' comparison error"
- fail "$nshort $flags assembly comparison"
+ fail "$nshort $otherflags $flags assembly comparison"
} elseif { $tmp == 1 } {
- pass "$nshort $flags assembly comparison"
+ pass "$nshort $otherflags $flags assembly comparison"
} else {
- fail "$nshort $flags assembly comparison"
+ fail "$nshort $otherflags $flags assembly comparison"
}
file_on_host delete "$bname$suffix"
file_on_host delete "$bname.s"
}
}
}
+
+proc dg-pch { subdir test options suffix } {
+ return [dg-flags-pch $subdir $test "" $options $suffix]
+}
\ No newline at end of file
lappend options $args
}
verbose "options $options"
- set test_obj "trivial.exe"
- set comp_output [objc_target_compile \
- "$srcdir/$subdir/trivial.m" $test_obj executable $options]
-
- # If we get any error, then we failed.
- if ![string match "" $comp_output] then {
- remote_file build delete $test_obj
- continue;
- }
if [info exists dowhat] {
- if { $dowhat == "execute" } {
- set result [objc_load "$tmpdir/$test_obj" "" ""]
- set status [lindex $result 0]
- set output [lindex $result 1]
- if { $status != "pass" } {
- remote_file build delete $test_obj
- verbose -log "trivial execute failed with $status $output"
- continue;
- }
+ switch $dowhat {
+ "compile" {
+ set compile_type "assembly"
+ set output_file "trivial.s"
+ set comp_output [objc_target_compile \
+ "$srcdir/$subdir/trivial.m" "$output_file" "$compile_type" $options]
+
+ remote_file build delete $output_file
+ # If we get any error, then we failed.
+ if ![string match "" $comp_output] then {
+ continue;
+ }
+ }
+ "execute" {
+ set test_obj "trivial.exe"
+ set comp_output [objc_target_compile \
+ "$srcdir/$subdir/trivial.m" $test_obj "executable" $options]
+
+ # If we get any error, then we failed.
+ if ![string match "" $comp_output] then {
+ remote_file build delete $test_obj
+ continue;
+ }
+ set result [objc_load "$tmpdir/$test_obj" "" ""]
+ set status [lindex $result 0]
+ set output [lindex $result 1]
+ remote_file build delete $test_obj
+ if { $status != "pass" } {
+ verbose -log "trivial execute failed with $status $output"
+ continue;
+ }
+ }
+ default {
+ perror "$dowhat: not a valid objc-torture action"
+ return ""
}
+ }
+ } else {
+ set test_obj "trivial.exe"
+ set comp_output [objc_target_compile \
+ "$srcdir/$subdir/trivial.m" $test_obj executable $options]
+
+ # If we get any error, then we failed.
+ remote_file build delete $test_obj
+ if ![string match "" $comp_output] then {
+ continue;
+ }
}
- remote_file build delete $test_obj
lappend OBJC_RUNTIME_OPTIONS $type
}
/* All calls must be properly stubified. Complain about any "call
_objc_msgSend<end-of-line>" without the $stub suffix. */
-/* { dg-do compile { target powerpc*-*-darwin* } } */
-/* { dg-options "-Os -mdynamic-no-pic -fno-exceptions" } */
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-Os -mdynamic-no-pic -fno-exceptions -mmacosx-version-min=10.4" } */
typedef struct objc_object { } *id ;
int x = 41 ;
/* Testcase extracted from TextEdit:Document.m. */
/* { dg-do compile { target *-*-darwin* } } */
-/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump" } */
+/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump -mmacosx-version-min=10.4" } */
typedef struct objc_object { } *id ;
int x = 41 ;
@end
/* Any symbol_ref of an un-stubified objc_msgSend is an error; look
- for "objc_msgSend" in quotes, without the $stub suffix. */
-/* { dg-final { scan-file-not stubify-2.mm.147r.jump "symbol_ref.*\"objc_msgSend\"" } } */
+ for "objc_msgSend" in quotes, without the $stub suffix. */
+/* { dg-final { scan-rtl-dump-not "symbol_ref.*\"objc_msgSend\"" "jump" } } */
- (void)boo { }
@end
-/* { dg-final { scan-assembler "L_OBJC_MODULES:\n\[ \t\]*\.long\t6\n" } } */
+/* { dg-final { scan-assembler "L_OBJC_MODULES:\n\[ \t\]*\.long\t6\n" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler "L_OBJC_MODULES:\n\[ \t\]*\.quad\t6\n" { target { *-*-darwin* && { lp64 } } } } } */
dg-init
torture-init
+
set-torture-options $DG_TORTURE_OPTIONS
set old_dg_do_what_default "${dg-do-what-default}"
+global torture_without_loops
+set mytorture [concat [list {-O0 -g}] $torture_without_loops]
+
# Main loop.
foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.m]] {
+
+ # We don't try to use the loop-optimizing options, since they are highly
+ # unlikely to make any difference to PCH. However, we do want to
+ # add -O0 -g, since users who want PCH usually want debugging and quick
+ # compiles.
+ dg-flags-pch $subdir $test "-fgnu-runtime" $mytorture ".h"
+}
+
+if [istarget "*-*-darwin*" ] {
+ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.m]] {
global torture_without_loops
# We don't try to use the loop-optimizing options, since they are highly
# unlikely to make any difference to PCH. However, we do want to
# add -O0 -g, since users who want PCH usually want debugging and quick
# compiles.
- dg-pch $subdir $test [concat [list {-O0 -g}] $torture_without_loops] ".h"
+ dg-flags-pch $subdir $test "-fnext-runtime" $mytorture ".h"
+ }
}
set dg-do-what-default "$old_dg_do_what_default"
/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do compile { target *-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
+/* { dg-require-effective-target ilp32 } */
#include "../objc-obj-c++-shared/Object1.h"
/* { dg-do compile { target *-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
-/* { dg-options "-Os -mdynamic-no-pic" } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-Os -mdynamic-no-pic -mmacosx-version-min=10.4" } */
typedef struct objc_object { } *id ;
int x = 41 ;
-/* All calls must be properly stubified. */
+/* All calls must be properly stubified, m32 only. */
/* Testcase extracted from TextEdit:Document.m. */
-/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
-/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump" } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump -mmacosx-version-min=10.4" } */
typedef struct objc_object { } *id ;
int x = 41 ;
-(void)checkValues { }
@end
-/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.long\t0\n\t.long\t0\n\t.short\t2\n\t.short\t0\n\t.long\tL_OBJC_CLASS_Derived.*\n\t.long\tL_OBJC_CLASS_Base.*\n" } } */
+/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.long\t0\n\t.long\t0\n\t.word\t2\n\t.word\t0\n\t.long\tL_OBJC_CLASS_Derived.*\n\t.long\tL_OBJC_CLASS_Base.*\n" { target { i?86-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.long\t0\n\t.long\t0\n\t.short\t2\n\t.short\t0\n\t.long\tL_OBJC_CLASS_Derived.*\n\t.long\tL_OBJC_CLASS_Base.*\n" { target { powerpc-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.quad\t0\n\t.long\t0\n\t.space 4\n\t.word\t2\n\t.word\t0\n\t.space 4\n\t.quad\tL_OBJC_CLASS_Derived.*\n\t.quad\tL_OBJC_CLASS_Base.*\n" { target { *-*-darwin* && { lp64 } } } } } */