From patchwork Thu Jun 22 14:29:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 779548 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wtkVN33XFz9sR8 for ; Fri, 23 Jun 2017 00:29:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="CNR5Yivf"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=TdgjI67/jz+GE6wfhmF60Q3nxs1cWweANnTjAXlXgzjQOn y26EH1O5CnsFSzJFSW4xFv9lgFu/GAEfnp+5AC668YkJireBISkKJ/B/maTy4Bgp bPXzVNHmnEBZn3skbvEdvOEY865p/sLp0+n5qFv01VULSXu17Mbefi/wcMnkU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=dUKqz7PH6EnHGSrGUMdxKEZvb8Q=; b=CNR5YivfTiAh3a7keDoZ lqccqcezBis6fdX/363JHhloaQndfOY+/BOk3aPTrcsIY1YLGaWeRCZEdcH6RP3J sA+dgrH9O95rZW635jWGesf3yuIyGKSTNv2RnSm5IA/wUwP7+rbXHNm7VrQiJRny +L2SnvPTxIM+QS0b/oy1CE4= Received: (qmail 83726 invoked by alias); 22 Jun 2017 14:29:08 -0000 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 Received: (qmail 83707 invoked by uid 89); 22 Jun 2017 14:29:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=UD:T, panic X-HELO: mail-oi0-f53.google.com Received: from mail-oi0-f53.google.com (HELO mail-oi0-f53.google.com) (209.85.218.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Jun 2017 14:29:05 +0000 Received: by mail-oi0-f53.google.com with SMTP id c189so9838106oia.2 for ; Thu, 22 Jun 2017 07:29:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=SFf2HbD9zv2ZD1WutXKimrOdFsfj2PYh+aj9AijSmYM=; b=VTR70PTkZ7b9QcopK4ZTHQLdp+xLnIVMBuHhoCbLcH/7OYJVvyA8OjbQ6KkQXQCEW9 sAdfo6Imc+nFugAOBjuZj6owoWfxwKNqF0cDgnp0MMs5ghHERiyED+V3PRKkTXO3Aigl 31r/WOlGDvWBfAmSeldReNcr48Xbjc6rxJd/0XAZSWhpNWl4w1jhH3I7or5Ek61zSXVt hnU+BnY8vmU0rgN9VFXOMUFEpOjxhhWQcx9xybS2aYifkaL3jkXLcWi2tKhOpWR4OJi9 19KrDWXzfL0GOkIhTvnpYMuDJm7IAEZsD38VuN0KBiG/c55OKbL7E89szqthEz/cTay+ uZzg== X-Gm-Message-State: AKS2vOzn+s2XbFsuTDEiFr03CIq4xE90tvU81H8atFxRmhacayZNmqi7 lTT1PsNhpboZY/yJstlKf4MrM5DA7gZEB/0= X-Received: by 10.202.50.70 with SMTP id y67mr1646008oiy.106.1498141743601; Thu, 22 Jun 2017 07:29:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.217.87 with HTTP; Thu, 22 Jun 2017 07:29:03 -0700 (PDT) From: Ian Lance Taylor Date: Thu, 22 Jun 2017 07:29:03 -0700 Message-ID: Subject: libgo patch committed: Adjust runtime tests for gccgo To: gcc-patches , "gofrontend-dev@googlegroups.com" This patch to libgo adjusts some runtime tests for gccgo: - don't run tests that depend on SetCgoTraceback - don't expect a '(' after the function name in a traceback - change the expected name of nested functions in a traceback These tests are not currently run, but they will be soon. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 249556) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -e017833e4ce4a3bc3ba02eac4351b15c86157ec0 +a81079a81b63714221674f07d13bedc768092f27 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/go/runtime/crash_cgo_test.go =================================================================== --- libgo/go/runtime/crash_cgo_test.go (revision 249205) +++ libgo/go/runtime/crash_cgo_test.go (working copy) @@ -251,6 +251,9 @@ func TestCgoCrashTraceback(t *testing.T) if runtime.GOOS != "linux" || runtime.GOARCH != "amd64" { t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH) } + if runtime.Compiler == "gccgo" { + t.Skip("gccgo does not have SetCgoTraceback") + } got := runTestProg(t, "testprogcgo", "CrashTraceback") for i := 1; i <= 3; i++ { if !strings.Contains(got, fmt.Sprintf("cgo symbolizer:%d", i)) { @@ -261,6 +264,9 @@ func TestCgoCrashTraceback(t *testing.T) func TestCgoTracebackContext(t *testing.T) { t.Parallel() + if runtime.Compiler == "gccgo" { + t.Skip("gccgo does not have SetCgoTraceback") + } got := runTestProg(t, "testprogcgo", "TracebackContext") want := "OK\n" if got != want { @@ -273,6 +279,9 @@ func testCgoPprof(t *testing.T, buildArg if runtime.GOOS != "linux" || runtime.GOARCH != "amd64" { t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH) } + if runtime.Compiler == "gccgo" { + t.Skip("gccgo does not have SetCgoTraceback") + } testenv.MustHaveGoRun(t) exe, err := buildTestProg(t, "testprogcgo", buildArg) @@ -332,6 +341,9 @@ func TestRaceProf(t *testing.T) { if runtime.GOOS != "linux" || runtime.GOARCH != "amd64" { t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH) } + if runtime.Compiler == "gccgo" { + t.Skip("gccgo does not have SetCgoTraceback") + } testenv.MustHaveGoRun(t) Index: libgo/go/runtime/crash_test.go =================================================================== --- libgo/go/runtime/crash_test.go (revision 249205) +++ libgo/go/runtime/crash_test.go (working copy) @@ -225,6 +225,9 @@ func TestGoexitDeadlock(t *testing.T) { } func TestStackOverflow(t *testing.T) { + if runtime.Compiler == "gccgo" { + t.Skip("gccgo does not do stack overflow checking") + } output := runTestProg(t, "testprog", "StackOverflow") want := "runtime: goroutine stack exceeds 1474560-byte limit\nfatal error: stack overflow" if !strings.HasPrefix(output, want) { @@ -302,7 +305,7 @@ func TestNoHelperGoroutines(t *testing.T func TestBreakpoint(t *testing.T) { output := runTestProg(t, "testprog", "Breakpoint") - want := "runtime.Breakpoint()" + want := "runtime.Breakpoint" if !strings.Contains(output, want) { t.Fatalf("output:\n%s\n\nwant output containing: %s", output, want) } @@ -419,8 +422,16 @@ func TestPanicTraceback(t *testing.T) { // Check functions in the traceback. fns := []string{"main.pt1.func1", "panic", "main.pt2.func1", "panic", "main.pt2", "main.pt1"} + if runtime.Compiler == "gccgo" { + fns = []string{"main.$nested", "panic", "main.$nested", "panic", "main.pt2", "main.pt1"} + } for _, fn := range fns { - re := regexp.MustCompile(`(?m)^` + regexp.QuoteMeta(fn) + `\(.*\n`) + var re *regexp.Regexp + if runtime.Compiler != "gccgo" { + re = regexp.MustCompile(`(?m)^` + regexp.QuoteMeta(fn) + `\(.*\n`) + } else { + re = regexp.MustCompile(`(?m)^` + regexp.QuoteMeta(fn) + `.*\n`) + } idx := re.FindStringIndex(output) if idx == nil { t.Fatalf("expected %q function in traceback:\n%s", fn, output) @@ -454,6 +465,9 @@ func TestPanicLoop(t *testing.T) { func TestMemPprof(t *testing.T) { testenv.MustHaveGoRun(t) + if runtime.Compiler == "gccgo" { + t.Skip("gccgo may not have the pprof tool") + } exe, err := buildTestProg(t, "testprog") if err != nil { Index: libgo/go/runtime/crash_unix_test.go =================================================================== --- libgo/go/runtime/crash_unix_test.go (revision 249205) +++ libgo/go/runtime/crash_unix_test.go (working copy) @@ -105,7 +105,7 @@ func TestCrashDumpsAllThreads(t *testing // Before https://golang.org/cl/2811 running threads would say // "goroutine running on other thread; stack unavailable". out = outbuf.Bytes() - n := bytes.Count(out, []byte("main.loop(")) + n := bytes.Count(out, []byte("main.loop")) if n != 4 { t.Errorf("found %d instances of main.loop; expected 4", n) t.Logf("%s", out)