Commit 36d417c0 authored by Austin Clements's avatar Austin Clements

[dev.power64] runtime: test CAS on large unsigned 32-bit numbers

This adds a test to runtime·check to ensure CAS of large
unsigned 32-bit numbers does not accidentally sign-extend its
arguments.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/162490044
parent 097362fd
......@@ -226,6 +226,12 @@ runtime·check(void)
if(z != 4)
runtime·throw("cas4");
z = 0xffffffff;
if(!runtime·cas(&z, 0xffffffff, 0xfffffffe))
runtime·throw("cas5");
if(z != 0xfffffffe)
runtime·throw("cas6");
k = (byte*)0xfedcb123;
if(sizeof(void*) == 8)
k = (byte*)((uintptr)k<<10);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment