diff options
author | Ian Lance Taylor <iant@golang.org> | 2022-01-09 20:20:43 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2022-01-10 21:27:19 +0000 |
commit | 8b9b365493220a7bfd87fd3c27301e43baa35a0d (patch) | |
tree | 7a76d0b0a69bb0097fe37fab368773221cb22bc7 /test | |
parent | 55d10acb72c2dc5524aae69ade560f3cf308a864 (diff) | |
download | go-git-8b9b365493220a7bfd87fd3c27301e43baa35a0d.tar.gz |
cmd/compile: use exact constant in go_asm.h
Fixes #50523
Change-Id: Idab1b44d106250e9301d90ee6571f0ea51242dd9
Reviewed-on: https://go-review.googlesource.com/c/go/+/377074
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Liz Fong-Jones <lizf@honeycomb.io>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/asmhdr.dir/main.go | 12 | ||||
-rw-r--r-- | test/asmhdr.dir/main.s | 3 |
2 files changed, 12 insertions, 3 deletions
diff --git a/test/asmhdr.dir/main.go b/test/asmhdr.dir/main.go index 808b5de7bb..4e1813d2ed 100644 --- a/test/asmhdr.dir/main.go +++ b/test/asmhdr.dir/main.go @@ -16,12 +16,15 @@ const ( 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 { @@ -46,6 +49,9 @@ func main() { 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 diff --git a/test/asmhdr.dir/main.s b/test/asmhdr.dir/main.s index 7e2d8e7abd..bc2aa99b0b 100644 --- a/test/asmhdr.dir/main.s +++ b/test/asmhdr.dir/main.s @@ -14,6 +14,9 @@ GLOBL ·bigIntAsm(SB),RODATA,$8 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 |