codekingpro/portable-devtools
114k
1// build2 3// Copyright 2016 The Go Authors. All rights reserved.4// Use of this source code is governed by a BSD-style5// license that can be found in the LICENSE file.6 7// This file tests that required algs are generated,8// even when similar types have been marked elsewhere9// as not needing algs. See CLs 19769 and 19770.10 11package main12 13import "fmt"14 15//go:noinline16func f(m map[[8]string]int) int {17 var k [8]string18 return m[k]19}20 21//go:noinline22func g(m map[[8]interface{}]int) int {23 var k [8]interface{}24 return m[k]25}26 27//go:noinline28func h(m map[[2]string]int) int {29 var k [2]string30 return m[k]31}32 33type T map[string]interface{}34 35func v(x ...string) string {36 return x[0] + x[1]37}38 39func main() {40 fmt.Println(41 f(map[[8]string]int{}),42 g(map[[8]interface{}]int{}),43 h(map[[2]string]int{}),44 v("a", "b"),45 )46}47 