mirror of
				https://github.com/go-delve/delve.git
				synced 2025-11-01 03:42:59 +08:00 
			
		
		
		
	 b9a8bd7f41
			
		
	
	b9a8bd7f41
	
	
	
		
			
			- updated go/packages to support new export format - rewrite testinline.go fixture because the compiler got too smart with constant folding - temporarily disable staticcheck on go1.20 because it doesn't support the new export format. - workaround for go.dev/cl/429601
		
			
				
	
	
		
			27 lines
		
	
	
		
			301 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			301 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package main
 | |
| 
 | |
| import "fmt"
 | |
| 
 | |
| func inlineThis(a int) int {
 | |
| 	z := a * a
 | |
| 	return f(z + a)
 | |
| }
 | |
| 
 | |
| func initialize(a, b *int) {
 | |
| 	*a = 3
 | |
| 	*b = 4
 | |
| }
 | |
| 
 | |
| func main() {
 | |
| 	var a, b int
 | |
| 	initialize(&a, &b)
 | |
| 	a = inlineThis(a)
 | |
| 	b = inlineThis(b)
 | |
| 	fmt.Printf("%d %d\n", a, b)
 | |
| }
 | |
| 
 | |
| //go:noinline
 | |
| func f(x int) int {
 | |
| 	return x
 | |
| }
 |