Logo
Explore Help
Sign In
1berry/go
1
0
Fork 0
You've already forked go
Code Issues Packages Projects Releases Wiki Activity
go/test/asmhdr.go

10 lines
237 B
Go
Raw Permalink Normal View History

cmd/compile: emit sensible go_asm.h consts for big ints Currently, the compiler will emit any const that doesn't fit in an int64 to go_asm.h like #define const_stackPreempt constant.intVal{val:(*big.Int)(0xc000c06c40)} This happens because dumpasmhdr formats the constant.Value using the verb "%#v". Since constant.Value doesn't implement the GoString() method, this just prints the Go-syntax representation of the value. This happens to work for small integer constants, which go/constant represents directly as an int64, but not for integer constants that don't fit in an int64, which go/constant represents as a big.Int. Make these constants usable by changing the formatting verb to "%v", which will call the String() method, giving a reasonable result in all cases. Change-Id: I365eeb88c8acfc43ff377cc873432269bde3f541 Reviewed-on: https://go-review.googlesource.com/c/go/+/359954 Trust: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2021-08-06 17:01:25 -04:00
// buildrundir
// Copyright 2021 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.
// Test the -asmhdr output of the compiler.
package ignored
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 480ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API