From patchwork Tue Oct 2 22:21:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 188663 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id F03832C008D for ; Wed, 3 Oct 2012 08:21:52 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1349821313; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=GcCKvOS 8AHVxQ4KHzZR0B5m5HN0=; b=gyhe/z//Z3+U6OaYoxAFAtQilQfLiVEut6z0Rm2 xSq9FB9t3tePVOjhfPwIw0ytec/TBAnoygijz7ySyWhu6K1WHztd63QUx663NniU YuNlR6tUXjGBvwic11MoW3n1FzC9im+i54muJ0JB1NDTAZudXtf+EHDS9sFPH+Y4 PAGo= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ZlNpu7OPZDaom4GZRu4ZuUSGotyVK3Xuu80yZVuErsqT2hlGcHDw1RXGN31mL8 mcX5YL3dmUjzAPqPXD5sZG8VRUCzT9uqXFxiFEmKvBQ0S2BP95mfDjW6R2rrUkHP 2wuFmGF0dMrJk3YmI5/whjMvTDYmW1WCo5NVK9JAG7rSA=; Received: (qmail 14448 invoked by alias); 2 Oct 2012 22:21:47 -0000 Received: (qmail 14434 invoked by uid 22791); 2 Oct 2012 22:21:44 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, TW_CC, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Oct 2012 22:21:38 +0000 Received: by pbbro12 with SMTP id ro12so9632262pbb.20 for ; Tue, 02 Oct 2012 15:21:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type:x-gm-message-state; bh=A3fOEOsh+/yku2EykvAic5CwAHPlZ0H1GKkOHJMDPtw=; b=MeG+tPlltiEDxw4r4upTU8e2RzEeE8rX346ec6m5myULfHcPtz7k4N2dK+YZDUtphV 124Xg39VJqnlLx1jwE06BctvBR4AYQZaWnWIZAw1cBftWYzyhfRN9n99oXUZkjkbrDDN ihzK/jE0lmC0v7SrSfpRrVc2wausHOQsWoPKnFBKFr5WDw2e3KcrrY4mBmWXJGccsw1o 4giQD/xPX2EUq8S38lqLEKPQ37oEfNobwijQD7c6Bk950/ykKunZ5wVMKwrsMMvnePP3 TqxCisKRvXKgUuNcHxyb6IqMIRTsNRLKnXSs3/V8v1FGfjz6HUFl1Phr9tKz92l0x1xr whSw== Received: by 10.68.232.70 with SMTP id tm6mr7791554pbc.104.1349216497838; Tue, 02 Oct 2012 15:21:37 -0700 (PDT) Received: from coign.google.com ([2620:0:1000:fd2a:224:d7ff:fe8f:f634]) by mx.google.com with ESMTPS id rz10sm1504408pbc.32.2012.10.02.15.21.36 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 02 Oct 2012 15:21:36 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Update testsuite Date: Tue, 02 Oct 2012 15:21:33 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQleHhK4CUccE8G6+motPPCSzG/teDSqoXvlW7OdY2YLHioXDX5ap7cRCluBNTpdrog5yCaULqaMwV98anfv3TucKxWKDo15QqaKF7IaO0fTRZrntQaUnYbwoOoLsI8zhb5TKE/IC39yGf6X2jlcBu4o38Vlv/f8LKKgbiZ7QDHp12/4iTIrdNujL7FVGmoVCNq3AXSa X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch updates the Go testsuite to the current master testsuite. All the tests should pass. The complete patch is too large to include here, and consists simply of copying files from the master repository. I have included only the patch to the testsuite driver, go-test.exp. The Go testsuite was changed to simplify many of the test command lines, and that is reflected here. On the other hand new tests were added with additional complex ways to run them, and that too is reflected here. Bootstrapped and ran new Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian 2012-09-29 Ian Lance Taylor * go.test/go-test.exp: Update for latest version of Go testsuite. Index: go-test.exp =================================================================== --- go-test.exp (revision 191857) +++ go-test.exp (revision 191858) @@ -26,6 +26,8 @@ # D The directory of the test. # # Typical command lines: +# // compile +# // run # // $G $D/$F.go && $L $F.$A && ./$A.out # // $G $D/$F.go && $L $F.$A || echo BUG: known to fail incorrectly # // $G $D/$F.go && echo BUG: compilation succeeds incorrectly @@ -267,7 +269,7 @@ proc go-gc-tests { } { # frontend ignores the standard options, it doesn't significantly # improve testing. set saved_torture_options $TORTURE_OPTIONS - set TORTURE_OPTIONS [ list { -O2 -g }] + set TORTURE_OPTIONS [list { -O2 -g }] set saved-dg-do-what-default ${dg-do-what-default} @@ -316,13 +318,6 @@ proc go-gc-tests { } { } } - if { [string match "*bug347*" $test] \ - || [string match "*bug348*" $test] } { - # These bugs rely on runtime.Caller which currently fails. - untested $name - continue - } - if { [file tail $test] == "init1.go" } { # This tests whether GC runs during init, which for gccgo # it currently does not. @@ -347,6 +342,22 @@ proc go-gc-tests { } { continue } + if { [file tail $test] == "rotate.go" } { + # This test produces a temporary file that takes too long + # to compile--5 minutes on my laptop without optimization. + # When compiling without optimization it tests nothing + # useful, since the point of the test is to see whether + # the compiler generates rotate instructions. + untested $name + continue + } + + if { [file tail $test] == "bug347.go" \ + || [file tail $test] == "bug348.go" } { + # These tests don't work if the functions are inlined. + set TORTURE_OPTIONS [list { -O0 -g }] + } + set fd [open $test r] set lines_ok 1 @@ -424,9 +435,24 @@ proc go-gc-tests { } { } } - if { $test_line == "// \$G \$D/\$F\.go && \$L \$F\.\$A && \./\$A\.out >tmp.go &&" \ - && $test_line2 == "// \$G tmp\.go && \$L tmp\.\$A && \./\$A\.out || echo BUG: 64bit" } { - # 64bit.go is a special case. + if { $test_line == "// compile" + || $test_line == "// echo bug395 is broken # takes 90+ seconds to break" } { + # This is a vanilla compile test. + set dg-do-what-default "assemble" + go-dg-runtest $test "-w $DEFAULT_GOCFLAGS" + } elseif { $test_line == "// run" + || $test_line == "// \$G \$F.go && \$L \$F.\$A && ./\$A.out" } { + # This is a vanilla execution test. + go-torture-execute $test + file delete core [glob -nocomplain core.*] + } elseif { $test_line == "// build" } { + # This is a vanilla compile and link test. + set dg-do-what-default "link" + go-dg-runtest $test "-w $DEFAULT_GOCFLAGS" + } elseif { $test_line == "// runoutput" \ + || ($test_line == "// \$G \$D/\$F.go && \$L \$F.\$A &&" + && $test_line2 == "// ./\$A.out >tmp.go && \$G tmp.go && \$L -o \$A.out1 tmp.\$A && ./\$A.out1") } { + # Run the test to get a .go program to run. set go_execute_args "" set hold_runtests $runtests set runtests "go-test.exp" @@ -440,42 +466,17 @@ proc go-gc-tests { } { } else { pass "$name execution" file delete $base-out.x - # Disable optimizations as this test takes a long time - # to compile. - set hold $TORTURE_OPTIONS - set TORTURE_OPTIONS [ list { -O0 -g }] + # Disable optimizations as some of these tests + # take a long time to compile. + set TORTURE_OPTIONS [list { -O0 -g -fno-var-tracking-assignments }] go-torture-execute "./$base-out.go" - set TORTURE_OPTIONS $hold } file delete $base-out.go } file delete $output_file set runtests $hold_runtests - } elseif { $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" \ - || $test_line == "// \$G \$F.go && \$L \$F.\$A && ./\$A.out" \ - || $test_line == "// \$G \$F.go && \$L \$F.\$A &&./\$A.out" \ - || $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && \$A.out" \ - || [string match \ - "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out || echo BUG*" \ - $test_line] - || [string match \ - "// \$G \$F.go && \$L \$F.\$A && (./\$A.out || echo BUG*" \ - $test_line] - || [string match \ - "// \$G \$D/\$F.go && \$L \$F.\$A && (./\$A.out || echo BUG*" \ - $test_line] - || [string match \ - "// \$G \$F.go && \$L \$F.\$A && GOMAXPROCS=* ./\$A.out" \ - $test_line] - || [string match \ - "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out >* || echo BUG*" \ - $test_line] } { - # This is a vanilla execution test. - go-torture-execute $test - file delete core [glob -nocomplain core.*] - } elseif { $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out 2>&1 | cmp - \$D/\$F.out" \ - || $test_line == "// \$G \$F.go && \$L \$F.\$A && ./\$A.out 2>&1 | cmp - \$D/\$F.out" \ - || $test_line == "// (\$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out 2>&1 | cmp - \$D/\$F.out)" } { + } elseif { $test_line == "// cmpout" \ + || $test_line == "// (\$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out 2>&1 | cmp - \$D/\$F.out)" } { # This is an execution test for which we need to check the # program output. set hold_runtests $runtests @@ -495,110 +496,39 @@ proc go-gc-tests { } { regsub "\\.go$" $test ".out" expect filecmp $expect $base.p "$name compare" } - #file delete $base.p + file delete $base.p } else { untested "$name execution" untested "$name compare" } set runtests $hold_runtests - } elseif { [string match \ - "// \$G \$D/\$F.go && \$L \$F.\$A || echo BUG*" \ - $test_line] \ - || [string match "// \$G \$F.go && \$L \$F.\$A #*" \ - $test_line] - || $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A" } { - # This is a vanilla compile and link test. - set dg-do-what-default "link" - go-dg-runtest $test "-w $DEFAULT_GOCFLAGS" - } elseif { [string match "// \$G \$D/\$F.go" $test_line] \ - || [string match "// \$G \$D/\$F.go || echo BUG*" \ - $test_line] \ - || [string match "// \$G \$D/\$F.go || echo \"Bug*" \ - $test_line] \ - || [string match "// \$G \$D/\$F.go || echo \"Issue*" \ - $test_line] \ - || [string match "// \$G \$F.go || echo BUG*" \ - $test_line] \ - || [string match "// ! \$G \$D/\$F.go && echo BUG*" \ - $test_line] \ - || $test_line == "// echo bug395 is broken # takes 90+ seconds to break" } { - # This is a vanilla compile test. - set dg-do-what-default "assemble" - go-dg-runtest $test "-w $DEFAULT_GOCFLAGS" - } elseif { [string match "// \$G \$D/\$F.go && echo BUG*" \ - $test_line] \ - || $test_line == "// ! \$G \$D/\$F.go >/dev/null" \ - || $test_line == "// ! \$G \$D/\$F.go" \ - || $test_line == "// ! \$G \$F.go" \ - || [string match "// ! \$G \$D/\$F.go || echo BUG*" \ - $test_line] } { - # This is a compile test which should fail. - set dg-do-what-default "assemble" - setup_xfail "*-*-*" - go-dg-runtest $test "-w $DEFAULT_GOCFLAGS" - } elseif { [string match "// \$G \$D/\$F.go && \$L \$F.\$A && ! ./\$A.out" \ - $test_line] \ - || [string match "// \$G \$D/\$F.go && \$L \$F.\$A && ! ./\$A.out || echo BUG: *" \ - $test_line] \ - || [string match "// \$G \$D/\$F.go && \$L \$F.\$A && (! ./\$A.out || echo BUG: *" \ - $test_line] \ - || ($test_line == "// \$G \$D/\$F.go && \$L \$F.\$A &&" - && $test_line2 == "// ((! sh -c ./\$A.out) >/dev/null 2>&1 || echo BUG: should fail)") } { + } elseif { [string match "// \$G \$D/\$F.go && \$L \$F.\$A && ! ./\$A.out || echo BUG: *" \ + $test_line] } { go-execute-xfail $test - } elseif { [string match "// errchk \$G \$F.go" $test_line] \ - || [string match "// errchk \$G -e \$F.go" $test_line] \ - || [string match "// errchk \$G \$D/\$F.go" $test_line] \ - || [string match "//errchk \$G \$D/\$F.go" $test_line] \ - || [string match "// errchk \$G -e \$D/\$F.go" \ - $test_line] \ - || [string match "// ! errchk \$G \$D/\$F.go" $test_line] \ - || [string match "// ! errchk \$G -e \$D/\$F.go" \ - $test_line] \ - || [string match "// errchk \$G \$F.go || true" \ - $test_line] \ - || [string match "// errchk \$G \$D/\$F.go || true" \ - $test_line] \ - || [string match "// errchk \$G -e \$D/\$F.go || true" \ - $test_line] \ - || [string match "// errchk \$G \$D/\$F.go || echo BUG*" \ - $test_line] } { + } elseif { $test_line == "// errorcheck" } { errchk $test "" - } elseif { [string match \ - "// \$G \$D/\$F.dir/bug0.go && \$G \$D/\$F.dir/bug1.go || echo BUG*" \ - $test_line] \ - || [string match \ - "// \$G \$D/\$F.dir/one.go && \$G \$D/\$F.dir/two.go" \ - $test_line] } { - if { [string match \ - "// \$G \$D/\$F.dir/bug0.go && \$G \$D/\$F.dir/bug1.go || echo BUG*" \ - $test_line] } { - set name1 "bug0.go" - set name2 "bug1.go" - } elseif { [string match \ - "// \$G \$D/\$F.dir/one.go && \$G \$D/\$F.dir/two.go" \ - $test_line] } { - set name1 "one.go" - set name2 "two.go" - } + } elseif { $test_line == "// compiledir" } { set hold_runtests $runtests set runtests "go-test.exp" set dg-do-what-default "assemble" - regsub "\\.go$" $test ".dir/$name1" file1 - dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" - regsub "\\.go$" $test ".dir/$name2" file2 - dg-test $file2 "-O" "-w $DEFAULT_GOCFLAGS" - file delete "[file rootname [file tail $file1]].o" + set dir "[file rootname $test].dir" + set del {} + foreach f [lsort [glob "$dir/*.go"]] { + dg-test -keep-output $f "-O" "-w $DEFAULT_GOCFLAGS" + lappend del "[file rootname [file tail $f]].o" + } + foreach f $del { + file delete $f + } set runtests $hold_runtests + } elseif { "$test_line" == "" + || [string match "// true*" $test_line] + || [string match "// skip*" $test_line] } { + # Not a real test, just ignore. } elseif { [string match \ "// \$G \$D/\$F.dir/bug0.go && errchk \$G \$D/\$F.dir/bug1.go" \ $test_line] \ || [string match \ - "// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/p2.go" \ - $test_line] \ - || [string match \ - "// \$G \$D/\$F.dir/b.go && \$G \$D/\$F.dir/a.go" \ - $test_line] \ - || [string match \ "// \$G \$D/\$F.dir/io.go && errchk \$G -e \$D/\$F.dir/main.go" \ $test_line] } { if { [string match \ @@ -607,16 +537,6 @@ proc go-gc-tests { } { set name1 "bug0.go" set name2 "bug1.go" } elseif { [string match \ - "// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/p2.go" \ - $test_line] } { - set name1 "p1.go" - set name2 "p2.go" - } elseif { [string match \ - "// \$G \$D/\$F.dir/b.go && \$G \$D/\$F.dir/a.go" \ - $test_line] } { - set name1 "b.go" - set name2 "a.go" - } elseif { [string match \ "// \$G \$D/\$F.dir/io.go && errchk \$G -e \$D/\$F.dir/main.go" \ $test_line] } { set name1 "io.go" @@ -643,35 +563,6 @@ proc go-gc-tests { } { file delete "[file rootname [file tail $file1]].o" set runtests $hold_runtests } elseif { [string match \ - "// \$G \$D/\$F.dir/bug0.go && (! \$G \$D/\$F.dir/bug1.go || echo BUG*" \ - $test_line] } { - set hold_runtests $runtests - set runtests "go-test.exp" - set dg-do-what-default "assemble" - regsub "\\.go$" $test ".dir/bug0.go" file1 - dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" - regsub "\\.go$" $test ".dir/bug1.go" file2 - setup_xfail "*-*-*" - dg-test $file2 "-O" "-w $DEFAULT_GOCFLAGS" - file delete "[file rootname [file tail $file1]].o" - set runtests $hold_runtests - } elseif { [string match \ - "// \$G \$D/\$F.dir/bug0.go && \$G \$D/\$F.dir/bug1.go && (! \$G \$D/\$F.dir/bug2.go || echo BUG*" \ - $test_line] } { - set hold_runtests $runtests - set runtests "go-test.exp" - set dg-do-what-default "assemble" - regsub "\\.go$" $test ".dir/bug0.go" file1 - dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" - regsub "\\.go$" $test ".dir/bug1.go" file2 - dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS" - regsub "\\.go$" $test ".dir/bug2.go" file3 - setup_xfail "*-*-*" - dg-test $file3 "-O" "-w $DEFAULT_GOCFLAGS" - file delete "[file rootname [file tail $file1]].o" - file delete "[file rootname [file tail $file2]].o" - set runtests $hold_runtests - } elseif { [string match \ "// \$G \$D/\$F.dir/bug0.go && \$G \$D/\$F.dir/bug1.go && errchk \$G \$D/\$F.dir/bug2.go" \ $test_line] } { set hold_runtests $runtests @@ -691,7 +582,10 @@ proc go-gc-tests { } { $test_line] \ || [string match \ "// \$G \$D/\$F.dir/p.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out" \ - $test_line] } { + $test_line] \ + || $test_line == "// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out" \ + || $test_line == "// \$G \$D/\$F.dir/lib.go && \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" \ + || $test_line == "// \$G \$D/method4a.go && \$G \$D/\$F.go && \$L \$F.\$A && ./$\A.out" } { if { [string match \ "// \$G \$D/bug160.dir/x.go && \$G \$D/bug160.dir/y.go && \$L y.\$A && ./\$A.out" \ $test_line] } { @@ -702,14 +596,29 @@ proc go-gc-tests { } { $test_line] } { set name1 "p.go" set name2 "main.go" + } elseif { $test_line == "// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out" } { + set name1 "p1.go" + set name2 "main.go" + } elseif { $test_line == "// \$G \$D/\$F.dir/lib.go && \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" } { + set name1 "lib.go" + set name2 "" + } elseif { $test_line == "// \$G \$D/method4a.go && \$G \$D/\$F.go && \$L \$F.\$A && ./$\A.out" } { + set name1 "method4a.go" + set name2 "" } set hold_runtests $runtests set runtests "go-test.exp" set dg-do-what-default "assemble" regsub "\\.go$" $test ".dir/$name1" file1 + if { $name1 == "method4a.go" } { + set file1 "[file dirname $test]/method4a.go" + } dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" set ofile1 "[file rootname [file tail $file1]].o" regsub "\\.go$" $test ".dir/$name2" file2 + if { $name2 == "" } { + set file2 $test + } dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS" set ofile2 "[file rootname [file tail $file2]].o" set dg-do-what-default "link" @@ -723,6 +632,29 @@ proc go-gc-tests { } { $status $name file delete $ofile1 $ofile2 $output_file set runtests $hold_runtests + } elseif { $test_line == "// \$G \$D/\$F.dir/one.go && \$G \$D/\$F.dir/two.go && \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" } { + set hold_runtests $runtests + set runtests "go-test.exp" + set dg-do-what-default "assemble" + regsub "\\.go$" $test ".dir/one.go" file1 + dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" + set ofile1 "[file rootname [file tail $file1]].o" + regsub "\\.go$" $test ".dir/two.go" file2 + dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS" + set ofile2 "[file rootname [file tail $file2]].o" + dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS" + set ofile3 "[file rootname [file tail $test]].o" + set dg-do-what-default "link" + set output_file "./[file rootname [file tail $test]].exe" + set comp_output [go_target_compile "$ofile1 $ofile2 $ofile3" \ + $output_file "executable" "$options"] + set comp_output [go-dg-prune $target_triplet $comp_output] + verbose -log $comp_output + set result [go_load "$output_file" "" ""] + set status [lindex $result 0] + $status $name + file delete $ofile1 $ofile2 $ofile3 $output_file + set runtests $hold_runtests } elseif { [string match \ "// \$G \$D/bug191.dir/a.go && \$G \$D/bug191.dir/b.go && \$G \$D/\$F.go && \$L \$F.\$A" \ $test_line] } { @@ -816,38 +748,6 @@ proc go-gc-tests { } { } file delete $ofile1 $ofile2 $output_file set runtests $hold_runtests - } elseif { [string match \ - "// \$G \$D/\$F.dir/chanbug.go && \$G -I. \$D/\$F.dir/chanbug2.go" \ - $test_line] } { - set hold_runtests $runtests - set runtests "go-test.exp" - set dg-do-what-default "assemble" - regsub "\\.go$" $test ".dir/chanbug.go" file1 - dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" - regsub "\\.go$" $test ".dir/chanbug2.go" file2 - dg-test $file2 "-O" "-w $DEFAULT_GOCFLAGS" - file delete "[file rootname [file tail $file1]].o" - set runtests $hold_runtests - } elseif { [string match \ - "// (! \$G \$D/\$F.go) | grep 'initialization loop' *" \ - $test_line] } { - set dg-do-what-default "assemble" - setup_xfail "*-*-*" - go-dg-runtest $test "-w $DEFAULT_GOCFLAGS" - } elseif { [string match \ - "// \$G \$D/\$F.dir/x.go && errchk \$G \$D/\$F.dir/y.go" \ - $test_line] } { - set hold_runtests $runtests - set runtests "go-test.exp" - set dg-do-what-default "assemble" - regsub "\\.go$" $test ".dir/x.go" file1 - dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" - regsub "\\.go$" $test ".dir/y.go" file2 - errchk $file2 "" - file delete "[file rootname [file tail $file1]].o" - set runtests $hold_runtests - } elseif { "$test_line" == "" || [string match "// true*" $test_line] } { - # Not a real test, just ignore. } elseif { $test_line == "// \$G \$D/\$F.dir/bug0.go &&" \ && $test_line2 == "// \$G \$D/\$F.dir/bug1.go &&" \ && $test_line3 == "// \$G \$D/\$F.dir/bug2.go &&" \ @@ -921,7 +821,7 @@ proc go-gc-tests { } { } file delete $ofile1 $ofile2 $output_file set runtests $hold_runtests - } elseif { $test_line == "// \$G \$D/\$F.go \$D/cmplxdivide1.go && \$L \$D/\$F.\$A && ./\$A.out" } { + } elseif { $test_line == "// run cmplxdivide1.go" } { regsub "/\[^/\]*$" $test "/cmplxdivide1.go" test2 set output_file "./[file rootname [file tail $test]].o" set comp_output [go_target_compile "$test $test2" \ @@ -954,10 +854,8 @@ proc go-gc-tests { } { file delete tmp.x # Disable optimizations as this test takes a long time # to compile. - set hold $TORTURE_OPTIONS - set TORTURE_OPTIONS [ list { -O0 -g }] + set TORTURE_OPTIONS [list { -O0 -g -fno-var-tracking-assignments }] go-torture-execute "./tmp.go" - set TORTURE_OPTIONS $hold } if { [catch "exec $output_file -pass 1 >tmp.go"] != 0 } { fail "$name execution 1" @@ -994,59 +892,6 @@ proc go-gc-tests { } { } file delete $output_file set runtests $hold_runtests - } elseif { [string match \ - "// \$G \$D/\$F.dir/p.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ! ./\$A.out || echo BUG*" \ - $test_line] } { - set hold_runtests $runtests - set runtests "go-test.exp" - set dg-do-what-default "assemble" - regsub "\\.go$" $test ".dir/p.go" file1 - dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" - set ofile1 "[file rootname [file tail $file1]].o" - regsub "\\.go$" $test ".dir/main.go" file2 - dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS" - set ofile2 "[file rootname [file tail $file2]].o" - set output_file "./[file rootname [file tail $test]].exe" - set comp_output [go_target_compile "$ofile1 $ofile2" \ - $output_file "executable" "$options"] - set comp_output [go-dg-prune $target_triplet $comp_output] - if [string match "" $comp_output] { - setup_xfail "*-*-*" - set result [go_load "$output_file" "" ""] - set status [lindex $result 0] - $status $name - } else { - verbose -log $comp_output - fail $name - } - file delete $ofile1 $ofile2 $output_file - set runtests $hold_runtests - } elseif { $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out >tmp.go &&" - && $test_line2 == "// \$G tmp.go && \$L tmp.\$A && ./\$A.out || echo BUG: select5" } { - set go_execute_args "" - set hold_runtests $runtests - set runtests "go-test.exp" - set dg-do-what-default "link" - dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS" - set output_file "./[file rootname [file tail $test]].exe" - set base "[file rootname [file tail $test]]" - if [isnative] { - if { [catch "exec $output_file > $base-out.go"] != 0 } { - fail "$name execution" - } else { - pass "$name execution" - file delete $base-out.x - # Disable optimizations as this test takes a long time - # to compile. - set hold $TORTURE_OPTIONS - set TORTURE_OPTIONS [ list { -O0 -g }] - go-torture-execute "./$base-out.go" - set TORTURE_OPTIONS $hold - } - file delete $base-out.go - } - file delete $output_file - set runtests $hold_runtests } elseif { $test_line == "// errchk \$G -e \$D/\$F.dir/\[ab\].go" } { regsub "\\.go$" $test ".dir/a.go" file1 regsub "\\.go$" $test ".dir/b.go" file2 @@ -1057,7 +902,7 @@ proc go-gc-tests { } { go-torture-execute $test } elseif { $test_line == "// \$G -N -o slow.\$A \$D/bug369.dir/pkg.go &&" \ && $test_line2 == "// \$G -o fast.\$A \$D/bug369.dir/pkg.go &&" \ - && $test_line3 == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" } { + && $test_line3 == "// run" } { set hold_runtests $runtests set runtests "go-test.exp" set dg-do-what-default "assemble" @@ -1094,30 +939,19 @@ proc go-gc-tests { } { dg-test $test "-O" "-w $DEFAULT_GOCFLAGS" file delete "[file rootname [file tail $file1]].o" set runtests $hold_runtests - } elseif { $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out >tmp.go &&" - && $test_line2 == "// \$G tmp.go && \$L tmp.\$A && ./\$A.out" } { - set go_execute_args "" + } elseif { [string match "// \$G \$D/\$F.dir/one.go && \$G \$D/\$F.dir/two.go || echo BUG*" \ + $test_line ] } { set hold_runtests $runtests set runtests "go-test.exp" - set dg-do-what-default "link" - dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS" - set output_file "./[file rootname [file tail $test]].exe" - set base "[file rootname [file tail $test]]" - if [isnative] { - if { [catch "exec $output_file >$base-out.go"] != 0 } { - fail "$name execution" - } else { - pass "$name execution" - file delete $base-out.x - go-torture-execute "./$base-out.go" - } - file delete $base-out.go - } - file delete $output_file + set dg-do-what-default "assemble" + regsub "\\.go$" $test ".dir/one.go" file1 + dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" + set ofile1 "[file rootname [file tail $file1]].o" + regsub "\\.go$" $test ".dir/two.go" file2 + dg-test $file2 "-O" "-w $DEFAULT_GOCFLAGS" + file delete $ofile1 set runtests $hold_runtests - } elseif { $test_line == "// # generated by cmplxdivide.c" } { - # Ignore. - } elseif { $test_line == "// \$G \$D/bug302.dir/p.go && gopack grc pp.a p.\$A && \$G \$D/bug302.dir/main.go" \ + } elseif { $test_line == "// \$G \$D/bug302.dir/p.go && pack grc pp.a p.\$A && \$G \$D/bug302.dir/main.go" \ || $test_line == "// \$G \$D/empty.go && errchk \$G \$D/\$F.go" } { # These tests import the same package under two different # names, which gccgo does not support. @@ -1127,14 +961,22 @@ proc go-gc-tests { } { # as an initializer will be generated for any code which # has global variables which need to be registered as GC # roots. - } elseif { $test_line == "// errchk -0 \$G -m -l \$D/\$F.go" } { + } elseif { $test_line == "// errorcheck -0 -m" + || $test_line == "// errorcheck -0 -m -l" } { # This tests debug output of the gc compiler, which is # meaningless for gccgo. - } elseif { $test_line == "// \[ \$O == 6 \] || errchk \$G -e \$D/\$F.go" \ - || $test_line == "// \[ \$O != 6 \] || errchk \$G -e \$D/\$F.go" } { + } elseif { $test_line == "// \[ \$A == 6 \] || errchk \$G -e \$D/\$F.go" \ + || $test_line == "// \[ \$A != 6 \] || errchk \$G -e \$D/\$F.go" } { # This tests specific handling of the gc compiler on types # that are too large. It is target specific in a way I # haven't bothered to check for here. + } elseif { $test_line == "// \$G \$D/\$F.go && \$L -X main.tbd hello \$F.\$A && ./\$A.out" } { + # This tests the gc ld -X option, which gccgo does not + # support. + } elseif { $test_line == "// \$G \$D/pkg.go && pack grc pkg.a pkg.\$A 2> /dev/null && rm pkg.\$A && errchk \$G -I. -u \$D/main.go" + || $test_line == "// \$G \$D/pkg.go && pack grcS pkg.a pkg.\$A 2> /dev/null && rm pkg.\$A && \$G -I. -u \$D/main.go" } { + # This tests the gc -u option, which gccgo does not + # support. } else { clone_output "$name: unrecognized test line: $test_line" unsupported $name @@ -1142,6 +984,7 @@ proc go-gc-tests { } { set go_compile_args "" set go_execute_args "" + set TORTURE_OPTIONS [list { -O2 -g }] } set dg-do-what-default ${saved-dg-do-what-default}