]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/const3.go
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / test / const3.go
index dd5c88958d762250b78286e0267f78734a993d14..3f4e3d1ae6fa9adf095afe91e176daa3708fe86b 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test typed integer constants.
+
 package main
 
 import "fmt"
@@ -26,4 +28,10 @@ func main() {
                println("type info didn't propagate in const: got", s)
                panic("fail")
        }
+       x := uint(5)
+       y := float64(uint64(1)<<x)      // used to fail to compile
+       if y != 32 {
+               println("wrong y", y)
+               panic("fail")
+       }
 }