From 43055d2379cfb1b5b1b09e243a9829e52e12b60a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 20 Aug 2019 21:15:46 +0000 Subject: compiler, runtime: implement shifts by signed amounts Shifting by signed types is a new language feature in Go 1.13. This requires a patch to the testsuite. Updates golang/go#19113 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/190977 * go.test/test/fixedbugs/bug073.go: Update for language changes. From-SVN: r274755 --- libgo/runtime/go-runtime-error.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libgo') diff --git a/libgo/runtime/go-runtime-error.c b/libgo/runtime/go-runtime-error.c index c9ccf98..8179e68 100644 --- a/libgo/runtime/go-runtime-error.c +++ b/libgo/runtime/go-runtime-error.c @@ -55,7 +55,10 @@ enum DIVISION_BY_ZERO = 11, /* Go statement with nil function. */ - GO_NIL = 12 + GO_NIL = 12, + + /* Shift by negative value. */ + SHIFT_BY_NEGATIVE = 13 }; extern void __go_runtime_error (int32) __attribute__ ((noreturn)); @@ -112,6 +115,9 @@ __go_runtime_error (int32 i) runtime_g()->m->throwing = -1; runtime_throw ("go of nil func value"); + case SHIFT_BY_NEGATIVE: + runtime_panicstring ("negative shift amount"); + default: runtime_panicstring ("unknown runtime error"); } -- cgit v1.1