aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/go.test/test/chan/select5.go2
-rw-r--r--gcc/testsuite/go.test/test/cmplxdivide.go14
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug358.go2
-rw-r--r--gcc/testsuite/go.test/test/ken/divconst.go2
-rw-r--r--gcc/testsuite/go.test/test/ken/modconst.go2
-rw-r--r--gcc/testsuite/go.test/test/mallocrand.go2
-rw-r--r--gcc/testsuite/go.test/test/stringrange.go15
-rw-r--r--gcc/testsuite/go.test/test/utf.go32
8 files changed, 41 insertions, 30 deletions
diff --git a/gcc/testsuite/go.test/test/chan/select5.go b/gcc/testsuite/go.test/test/chan/select5.go
index 6071821..cc2cc71 100644
--- a/gcc/testsuite/go.test/test/chan/select5.go
+++ b/gcc/testsuite/go.test/test/chan/select5.go
@@ -18,7 +18,7 @@ import (
"fmt"
"io"
"os"
- "template"
+ "text/template"
)
func main() {
diff --git a/gcc/testsuite/go.test/test/cmplxdivide.go b/gcc/testsuite/go.test/test/cmplxdivide.go
index 6a67b17..461ee97 100644
--- a/gcc/testsuite/go.test/test/cmplxdivide.go
+++ b/gcc/testsuite/go.test/test/cmplxdivide.go
@@ -9,14 +9,14 @@
package main
import (
- "cmath"
"fmt"
"math"
+ "math/cmplx"
)
-type Test struct{
- f, g complex128
- out complex128
+type Test struct {
+ f, g complex128
+ out complex128
}
var nan = math.NaN()
@@ -25,9 +25,9 @@ var negzero = math.Copysign(0, -1)
func calike(a, b complex128) bool {
switch {
- case cmath.IsInf(a) && cmath.IsInf(b):
+ case cmplx.IsInf(a) && cmplx.IsInf(b):
return true
- case cmath.IsNaN(a) && cmath.IsNaN(b):
+ case cmplx.IsNaN(a) && cmplx.IsNaN(b):
return true
}
return a == b
@@ -36,7 +36,7 @@ func calike(a, b complex128) bool {
func main() {
bad := false
for _, t := range tests {
- x := t.f/t.g
+ x := t.f / t.g
if !calike(x, t.out) {
if !bad {
fmt.Printf("BUG\n")
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug358.go b/gcc/testsuite/go.test/test/fixedbugs/bug358.go
index f43709b..82fbf7f 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug358.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug358.go
@@ -10,8 +10,8 @@
package main
import (
- "http"
"io/ioutil" // GCCGO_ERROR "imported and not used"
+ "net/http"
"os"
)
diff --git a/gcc/testsuite/go.test/test/ken/divconst.go b/gcc/testsuite/go.test/test/ken/divconst.go
index c3b9092..5a64d16 100644
--- a/gcc/testsuite/go.test/test/ken/divconst.go
+++ b/gcc/testsuite/go.test/test/ken/divconst.go
@@ -6,7 +6,7 @@
package main
-import "rand"
+import "math/rand"
const Count = 1e5
diff --git a/gcc/testsuite/go.test/test/ken/modconst.go b/gcc/testsuite/go.test/test/ken/modconst.go
index acb8831..c2603a0 100644
--- a/gcc/testsuite/go.test/test/ken/modconst.go
+++ b/gcc/testsuite/go.test/test/ken/modconst.go
@@ -6,7 +6,7 @@
package main
-import "rand"
+import "math/rand"
const Count = 1e5
diff --git a/gcc/testsuite/go.test/test/mallocrand.go b/gcc/testsuite/go.test/test/mallocrand.go
index f014b44..726e367 100644
--- a/gcc/testsuite/go.test/test/mallocrand.go
+++ b/gcc/testsuite/go.test/test/mallocrand.go
@@ -10,7 +10,7 @@ package main
import (
"flag"
- "rand"
+ "math/rand"
"runtime"
"unsafe"
)
diff --git a/gcc/testsuite/go.test/test/stringrange.go b/gcc/testsuite/go.test/test/stringrange.go
index d5ada26..6a7063e 100644
--- a/gcc/testsuite/go.test/test/stringrange.go
+++ b/gcc/testsuite/go.test/test/stringrange.go
@@ -9,28 +9,29 @@ package main
import (
"fmt"
"os"
- "utf8"
+ "unicode/utf8"
)
func main() {
s := "\000\123\x00\xca\xFE\u0123\ubabe\U0000babe\U0010FFFFx"
- expect := []int{ 0, 0123, 0, 0xFFFD, 0xFFFD, 0x123, 0xbabe, 0xbabe, 0x10FFFF, 'x' }
+ expect := []rune{0, 0123, 0, 0xFFFD, 0xFFFD, 0x123, 0xbabe, 0xbabe, 0x10FFFF, 'x'}
offset := 0
- var i, c int
+ var i int
+ var c rune
ok := true
cnum := 0
for i, c = range s {
- rune, size := utf8.DecodeRuneInString(s[i:len(s)]) // check it another way
+ r, size := utf8.DecodeRuneInString(s[i:len(s)]) // check it another way
if i != offset {
fmt.Printf("unexpected offset %d not %d\n", i, offset)
ok = false
}
- if rune != expect[cnum] {
- fmt.Printf("unexpected rune %d from DecodeRuneInString: %x not %x\n", i, rune, expect[cnum])
+ if r != expect[cnum] {
+ fmt.Printf("unexpected rune %d from DecodeRuneInString: %x not %x\n", i, r, expect[cnum])
ok = false
}
if c != expect[cnum] {
- fmt.Printf("unexpected rune %d from range: %x not %x\n", i, rune, expect[cnum])
+ fmt.Printf("unexpected rune %d from range: %x not %x\n", i, r, expect[cnum])
ok = false
}
offset += size
diff --git a/gcc/testsuite/go.test/test/utf.go b/gcc/testsuite/go.test/test/utf.go
index a93fc29..9fba581 100644
--- a/gcc/testsuite/go.test/test/utf.go
+++ b/gcc/testsuite/go.test/test/utf.go
@@ -6,10 +6,10 @@
package main
-import "utf8"
+import "unicode/utf8"
func main() {
- var chars [6] int
+ var chars [6]rune
chars[0] = 'a'
chars[1] = 'b'
chars[2] = 'c'
@@ -21,16 +21,22 @@ func main() {
s += string(chars[i])
}
var l = len(s)
- for w, i, j := 0,0,0; i < l; i += w {
- var r int
+ for w, i, j := 0, 0, 0; i < l; i += w {
+ var r rune
r, w = utf8.DecodeRuneInString(s[i:len(s)])
- if w == 0 { panic("zero width in string") }
- if r != chars[j] { panic("wrong value from string") }
+ if w == 0 {
+ panic("zero width in string")
+ }
+ if r != chars[j] {
+ panic("wrong value from string")
+ }
j++
}
// encoded as bytes: 'a' 'b' 'c' e6 97 a5 e6 9c ac e8 aa 9e
const L = 12
- if L != l { panic("wrong length constructing array") }
+ if L != l {
+ panic("wrong length constructing array")
+ }
a := make([]byte, L)
a[0] = 'a'
a[1] = 'b'
@@ -44,11 +50,15 @@ func main() {
a[9] = 0xe8
a[10] = 0xaa
a[11] = 0x9e
- for w, i, j := 0,0,0; i < L; i += w {
- var r int
+ for w, i, j := 0, 0, 0; i < L; i += w {
+ var r rune
r, w = utf8.DecodeRune(a[i:L])
- if w == 0 { panic("zero width in bytes") }
- if r != chars[j] { panic("wrong value from bytes") }
+ if w == 0 {
+ panic("zero width in bytes")
+ }
+ if r != chars[j] {
+ panic("wrong value from bytes")
+ }
j++
}
}