From 504d14c971d6fb0605e0f624d650cda52f168781 Mon Sep 17 00:00:00 2001 From: Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk> Date: Tue, 27 Apr 2010 00:08:28 +0000 Subject: [PATCH] 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 --- gcc/testsuite/ChangeLog | 19 ++++++++ gcc/testsuite/lib/dg-pch.exp | 20 ++++---- gcc/testsuite/lib/objc-torture.exp | 65 ++++++++++++++++++-------- gcc/testsuite/obj-c++.dg/stubify-1.mm | 6 ++- gcc/testsuite/obj-c++.dg/stubify-2.mm | 8 ++-- gcc/testsuite/objc.dg/next-runtime-1.m | 3 +- gcc/testsuite/objc.dg/pch/pch.exp | 17 ++++++- gcc/testsuite/objc.dg/stret-2.m | 1 + gcc/testsuite/objc.dg/stubify-1.m | 3 +- gcc/testsuite/objc.dg/stubify-2.m | 7 +-- gcc/testsuite/objc.dg/symtab-1.m | 4 +- 11 files changed, 114 insertions(+), 39 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6c4418837eee..4351007c3a4b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,22 @@ +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 diff --git a/gcc/testsuite/lib/dg-pch.exp b/gcc/testsuite/lib/dg-pch.exp index 5320880bb431..2e0631fdc94b 100644 --- a/gcc/testsuite/lib/dg-pch.exp +++ b/gcc/testsuite/lib/dg-pch.exp @@ -16,7 +16,7 @@ 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. @@ -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 # 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 @@ -50,23 +50,23 @@ proc dg-pch { subdir test options suffix } { # 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" @@ -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 diff --git a/gcc/testsuite/lib/objc-torture.exp b/gcc/testsuite/lib/objc-torture.exp index 0b6362bb1d88..a3d1ef2446e3 100644 --- a/gcc/testsuite/lib/objc-torture.exp +++ b/gcc/testsuite/lib/objc-torture.exp @@ -46,28 +46,55 @@ proc objc-set-runtime-options { dowhat args } { 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 } diff --git a/gcc/testsuite/obj-c++.dg/stubify-1.mm b/gcc/testsuite/obj-c++.dg/stubify-1.mm index 0dafa4bcdd14..687739ceccd9 100644 --- a/gcc/testsuite/obj-c++.dg/stubify-1.mm +++ b/gcc/testsuite/obj-c++.dg/stubify-1.mm @@ -1,8 +1,10 @@ /* 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 ; diff --git a/gcc/testsuite/obj-c++.dg/stubify-2.mm b/gcc/testsuite/obj-c++.dg/stubify-2.mm index 9db573e8afae..9968672ed344 100644 --- a/gcc/testsuite/obj-c++.dg/stubify-2.mm +++ b/gcc/testsuite/obj-c++.dg/stubify-2.mm @@ -2,7 +2,9 @@ /* 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 ; @@ -27,5 +29,5 @@ extern int bogonic (int, int, int) ; @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" } } */ diff --git a/gcc/testsuite/objc.dg/next-runtime-1.m b/gcc/testsuite/objc.dg/next-runtime-1.m index 7d4a7d949c6a..9a0951cabee3 100644 --- a/gcc/testsuite/objc.dg/next-runtime-1.m +++ b/gcc/testsuite/objc.dg/next-runtime-1.m @@ -15,4 +15,5 @@ - (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 } } } } } */ diff --git a/gcc/testsuite/objc.dg/pch/pch.exp b/gcc/testsuite/objc.dg/pch/pch.exp index 3747bde409e5..ca406fd94da7 100644 --- a/gcc/testsuite/objc.dg/pch/pch.exp +++ b/gcc/testsuite/objc.dg/pch/pch.exp @@ -26,19 +26,34 @@ load_lib torture-options.exp 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" diff --git a/gcc/testsuite/objc.dg/stret-2.m b/gcc/testsuite/objc.dg/stret-2.m index ded3ae41997d..fccda3234334 100644 --- a/gcc/testsuite/objc.dg/stret-2.m +++ b/gcc/testsuite/objc.dg/stret-2.m @@ -4,6 +4,7 @@ /* 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" diff --git a/gcc/testsuite/objc.dg/stubify-1.m b/gcc/testsuite/objc.dg/stubify-1.m index 72de75beffc7..91bf73a14f7a 100644 --- a/gcc/testsuite/objc.dg/stubify-1.m +++ b/gcc/testsuite/objc.dg/stubify-1.m @@ -3,7 +3,8 @@ /* { 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 ; diff --git a/gcc/testsuite/objc.dg/stubify-2.m b/gcc/testsuite/objc.dg/stubify-2.m index b474d4f8927d..eaf4b964e4b3 100644 --- a/gcc/testsuite/objc.dg/stubify-2.m +++ b/gcc/testsuite/objc.dg/stubify-2.m @@ -1,9 +1,10 @@ -/* 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 ; diff --git a/gcc/testsuite/objc.dg/symtab-1.m b/gcc/testsuite/objc.dg/symtab-1.m index dade20844783..90a796917218 100644 --- a/gcc/testsuite/objc.dg/symtab-1.m +++ b/gcc/testsuite/objc.dg/symtab-1.m @@ -22,4 +22,6 @@ -(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 } } } } } */ -- GitLab