Russ Cox | 8080384 | 2012-02-16 23:49:59 -0500 | [diff] [blame] | 1 | // run |
Russ Cox | fb55066 | 2010-02-17 15:28:45 -0800 | [diff] [blame] | 2 | |
Emmanuel Odeke | 53fd522 | 2016-04-10 14:32:26 -0700 | [diff] [blame] | 3 | // Copyright 2010 The Go Authors. All rights reserved. |
Russ Cox | fb55066 | 2010-02-17 15:28:45 -0800 | [diff] [blame] | 4 | // Use of this source code is governed by a BSD-style |
| 5 | // license that can be found in the LICENSE file. |
| 6 | |
| 7 | package main |
| 8 | |
| 9 | import "math" |
| 10 | |
| 11 | func f() float64 { |
| 12 | math.Pow(2, 2) |
| 13 | return 1 |
| 14 | } |
| 15 | |
| 16 | func main() { |
| 17 | for i := 0; i < 10; i++ { |
| 18 | // 386 float register bug used to load constant before call |
| 19 | if -5 < f() { |
| 20 | } else { |
| 21 | println("BUG 1") |
| 22 | return |
| 23 | } |
| 24 | if f() > -7 { |
| 25 | } else { |
| 26 | println("BUG 2") |
| 27 | } |
| 28 | |
| 29 | if math.Pow(2, 3) != 8 { |
| 30 | println("BUG 3") |
| 31 | } |
| 32 | } |
| 33 | } |