Commit 2fe97c33 authored by Rob Pike's avatar Rob Pike

test pairwise iota assignment

R=rsc
DELTA=13  (13 added, 0 deleted, 0 changed)
OCL=20638
CL=20641
parent 3f8aa662
......@@ -67,6 +67,12 @@ const (
t;
)
const (
abit, amask = 1 << iota, 1 << iota - 1;
bbit, bmask = 1 << iota, 1 << iota - 1;
cbit, cmask = 1 << iota, 1 << iota - 1;
)
func main() {
assert(x == 0, "x");
assert(y == 1, "y");
......@@ -104,4 +110,11 @@ func main() {
assert(s == "a", "s");
assert(t == "b", "t");
assert(abit == 1, "abit");
assert(amask == 0, "amask");
assert(bbit == 2, "bbit");
assert(bmask == 1, "bmask");
assert(cbit == 4, "cbit");
assert(cmask == 3, "cmask");
}
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