Commit 504d14c9 by Iain Sandoe Committed by Mike Stump

re PR objc/35165 (Massive failures of objc on i686-apple-darwin9)

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.

From-SVN: r158752
parent d63fd21d
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> 2010-04-26 Jack Howarth <howarth@bromo.med.uc.edu>
PR 43715 PR 43715
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
load_lib copy-file.exp 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 global runtests dg-do-what-default
# If we're only testing specific files and this isn't one of them, skip it. # If we're only testing specific files and this isn't one of them, skip it.
...@@ -33,13 +33,13 @@ proc dg-pch { subdir test options suffix } { ...@@ -33,13 +33,13 @@ proc dg-pch { subdir test options suffix } {
# We don't try to use the loop-optimizing options, since they are highly # We don't try to use the loop-optimizing options, since they are highly
# unlikely to make any difference to PCH. # unlikely to make any difference to PCH.
foreach flags $options { foreach flags $options {
verbose "Testing $nshort, $flags" 1 verbose "Testing $nshort, $otherflags $flags" 1
# For the header files, the default is to precompile. # For the header files, the default is to precompile.
set dg-do-what-default precompile set dg-do-what-default precompile
catch { file_on_host delete "$bname$suffix" } catch { file_on_host delete "$bname$suffix" }
gcc_copy_files "[file rootname $test]${suffix}s" "$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. # For the rest, the default is to compile to .s.
set dg-do-what-default compile set dg-do-what-default compile
...@@ -50,23 +50,23 @@ proc dg-pch { subdir test options suffix } { ...@@ -50,23 +50,23 @@ proc dg-pch { subdir test options suffix } {
# Ensure that the PCH file is used, not the original header. # Ensure that the PCH file is used, not the original header.
file_on_host delete "$bname$suffix" 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" file_on_host delete "$bname$suffix.gch"
if { !$have_errs } { if { !$have_errs } {
if { [ file_on_host exists "$bname.s" ] } { if { [ file_on_host exists "$bname.s" ] } {
remote_upload host "$bname.s" "$bname.s-gch" remote_upload host "$bname.s" "$bname.s-gch"
remote_download host "$bname.s-gch" remote_download host "$bname.s-gch"
gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix" 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" remote_upload host "$bname.s"
set tmp [ diff "$bname.s" "$bname.s-gch" ] set tmp [ diff "$bname.s" "$bname.s-gch" ]
if { $tmp == 0 } { if { $tmp == 0 } {
verbose -log "assembly file '$bname.s', '$bname.s-gch' comparison error" 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 } { } elseif { $tmp == 1 } {
pass "$nshort $flags assembly comparison" pass "$nshort $otherflags $flags assembly comparison"
} else { } else {
fail "$nshort $flags assembly comparison" fail "$nshort $otherflags $flags assembly comparison"
} }
file_on_host delete "$bname$suffix" file_on_host delete "$bname$suffix"
file_on_host delete "$bname.s" file_on_host delete "$bname.s"
...@@ -86,3 +86,7 @@ proc dg-pch { subdir test options suffix } { ...@@ -86,3 +86,7 @@ proc dg-pch { subdir test options suffix } {
} }
} }
} }
proc dg-pch { subdir test options suffix } {
return [dg-flags-pch $subdir $test "" $options $suffix]
}
\ No newline at end of file
...@@ -46,28 +46,55 @@ proc objc-set-runtime-options { dowhat args } { ...@@ -46,28 +46,55 @@ proc objc-set-runtime-options { dowhat args } {
lappend options $args lappend options $args
} }
verbose "options $options" 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 [info exists dowhat] {
if { $dowhat == "execute" } { switch $dowhat {
set result [objc_load "$tmpdir/$test_obj" "" ""] "compile" {
set status [lindex $result 0] set compile_type "assembly"
set output [lindex $result 1] set output_file "trivial.s"
if { $status != "pass" } { set comp_output [objc_target_compile \
remote_file build delete $test_obj "$srcdir/$subdir/trivial.m" "$output_file" "$compile_type" $options]
verbose -log "trivial execute failed with $status $output"
continue; 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 lappend OBJC_RUNTIME_OPTIONS $type
} }
......
/* All calls must be properly stubified. Complain about any "call /* All calls must be properly stubified. Complain about any "call
_objc_msgSend<end-of-line>" without the $stub suffix. */ _objc_msgSend<end-of-line>" without the $stub suffix. */
/* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */
/* { dg-options "-Os -mdynamic-no-pic -fno-exceptions" } */ /* { 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 ; typedef struct objc_object { } *id ;
int x = 41 ; int x = 41 ;
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
/* Testcase extracted from TextEdit:Document.m. */ /* Testcase extracted from TextEdit:Document.m. */
/* { dg-do compile { target *-*-darwin* } } */ /* { 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 ; typedef struct objc_object { } *id ;
int x = 41 ; int x = 41 ;
...@@ -27,5 +29,5 @@ extern int bogonic (int, int, int) ; ...@@ -27,5 +29,5 @@ extern int bogonic (int, int, int) ;
@end @end
/* Any symbol_ref of an un-stubified objc_msgSend is an error; look /* Any symbol_ref of an un-stubified objc_msgSend is an error; look
for "objc_msgSend" in quotes, without the $stub suffix. */ for "objc_msgSend" in quotes, without the $stub suffix. */
/* { dg-final { scan-file-not stubify-2.mm.147r.jump "symbol_ref.*\"objc_msgSend\"" } } */ /* { dg-final { scan-rtl-dump-not "symbol_ref.*\"objc_msgSend\"" "jump" } } */
...@@ -15,4 +15,5 @@ ...@@ -15,4 +15,5 @@
- (void)boo { } - (void)boo { }
@end @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 } } } } } */
...@@ -26,19 +26,34 @@ load_lib torture-options.exp ...@@ -26,19 +26,34 @@ load_lib torture-options.exp
dg-init dg-init
torture-init torture-init
set-torture-options $DG_TORTURE_OPTIONS set-torture-options $DG_TORTURE_OPTIONS
set old_dg_do_what_default "${dg-do-what-default}" 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. # Main loop.
foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.m]] { 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 global torture_without_loops
# We don't try to use the loop-optimizing options, since they are highly # 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 # 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 # add -O0 -g, since users who want PCH usually want debugging and quick
# compiles. # 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" set dg-do-what-default "$old_dg_do_what_default"
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
/* Contributed by Ziemowit Laski <zlaski@apple.com>. */ /* Contributed by Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do compile { target *-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-require-effective-target ilp32 } */
#include "../objc-obj-c++-shared/Object1.h" #include "../objc-obj-c++-shared/Object1.h"
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
/* { dg-do compile { target *-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ /* { 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 ; typedef struct objc_object { } *id ;
int x = 41 ; int x = 41 ;
......
/* All calls must be properly stubified. */ /* All calls must be properly stubified, m32 only. */
/* Testcase extracted from TextEdit:Document.m. */ /* Testcase extracted from TextEdit:Document.m. */
/* { dg-do compile { target *-*-darwin* } } */ /* { dg-do compile { target powerpc*-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ /* { 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 ; typedef struct objc_object { } *id ;
int x = 41 ; int x = 41 ;
......
...@@ -22,4 +22,6 @@ ...@@ -22,4 +22,6 @@
-(void)checkValues { } -(void)checkValues { }
@end @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 } } } } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment