1 // $G $F.go && $L $F.$A && ./$A.out
3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
9 func assert(cond
bool, msg
string) {
11 print("assertion fail: ", msg
, "\n")
21 g
float = 4.5 * float(iota)
48 i
= (a
<< iota) + (b
* iota)
66 s
= string(iota + 'a')
71 abit
, amask
= 1 << iota, 1 << iota - 1
72 bbit
, bmask
= 1 << iota, 1 << iota - 1
73 cbit
, cmask
= 1 << iota, 1 << iota - 1
81 assert(g
== 18.0, "g")
107 assert(p
== 0.0, "p")
108 assert(q
== 1.0, "q")
109 assert(r
== 2.0, "r")
111 assert(s
== "a", "s")
112 assert(t
== "b", "t")
114 assert(abit
== 1, "abit")
115 assert(amask
== 0, "amask")
116 assert(bbit
== 2, "bbit")
117 assert(bmask
== 1, "bmask")
118 assert(cbit
== 4, "cbit")
119 assert(cmask
== 3, "cmask")