aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/iface_test.go
diff options
context:
space:
mode:
authorGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-22 17:43:43 -0300
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-22 17:43:43 -0300
commita926878ddbd5a98b272c22171ce58663fc04c3e0 (patch)
tree86af256e5d9a9c06263c00adc90e5fe348008c43 /libgo/go/runtime/iface_test.go
parent542730f087133690b47e036dfd43eb0db8a650ce (diff)
parent07cbaed8ba7d1b6e4ab3a9f44175502a4e1ecdb1 (diff)
downloadgcc-devel/autopar_devel.zip
gcc-devel/autopar_devel.tar.gz
gcc-devel/autopar_devel.tar.bz2
Merge branch 'autopar_rebase2' into autopar_develdevel/autopar_devel
Quickly commit changes in the rebase branch.
Diffstat (limited to 'libgo/go/runtime/iface_test.go')
-rw-r--r--libgo/go/runtime/iface_test.go66
1 files changed, 51 insertions, 15 deletions
diff --git a/libgo/go/runtime/iface_test.go b/libgo/go/runtime/iface_test.go
index d63ea79..43d3698 100644
--- a/libgo/go/runtime/iface_test.go
+++ b/libgo/go/runtime/iface_test.go
@@ -95,6 +95,19 @@ func BenchmarkNeIfaceConcrete(b *testing.B) {
}
}
+func BenchmarkConvT2EByteSized(b *testing.B) {
+ b.Run("bool", func(b *testing.B) {
+ for i := 0; i < b.N; i++ {
+ e = yes
+ }
+ })
+ b.Run("uint8", func(b *testing.B) {
+ for i := 0; i < b.N; i++ {
+ e = eight8
+ }
+ })
+}
+
func BenchmarkConvT2ESmall(b *testing.B) {
for i := 0; i < b.N; i++ {
e = ts
@@ -322,18 +335,22 @@ func TestZeroConvT2x(t *testing.T) {
var (
eight8 uint8 = 8
eight8I T8 = 8
+ yes bool = true
- zero16 uint16 = 0
- zero16I T16 = 0
- one16 uint16 = 1
+ zero16 uint16 = 0
+ zero16I T16 = 0
+ one16 uint16 = 1
+ thousand16 uint16 = 1000
- zero32 uint32 = 0
- zero32I T32 = 0
- one32 uint32 = 1
+ zero32 uint32 = 0
+ zero32I T32 = 0
+ one32 uint32 = 1
+ thousand32 uint32 = 1000
- zero64 uint64 = 0
- zero64I T64 = 0
- one64 uint64 = 1
+ zero64 uint64 = 0
+ zero64I T64 = 0
+ one64 uint64 = 1
+ thousand64 uint64 = 1000
zerostr string = ""
zerostrI Tstr = ""
@@ -381,6 +398,23 @@ func BenchmarkConvT2Ezero(b *testing.B) {
})
})
b.Run("nonzero", func(b *testing.B) {
+ b.Run("str", func(b *testing.B) {
+ for i := 0; i < b.N; i++ {
+ e = nzstr
+ }
+ })
+ b.Run("slice", func(b *testing.B) {
+ for i := 0; i < b.N; i++ {
+ e = nzslice
+ }
+ })
+ b.Run("big", func(b *testing.B) {
+ for i := 0; i < b.N; i++ {
+ e = nzbig
+ }
+ })
+ })
+ b.Run("smallint", func(b *testing.B) {
b.Run("16", func(b *testing.B) {
for i := 0; i < b.N; i++ {
e = one16
@@ -396,19 +430,21 @@ func BenchmarkConvT2Ezero(b *testing.B) {
e = one64
}
})
- b.Run("str", func(b *testing.B) {
+ })
+ b.Run("largeint", func(b *testing.B) {
+ b.Run("16", func(b *testing.B) {
for i := 0; i < b.N; i++ {
- e = nzstr
+ e = thousand16
}
})
- b.Run("slice", func(b *testing.B) {
+ b.Run("32", func(b *testing.B) {
for i := 0; i < b.N; i++ {
- e = nzslice
+ e = thousand32
}
})
- b.Run("big", func(b *testing.B) {
+ b.Run("64", func(b *testing.B) {
for i := 0; i < b.N; i++ {
- e = nzbig
+ e = thousand64
}
})
})