URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [fixedbugs/] [bug093.go] - Rev 700
Compare with Previous | Blame | View Log
// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: fails incorrectly// Copyright 2009 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package maintype S struct {}func (p *S) M() {}type I interface {M();}func main() {var p *S = nil;var i I = p; // this should be possible even though p is nil: we still know the typei.M(); // should be possible since we know the type, and don't ever use the receiver}/*throw: ifaces2i: nil pointerSIGSEGV: segmentation violationFaulting address: 0x0pc: 0x1b7d0x1b7d?zithrow(30409, 0, 0, ...)throw(0x76c9, 0x0, 0x0, ...)0x207f?zisys·ifaces2i(31440, 0, 31480, ...)sys·ifaces2i(0x7ad0, 0x7af8, 0x0, ...)0x136f?zimain·main(1, 0, 1606416424, ...)main·main(0x1, 0x7fff5fbff828, 0x0, ...)rax 0x1rbx 0x1rcx 0x33b5rdx 0x0rdi 0x1rsi 0x7684rbp 0x7684rsp 0xafb8r8 0x0r9 0x0r10 0x1002r11 0x206r12 0x0r13 0x0r14 0x7c48r15 0xa000rip 0x1b7drflags 0x10202cs 0x27fs 0x10gs 0x48*/
