-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The issue is expected to be fixed when Unified IR is enabled by default, so adding a test to make sure thing works correctly. Updates #53702 Change-Id: Id9d7d7ca4506103df0d10785ed5ee170d69988ba Reviewed-on: https://go-review.googlesource.com/c/go/+/423434 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> Auto-Submit: Cuong Manh Le <[email protected]>
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// run | ||
|
||
// Copyright 2022 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package main | ||
|
||
type Elem struct{} | ||
|
||
func (*Elem) Wait(callback func()) {} | ||
|
||
type Base struct { | ||
elem [8]*Elem | ||
} | ||
|
||
var g_val = 1 | ||
|
||
func (s *Base) Do() *int { | ||
resp := &g_val | ||
for _, e := range s.elem { | ||
e.Wait(func() { | ||
*resp = 0 | ||
}) | ||
} | ||
return resp | ||
} | ||
|
||
type Sub struct { | ||
*Base | ||
} | ||
|
||
func main() { | ||
a := Sub{new(Base)} | ||
resp := a.Do() | ||
if resp != nil && *resp != 1 { | ||
panic("FAIL") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters