aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2019-08-20 21:15:46 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-08-20 21:15:46 +0000
commit43055d2379cfb1b5b1b09e243a9829e52e12b60a (patch)
tree25ee7c396a4bc315d93ef63cd8092a66275cd5a1 /libgo/runtime
parent5ba5ad304a16644614c3ea143181682a94cb999e (diff)
downloadgcc-43055d2379cfb1b5b1b09e243a9829e52e12b60a.zip
gcc-43055d2379cfb1b5b1b09e243a9829e52e12b60a.tar.gz
gcc-43055d2379cfb1b5b1b09e243a9829e52e12b60a.tar.bz2
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
Diffstat (limited to 'libgo/runtime')
-rw-r--r--libgo/runtime/go-runtime-error.c8
1 files changed, 7 insertions, 1 deletions
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");
}