modernc.org/gc@v1.0.1-0.20240304020402-f0dba7c97c2b/testdata/errchk/test/fixedbugs/issue23719.go (about)

     1  // run
     2  
     3  // Copyright 2018 The Go Authors. All rights reserved.
     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  func main() {
    10  	v1 := [2]int32{-1, 88}
    11  	v2 := [2]int32{-1, 99}
    12  	if v1 == v2 {
    13  		panic("bad comparison")
    14  	}
    15  
    16  	w1 := [2]int16{-1, 88}
    17  	w2 := [2]int16{-1, 99}
    18  	if w1 == w2 {
    19  		panic("bad comparison")
    20  	}
    21  	x1 := [4]int16{-1, 88, 88, 88}
    22  	x2 := [4]int16{-1, 99, 99, 99}
    23  	if x1 == x2 {
    24  		panic("bad comparison")
    25  	}
    26  
    27  	a1 := [2]int8{-1, 88}
    28  	a2 := [2]int8{-1, 99}
    29  	if a1 == a2 {
    30  		panic("bad comparison")
    31  	}
    32  	b1 := [4]int8{-1, 88, 88, 88}
    33  	b2 := [4]int8{-1, 99, 99, 99}
    34  	if b1 == b2 {
    35  		panic("bad comparison")
    36  	}
    37  	c1 := [8]int8{-1, 88, 88, 88, 88, 88, 88, 88}
    38  	c2 := [8]int8{-1, 99, 99, 99, 99, 99, 99, 99}
    39  	if c1 == c2 {
    40  		panic("bad comparison")
    41  	}
    42  }