]> Cypherpunks repositories - gostls13.git/commitdiff
test: skip inlining check in escape4.go
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 30 Sep 2022 17:44:43 +0000 (00:44 +0700)
committerGopher Robot <gobot@golang.org>
Sat, 1 Oct 2022 01:52:17 +0000 (01:52 +0000)
This is the last failed test in Unified IR, since it can inline f5 and
f6 but the old frontend can not. So marking them as //go:noinline, with
a TODO for re-enable once GOEXPERIMENT=nounified is gone.

Fixes #53058

Change-Id: Ifbbc49c87997a53e1b323048f0067f0257655fad
Reviewed-on: https://go-review.googlesource.com/c/go/+/437217
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>

test/escape4.go
test/run.go

index 4e50231bf959b1a36534ba6db412da28ac0ef392..e381248476c1ad728c09770e1f8a470eb8a04685 100644 (file)
@@ -38,6 +38,10 @@ func f2() {} // ERROR "can inline f2"
 func f3() { panic(1) } // ERROR "can inline f3" "1 escapes to heap"
 func f4() { recover() }
 
+// TODO(cuonglm): remove f5, f6 //go:noinline and update the error message
+//                once GOEXPERIMENT=nounified is gone.
+
+//go:noinline
 func f5() *byte {
        type T struct {
                x [1]byte
@@ -46,6 +50,7 @@ func f5() *byte {
        return &t.x[0]
 }
 
+//go:noinline
 func f6() *byte {
        type T struct {
                x struct {
index e33ab4cff337c9b58f5627b0b548899cc73cd69c..5497c6c23120229f15a4b11e24cee22aa48f8365 100644 (file)
@@ -342,9 +342,7 @@ func (t *test) initExpectFail() {
                failureSets = append(failureSets, types2Failures32Bit)
        }
 
-       if unifiedEnabled {
-               failureSets = append(failureSets, unifiedFailures)
-       } else {
+       if !unifiedEnabled {
                failureSets = append(failureSets, go118Failures)
        }
 
@@ -2019,10 +2017,6 @@ var _ = setOf(
        "fixedbugs/issue7525.go",  // types2 reports init cycle error on different line - ok otherwise
 )
 
-var unifiedFailures = setOf(
-       "escape4.go", // unified IR can inline f5 and f6; test doesn't expect this
-)
-
 func setOf(keys ...string) map[string]bool {
        m := make(map[string]bool, len(keys))
        for _, key := range keys {