if t == constant.Float || t == constant.Complex {
break
}
- fmt.Fprintf(b, "#define const_%s %v\n", n.Sym().Name, n.Val())
+ fmt.Fprintf(b, "#define const_%s %v\n", n.Sym().Name, n.Val().ExactString())
case ir.OTYPE:
t := n.Type()
bigInt = 0xffffffffffffffff
stringVal = "test"
+
+ longStringVal = "this_is_a_string_constant_longer_than_seventy_characters_which_used_to_fail_see_issue_50253"
)
var (
- smallIntAsm int64
- bigIntAsm uint64
- stringAsm [len(stringVal)]byte
+ smallIntAsm int64
+ bigIntAsm uint64
+ stringAsm [len(stringVal)]byte
+ longStringAsm [len(longStringVal)]byte
)
type typ struct {
if stringVal != string(stringAsm[:]) {
println("stringVal", stringVal, "!=", string(stringAsm[:]))
}
+ if longStringVal != string(longStringAsm[:]) {
+ println("longStringVal", longStringVal, "!=", string(longStringAsm[:]))
+ }
// We also include boolean consts in go_asm.h, but they're
// defined to be "true" or "false", and it's not clear how to
DATA ·stringAsm(SB)/4, $const_stringVal
GLOBL ·stringAsm(SB),RODATA,$4
+DATA ·longStringAsm(SB)/91, $const_longStringVal
+GLOBL ·longStringAsm(SB),RODATA,$91
+
DATA ·typSize(SB)/8, $typ__size
GLOBL ·typSize(SB),RODATA,$8