aboutsummaryrefslogtreecommitdiff
path: root/test/iota.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2008-12-05 15:37:09 -0800
committerRob Pike <r@golang.org>2008-12-05 15:37:09 -0800
commit2fe97c336d7402e09f689d89c8d6f7abb4e92043 (patch)
tree1744c5da4a88f9b97fac002abc16f7ae6b335d20 /test/iota.go
parent3f8aa662e9710f821411dc9c6f0f0be8c756e40d (diff)
downloadgo-2fe97c336d7402e09f689d89c8d6f7abb4e92043.tar.gz
go-2fe97c336d7402e09f689d89c8d6f7abb4e92043.zip
test pairwise iota assignment
R=rsc DELTA=13 (13 added, 0 deleted, 0 changed) OCL=20638 CL=20641
Diffstat (limited to 'test/iota.go')
-rw-r--r--test/iota.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/iota.go b/test/iota.go
index 57e6b7615e..393edac804 100644
--- a/test/iota.go
+++ b/test/iota.go
@@ -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");
}